1 |
ryao 12/08/22 07:28:13 |
2 |
|
3 |
Added: zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch |
4 |
zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch |
5 |
zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch |
6 |
Log: |
7 |
Ebuild to provide kernel module for sys-fs/zfs |
8 |
|
9 |
(Portage version: 2.1.11.9/cvs/Linux x86_64) |
10 |
|
11 |
Revision Changes Path |
12 |
1.1 sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch |
13 |
|
14 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch?rev=1.1&view=markup |
15 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch?rev=1.1&content-type=text/plain |
16 |
|
17 |
Index: zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch |
18 |
=================================================================== |
19 |
From a1c889dd6fb04d70439074a9399c9ea8f29f2cdb Mon Sep 17 00:00:00 2001 |
20 |
From: Richard Yao <ryao@×××××××××××××.edu> |
21 |
Date: Wed, 16 May 2012 18:16:02 -0400 |
22 |
Subject: [PATCH] Revert Disable direct reclaim for z_wr_* threads |
23 |
|
24 |
This commit used PF_MEMALLOC to prevent a memory reclaim deadlock. |
25 |
However, commit 49be0ccf1fdc2ce852271d4d2f8b7a9c2c4be6db eliminated |
26 |
the invocation of __cv_init(), which was the cause of the deadlock. |
27 |
PF_MEMALLOC has the side effect of permitting pages from ZONE_DMA |
28 |
to be allocated. The use of PF_MEMALLOC was found to cause stability |
29 |
problems when doing swap on zvols. Since this technique is known to |
30 |
cause problems and no longer fixes anything, we revert it. |
31 |
|
32 |
Signed-off-by: Richard Yao <ryao@×××××××××××××.edu> |
33 |
Signed-off-by: Brian Behlendorf <behlendorf1@××××.gov> |
34 |
Issue #726 |
35 |
--- |
36 |
include/sys/zfs_context.h | 1 - |
37 |
module/zfs/spa.c | 9 +++------ |
38 |
2 files changed, 3 insertions(+), 7 deletions(-) |
39 |
|
40 |
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h |
41 |
index e4af6fc..77dded3 100644 |
42 |
--- a/include/sys/zfs_context.h |
43 |
+++ b/include/sys/zfs_context.h |
44 |
@@ -382,7 +382,6 @@ extern kstat_t *kstat_create(char *, int, |
45 |
#define TASKQ_DYNAMIC 0x0004 /* Use dynamic thread scheduling */ |
46 |
#define TASKQ_THREADS_CPU_PCT 0x0008 /* Scale # threads by # cpus */ |
47 |
#define TASKQ_DC_BATCH 0x0010 /* Mark threads as batch */ |
48 |
-#define TASKQ_NORECLAIM 0x0020 /* Disable direct memory reclaim */ |
49 |
|
50 |
#define TQ_SLEEP KM_SLEEP /* Can block for memory */ |
51 |
#define TQ_NOSLEEP KM_NOSLEEP /* cannot block for memory; may fail */ |
52 |
diff --git a/module/zfs/spa.c b/module/zfs/spa.c |
53 |
index c33a33a..436cd26 100644 |
54 |
--- a/module/zfs/spa.c |
55 |
+++ b/module/zfs/spa.c |
56 |
@@ -617,8 +617,9 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config, |
57 |
|
58 |
static taskq_t * |
59 |
spa_taskq_create(spa_t *spa, const char *name, enum zti_modes mode, |
60 |
- uint_t value, uint_t flags) |
61 |
+ uint_t value) |
62 |
{ |
63 |
+ uint_t flags = TASKQ_PREPOPULATE; |
64 |
boolean_t batch = B_FALSE; |
65 |
|
66 |
switch (mode) { |
67 |
@@ -668,17 +669,13 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config, |
68 |
const zio_taskq_info_t *ztip = &zio_taskqs[t][q]; |
69 |
enum zti_modes mode = ztip->zti_mode; |
70 |
uint_t value = ztip->zti_value; |
71 |
- uint_t flags = 0; |
72 |
char name[32]; |
73 |
|
74 |
- if (t == ZIO_TYPE_WRITE) |
75 |
- flags |= TASKQ_NORECLAIM; |
76 |
- |
77 |
(void) snprintf(name, sizeof (name), |
78 |
"%s_%s", zio_type_name[t], zio_taskq_types[q]); |
79 |
|
80 |
spa->spa_zio_taskq[t][q] = |
81 |
- spa_taskq_create(spa, name, mode, value, flags); |
82 |
+ spa_taskq_create(spa, name, mode, value); |
83 |
} |
84 |
} |
85 |
} |
86 |
-- |
87 |
1.7.10 |
88 |
|
89 |
|
90 |
|
91 |
|
92 |
1.1 sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch |
93 |
|
94 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch?rev=1.1&view=markup |
95 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch?rev=1.1&content-type=text/plain |
96 |
|
97 |
Index: zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch |
98 |
=================================================================== |
99 |
From e2060f922f8526aecf437de4cc4dff4c3cdfae16 Mon Sep 17 00:00:00 2001 |
100 |
From: Richard Yao <ryao@×××××××××××××.edu> |
101 |
Date: Tue, 15 May 2012 23:19:32 -0400 |
102 |
Subject: [PATCH] Revert Fix ASSERTION(!dsl_pool_sync_context(tx->tx_pool)) |
103 |
|
104 |
Commit eec8164771bee067c3cd55ed0a16dadeeba276de worked around an issue |
105 |
involving direct reclaim through the use of PF_MEMALLOC. Since we |
106 |
are reworking thing to use KM_PUSHPAGE so that swap works, we revert |
107 |
this patch in favor of the use of KM_PUSHPAGE in the affected areas. |
108 |
|
109 |
Signed-off-by: Richard Yao <ryao@×××××××××××××.edu> |
110 |
Signed-off-by: Brian Behlendorf <behlendorf1@××××.gov> |
111 |
Issue #726 |
112 |
--- |
113 |
module/zfs/txg.c | 13 ------------- |
114 |
1 file changed, 13 deletions(-) |
115 |
|
116 |
diff --git a/module/zfs/txg.c b/module/zfs/txg.c |
117 |
index 5021e44..8d037f7 100644 |
118 |
--- a/module/zfs/txg.c |
119 |
+++ b/module/zfs/txg.c |
120 |
@@ -372,19 +372,6 @@ |
121 |
callb_cpr_t cpr; |
122 |
uint64_t start, delta; |
123 |
|
124 |
-#ifdef _KERNEL |
125 |
- /* |
126 |
- * Disable the normal reclaim path for the txg_sync thread. This |
127 |
- * ensures the thread will never enter dmu_tx_assign() which can |
128 |
- * otherwise occur due to direct reclaim. If this is allowed to |
129 |
- * happen the system can deadlock. Direct reclaim call path: |
130 |
- * |
131 |
- * ->shrink_icache_memory->prune_icache->dispose_list-> |
132 |
- * clear_inode->zpl_clear_inode->zfs_inactive->dmu_tx_assign |
133 |
- */ |
134 |
- current->flags |= PF_MEMALLOC; |
135 |
-#endif /* _KERNEL */ |
136 |
- |
137 |
txg_thread_enter(tx, &cpr); |
138 |
|
139 |
start = delta = 0; |
140 |
-- |
141 |
1.7.10 |
142 |
|
143 |
|
144 |
|
145 |
|
146 |
1.1 sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch |
147 |
|
148 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch?rev=1.1&view=markup |
149 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch?rev=1.1&content-type=text/plain |
150 |
|
151 |
Index: zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch |
152 |
=================================================================== |
153 |
From 78d26b8497b3845fc8130981c76214d6788f7a9d Mon Sep 17 00:00:00 2001 |
154 |
From: Richard Yao <ryao@×××××××××××××.edu> |
155 |
Date: Mon, 7 May 2012 14:14:45 -0400 |
156 |
Subject: [PATCH] Revert Fix zpl_writepage() deadlock |
157 |
|
158 |
The commit, cfc9a5c88f91f7b4d606fce89505e1f404691ea5, to fix deadlocks |
159 |
in zpl_writepage() relied on PF_MEMALLOC. That had the effect of |
160 |
disabling the direct reclaim path on all allocations originating from |
161 |
calls to this function, but it failed to address the actual cause of |
162 |
those deadlocks. This led to the same deadlocks being observed with |
163 |
swap on zvols, but not with swap on the loop device, which exercises |
164 |
this code. |
165 |
|
166 |
The use of PF_MEMALLOC also had the side effect of permitting |
167 |
allocations to be made from ZONE_DMA in instances that did not require |
168 |
it. This contributes to the possibility of panics caused by depletion |
169 |
of pages from ZONE_DMA. |
170 |
|
171 |
As such, we revert this patch in favor of a proper fix for both issues. |
172 |
|
173 |
Signed-off-by: Richard Yao <ryao@×××××××××××××.edu> |
174 |
Signed-off-by: Brian Behlendorf <behlendorf1@××××.gov> |
175 |
Issue #726 |
176 |
--- |
177 |
module/zfs/zpl_file.c | 15 +-------------- |
178 |
1 file changed, 1 insertion(+), 14 deletions(-) |
179 |
|
180 |
diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c |
181 |
index 5ac41c9..2e9f72a 100644 |
182 |
--- a/module/zfs/zpl_file.c |
183 |
+++ b/module/zfs/zpl_file.c |
184 |
@@ -358,20 +358,7 @@ |
185 |
ASSERT(PageLocked(pp)); |
186 |
ASSERT(!PageWriteback(pp)); |
187 |
|
188 |
- /* |
189 |
- * Disable the normal reclaim path for zpl_putpage(). This |
190 |
- * ensures that all memory allocations under this call path |
191 |
- * will never enter direct reclaim. If this were to happen |
192 |
- * the VM might try to write out additional pages by calling |
193 |
- * zpl_putpage() again resulting in a deadlock. |
194 |
- */ |
195 |
- if (current->flags & PF_MEMALLOC) { |
196 |
- (void) zfs_putpage(mapping->host, pp, wbc); |
197 |
- } else { |
198 |
- current->flags |= PF_MEMALLOC; |
199 |
- (void) zfs_putpage(mapping->host, pp, wbc); |
200 |
- current->flags &= ~PF_MEMALLOC; |
201 |
- } |
202 |
+ (void) zfs_putpage(mapping->host, pp, wbc); |
203 |
|
204 |
return (0); |
205 |
} |
206 |
-- |
207 |
1.7.10 |