diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-03-08 06:09:47 -0500 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-03-22 16:43:35 -0400 |
commit | eeff66ef6e33925f615d49e6c846263e342ab60e (patch) | |
tree | 588907158fd45ca6c71d5385f98830ecc2bd56ac /net | |
parent | 5a7e0a8cf50cf905403f5a498e86d1f97cfcf51b (diff) |
net/9p: Convert the in the 9p rpc call path to GFP_NOFS
Without this we can cause reclaim allocation in writepage.
[ 3433.448430] =================================
[ 3433.449117] [ INFO: inconsistent lock state ]
[ 3433.449117] 2.6.38-rc5+ #84
[ 3433.449117] ---------------------------------
[ 3433.449117] inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-R} usage.
[ 3433.449117] kswapd0/505 [HC0[0]:SC0[0]:HE1:SE1] takes:
[ 3433.449117] (iprune_sem){+++++-}, at: [<ffffffff810ebbab>] shrink_icache_memory+0x45/0x2b1
[ 3433.449117] {RECLAIM_FS-ON-W} state was registered at:
[ 3433.449117] [<ffffffff8107fe5f>] mark_held_locks+0x52/0x70
[ 3433.449117] [<ffffffff8107ff02>] lockdep_trace_alloc+0x85/0x9f
[ 3433.449117] [<ffffffff810d353d>] slab_pre_alloc_hook+0x18/0x3c
[ 3433.449117] [<ffffffff810d3fd5>] kmem_cache_alloc+0x23/0xa2
[ 3433.449117] [<ffffffff8127be77>] idr_pre_get+0x2d/0x6f
[ 3433.449117] [<ffffffff815434eb>] p9_idpool_get+0x30/0xae
[ 3433.449117] [<ffffffff81540123>] p9_client_rpc+0xd7/0x9b0
[ 3433.449117] [<ffffffff815427b0>] p9_client_clunk+0x88/0xdb
[ 3433.449117] [<ffffffff811d56e5>] v9fs_evict_inode+0x3c/0x48
[ 3433.449117] [<ffffffff810eb511>] evict+0x1f/0x87
[ 3433.449117] [<ffffffff810eb5c0>] dispose_list+0x47/0xe3
[ 3433.449117] [<ffffffff810eb8da>] evict_inodes+0x138/0x14f
[ 3433.449117] [<ffffffff810d90e2>] generic_shutdown_super+0x57/0xe8
[ 3433.449117] [<ffffffff810d91e8>] kill_anon_super+0x11/0x50
[ 3433.449117] [<ffffffff811d4951>] v9fs_kill_super+0x49/0xab
[ 3433.449117] [<ffffffff810d926e>] deactivate_locked_super+0x21/0x46
[ 3433.449117] [<ffffffff810d9e84>] deactivate_super+0x40/0x44
[ 3433.449117] [<ffffffff810ef848>] mntput_no_expire+0x100/0x109
[ 3433.449117] [<ffffffff810f0aeb>] sys_umount+0x2f1/0x31c
[ 3433.449117] [<ffffffff8102c87b>] system_call_fastpath+0x16/0x1b
[ 3433.449117] irq event stamp: 192941
[ 3433.449117] hardirqs last enabled at (192941): [<ffffffff81568dcf>] _raw_spin_unlock_irq+0x2b/0x30
[ 3433.449117] hardirqs last disabled at (192940): [<ffffffff810b5f97>] shrink_inactive_list+0x290/0x2f5
[ 3433.449117] softirqs last enabled at (188470): [<ffffffff8105fd65>] __do_softirq+0x133/0x152
[ 3433.449117] softirqs last disabled at (188455): [<ffffffff8102d7cc>] call_softirq+0x1c/0x28
[ 3433.449117]
[ 3433.449117] other info that might help us debug this:
[ 3433.449117] 1 lock held by kswapd0/505:
[ 3433.449117] #0: (shrinker_rwsem){++++..}, at: [<ffffffff810b52e2>] shrink_slab+0x38/0x15f
[ 3433.449117]
[ 3433.449117] stack backtrace:
[ 3433.449117] Pid: 505, comm: kswapd0 Not tainted 2.6.38-rc5+ #84
[ 3433.449117] Call Trace:
[ 3433.449117] [<ffffffff8107fbce>] ? valid_state+0x17e/0x191
[ 3433.449117] [<ffffffff81036896>] ? save_stack_trace+0x28/0x45
[ 3433.449117] [<ffffffff81080426>] ? check_usage_forwards+0x0/0x87
[ 3433.449117] [<ffffffff8107fcf4>] ? mark_lock+0x113/0x22c
[ 3433.449117] [<ffffffff8108105f>] ? __lock_acquire+0x37a/0xcf7
[ 3433.449117] [<ffffffff8107fc0e>] ? mark_lock+0x2d/0x22c
[ 3433.449117] [<ffffffff81081077>] ? __lock_acquire+0x392/0xcf7
[ 3433.449117] [<ffffffff810b14d2>] ? determine_dirtyable_memory+0x15/0x28
[ 3433.449117] [<ffffffff81081a33>] ? lock_acquire+0x57/0x6d
[ 3433.449117] [<ffffffff810ebbab>] ? shrink_icache_memory+0x45/0x2b1
[ 3433.449117] [<ffffffff81567d85>] ? down_read+0x47/0x5c
[ 3433.449117] [<ffffffff810ebbab>] ? shrink_icache_memory+0x45/0x2b1
[ 3433.449117] [<ffffffff810ebbab>] ? shrink_icache_memory+0x45/0x2b1
[ 3433.449117] [<ffffffff810b5385>] ? shrink_slab+0xdb/0x15f
[ 3433.449117] [<ffffffff810b69bc>] ? kswapd+0x574/0x96a
[ 3433.449117] [<ffffffff810b6448>] ? kswapd+0x0/0x96a
[ 3433.449117] [<ffffffff810714e2>] ? kthread+0x7d/0x85
[ 3433.449117] [<ffffffff8102d6d4>] ? kernel_thread_helper+0x4/0x10
[ 3433.449117] [<ffffffff81569200>] ? restore_args+0x0/0x30
[ 3433.449117] [<ffffffff81071465>] ? kthread+0x0/0x85
[ 3433.449117] [<ffffffff8102d6d0>] ? kernel_thread_helper+0x0/0x10
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/9p/client.c | 10 | ||||
-rw-r--r-- | net/9p/protocol.c | 6 | ||||
-rw-r--r-- | net/9p/trans_fd.c | 2 | ||||
-rw-r--r-- | net/9p/trans_rdma.c | 6 | ||||
-rw-r--r-- | net/9p/util.c | 2 |
5 files changed, 13 insertions, 13 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 347ec0cd2718..2ccbf04d37df 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -223,7 +223,7 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag) | |||
223 | 223 | ||
224 | req = &c->reqs[row][col]; | 224 | req = &c->reqs[row][col]; |
225 | if (!req->tc) { | 225 | if (!req->tc) { |
226 | req->wq = kmalloc(sizeof(wait_queue_head_t), GFP_KERNEL); | 226 | req->wq = kmalloc(sizeof(wait_queue_head_t), GFP_NOFS); |
227 | if (!req->wq) { | 227 | if (!req->wq) { |
228 | printk(KERN_ERR "Couldn't grow tag array\n"); | 228 | printk(KERN_ERR "Couldn't grow tag array\n"); |
229 | return ERR_PTR(-ENOMEM); | 229 | return ERR_PTR(-ENOMEM); |
@@ -233,17 +233,17 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag) | |||
233 | P9_TRANS_PREF_PAYLOAD_SEP) { | 233 | P9_TRANS_PREF_PAYLOAD_SEP) { |
234 | int alloc_msize = min(c->msize, 4096); | 234 | int alloc_msize = min(c->msize, 4096); |
235 | req->tc = kmalloc(sizeof(struct p9_fcall)+alloc_msize, | 235 | req->tc = kmalloc(sizeof(struct p9_fcall)+alloc_msize, |
236 | GFP_KERNEL); | 236 | GFP_NOFS); |
237 | req->tc->capacity = alloc_msize; | 237 | req->tc->capacity = alloc_msize; |
238 | req->rc = kmalloc(sizeof(struct p9_fcall)+alloc_msize, | 238 | req->rc = kmalloc(sizeof(struct p9_fcall)+alloc_msize, |
239 | GFP_KERNEL); | 239 | GFP_NOFS); |
240 | req->rc->capacity = alloc_msize; | 240 | req->rc->capacity = alloc_msize; |
241 | } else { | 241 | } else { |
242 | req->tc = kmalloc(sizeof(struct p9_fcall)+c->msize, | 242 | req->tc = kmalloc(sizeof(struct p9_fcall)+c->msize, |
243 | GFP_KERNEL); | 243 | GFP_NOFS); |
244 | req->tc->capacity = c->msize; | 244 | req->tc->capacity = c->msize; |
245 | req->rc = kmalloc(sizeof(struct p9_fcall)+c->msize, | 245 | req->rc = kmalloc(sizeof(struct p9_fcall)+c->msize, |
246 | GFP_KERNEL); | 246 | GFP_NOFS); |
247 | req->rc->capacity = c->msize; | 247 | req->rc->capacity = c->msize; |
248 | } | 248 | } |
249 | if ((!req->tc) || (!req->rc)) { | 249 | if ((!req->tc) || (!req->rc)) { |
diff --git a/net/9p/protocol.c b/net/9p/protocol.c index 2ce515b859b3..8a4084fa8b5a 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c | |||
@@ -205,7 +205,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt, | |||
205 | if (errcode) | 205 | if (errcode) |
206 | break; | 206 | break; |
207 | 207 | ||
208 | *sptr = kmalloc(len + 1, GFP_KERNEL); | 208 | *sptr = kmalloc(len + 1, GFP_NOFS); |
209 | if (*sptr == NULL) { | 209 | if (*sptr == NULL) { |
210 | errcode = -EFAULT; | 210 | errcode = -EFAULT; |
211 | break; | 211 | break; |
@@ -273,7 +273,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt, | |||
273 | if (!errcode) { | 273 | if (!errcode) { |
274 | *wnames = | 274 | *wnames = |
275 | kmalloc(sizeof(char *) * *nwname, | 275 | kmalloc(sizeof(char *) * *nwname, |
276 | GFP_KERNEL); | 276 | GFP_NOFS); |
277 | if (!*wnames) | 277 | if (!*wnames) |
278 | errcode = -ENOMEM; | 278 | errcode = -ENOMEM; |
279 | } | 279 | } |
@@ -317,7 +317,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt, | |||
317 | *wqids = | 317 | *wqids = |
318 | kmalloc(*nwqid * | 318 | kmalloc(*nwqid * |
319 | sizeof(struct p9_qid), | 319 | sizeof(struct p9_qid), |
320 | GFP_KERNEL); | 320 | GFP_NOFS); |
321 | if (*wqids == NULL) | 321 | if (*wqids == NULL) |
322 | errcode = -ENOMEM; | 322 | errcode = -ENOMEM; |
323 | } | 323 | } |
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index a30471e51740..aa5672b15eae 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c | |||
@@ -350,7 +350,7 @@ static void p9_read_work(struct work_struct *work) | |||
350 | 350 | ||
351 | if (m->req->rc == NULL) { | 351 | if (m->req->rc == NULL) { |
352 | m->req->rc = kmalloc(sizeof(struct p9_fcall) + | 352 | m->req->rc = kmalloc(sizeof(struct p9_fcall) + |
353 | m->client->msize, GFP_KERNEL); | 353 | m->client->msize, GFP_NOFS); |
354 | if (!m->req->rc) { | 354 | if (!m->req->rc) { |
355 | m->req = NULL; | 355 | m->req = NULL; |
356 | err = -ENOMEM; | 356 | err = -ENOMEM; |
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 29a54ccd213d..150e0c4bbf40 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c | |||
@@ -424,7 +424,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) | |||
424 | struct p9_rdma_context *rpl_context = NULL; | 424 | struct p9_rdma_context *rpl_context = NULL; |
425 | 425 | ||
426 | /* Allocate an fcall for the reply */ | 426 | /* Allocate an fcall for the reply */ |
427 | rpl_context = kmalloc(sizeof *rpl_context, GFP_KERNEL); | 427 | rpl_context = kmalloc(sizeof *rpl_context, GFP_NOFS); |
428 | if (!rpl_context) { | 428 | if (!rpl_context) { |
429 | err = -ENOMEM; | 429 | err = -ENOMEM; |
430 | goto err_close; | 430 | goto err_close; |
@@ -437,7 +437,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) | |||
437 | */ | 437 | */ |
438 | if (!req->rc) { | 438 | if (!req->rc) { |
439 | req->rc = kmalloc(sizeof(struct p9_fcall)+client->msize, | 439 | req->rc = kmalloc(sizeof(struct p9_fcall)+client->msize, |
440 | GFP_KERNEL); | 440 | GFP_NOFS); |
441 | if (req->rc) { | 441 | if (req->rc) { |
442 | req->rc->sdata = (char *) req->rc + | 442 | req->rc->sdata = (char *) req->rc + |
443 | sizeof(struct p9_fcall); | 443 | sizeof(struct p9_fcall); |
@@ -468,7 +468,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) | |||
468 | req->rc = NULL; | 468 | req->rc = NULL; |
469 | 469 | ||
470 | /* Post the request */ | 470 | /* Post the request */ |
471 | c = kmalloc(sizeof *c, GFP_KERNEL); | 471 | c = kmalloc(sizeof *c, GFP_NOFS); |
472 | if (!c) { | 472 | if (!c) { |
473 | err = -ENOMEM; | 473 | err = -ENOMEM; |
474 | goto err_free1; | 474 | goto err_free1; |
diff --git a/net/9p/util.c b/net/9p/util.c index e048701a72d2..b84619b5ba22 100644 --- a/net/9p/util.c +++ b/net/9p/util.c | |||
@@ -92,7 +92,7 @@ int p9_idpool_get(struct p9_idpool *p) | |||
92 | unsigned long flags; | 92 | unsigned long flags; |
93 | 93 | ||
94 | retry: | 94 | retry: |
95 | if (idr_pre_get(&p->pool, GFP_KERNEL) == 0) | 95 | if (idr_pre_get(&p->pool, GFP_NOFS) == 0) |
96 | return 0; | 96 | return 0; |
97 | 97 | ||
98 | spin_lock_irqsave(&p->lock, flags); | 98 | spin_lock_irqsave(&p->lock, flags); |