Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 311138 Details for
Bug 451317
deadlock when rpc_malloc tries to flush NFS pages
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
proposed patch -- don't allow rpc_malloc to block
bz-451317-sunrpc-prevent-deadl (text/plain), 2.25 KB, created by
Jeff Layton
on 2008-07-07 11:24:21 UTC
(
hide
)
Description:
proposed patch -- don't allow rpc_malloc to block
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2008-07-07 11:24:21 UTC
Size:
2.25 KB
patch
obsolete
>BZ#451317: sunrpc: prevent deadlock by not allowing rpc_malloc to sleep > >From: Jeff Layton <jlayton@redhat.com> > >We don't want RPC's sleeping outside of the task scheduler while >allocating their buffer. Change rpc_malloc from using GFP_NOFS >to GFP_NOWAIT when allocating memory. > >Also, change the printk in call_allocate() to a dprintk since it'll >be somewhat more likely that it could fire. >--- > > net/sunrpc/clnt.c | 2 +- > net/sunrpc/sched.c | 14 ++++++++++---- > 2 files changed, 11 insertions(+), 5 deletions(-) > > >diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c >index 2fbf037..63a7a20 100644 >--- a/net/sunrpc/clnt.c >+++ b/net/sunrpc/clnt.c >@@ -734,7 +734,7 @@ call_allocate(struct rpc_task *task) > > if (xprt->ops->buf_alloc(task, bufsiz << 1) != NULL) > return; >- printk(KERN_INFO "RPC: buffer allocation failed for task %p\n", task); >+ dprintk("RPC: buffer allocation failed for task %p\n", task); > > if (RPC_IS_ASYNC(task) || !signalled()) { > xprt_release(task); >diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c >index 7e870ed..68f7e36 100644 >--- a/net/sunrpc/sched.c >+++ b/net/sunrpc/sched.c >@@ -758,10 +758,16 @@ static void rpc_async_schedule(void *arg) > * @task: RPC task that will use this buffer > * @size: requested byte size > * >- * We try to ensure that some NFS reads and writes can always proceed >- * by using a mempool when allocating 'small' buffers. >+ * To prevent rpciod from hanging, this allocator never sleeps, >+ * returning NULL if the request cannot be serviced immediately. >+ * The caller can arrange to sleep in a way that is safe for rpciod. >+ * >+ * Most requests are 'small' (under 2KiB) and can be serviced from a >+ * mempool, ensuring that NFS reads and writes can always proceed, >+ * and that there is good locality of reference for these buffers. >+ * > * In order to avoid memory starvation triggering more writebacks of >- * NFS requests, we use GFP_NOFS rather than GFP_KERNEL. >+ * NFS requests, we avoid using GFP_KERNEL. > */ > void * rpc_malloc(struct rpc_task *task, size_t size) > { >@@ -771,7 +777,7 @@ void * rpc_malloc(struct rpc_task *task, size_t size) > if (task->tk_flags & RPC_TASK_SWAPPER) > gfp = GFP_ATOMIC; > else >- gfp = GFP_NOFS; >+ gfp = GFP_NOWAIT; > > if (size > RPC_BUFFER_MAXSIZE) { > req->rq_buffer = kmalloc(size, gfp);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 451317
: 311138