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 294563 Details for
Bug 423521
memory leak on size-8192 buckets with NFSV4
[?]
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]
patch -- fix reference counting for NFS4 callback thread
0001-NFS-fix-reference-counting-for-NFSv4-callback-threa.patch (text/plain), 2.26 KB, created by
Jeff Layton
on 2008-02-11 14:44:07 UTC
(
hide
)
Description:
patch -- fix reference counting for NFS4 callback thread
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2008-02-11 14:44:07 UTC
Size:
2.26 KB
patch
obsolete
>From c259bbd0436ad28ecacc9db4edbe4cb3fda97d65 Mon Sep 17 00:00:00 2001 >From: Jeff Layton <jlayton@redhat.com> >Date: Mon, 11 Feb 2008 09:29:52 -0500 >Subject: [PATCH] NFS: fix reference counting for NFSv4 callback thread > >The reference counting for the NFSv4 callback thread stays artificially >high. When this thread comes down, it doesn't properly tear down the >svc_serv causing a memory leak. In my testing on an older kernel on >x86_64, memory would leak out of the 8k kmalloc slab so we're leaking at >least 2 pages every time the thread comes down. > >svc_create creates the svc_serv with a sv_nrthreads count of 1, and then >svc_create_thread() increments that count. So, whenever the callback >thread is started it has a sv_nrthreads count of 2. When coming down, it >calls svc_exit_thread which decrements that count and if it hits 0, it >tears everything down. > >The problem is that nfs_callback_up should be calling svc_destroy on >the svc_serv on both success and failure. This is how lockd_up_proto >handles the reference counting, and doing that here fixes the leak. > >Signed-off-by: Jeff Layton <jlayton@redhat.com> >--- > fs/nfs/callback.c | 12 ++++++------ > 1 files changed, 6 insertions(+), 6 deletions(-) > >diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c >index bd185a5..5e4a66f 100644 >--- a/fs/nfs/callback.c >+++ b/fs/nfs/callback.c >@@ -105,7 +105,7 @@ static void nfs_callback_svc(struct svc_rqst *rqstp) > */ > int nfs_callback_up(void) > { >- struct svc_serv *serv; >+ struct svc_serv *serv = NULL; > int ret = 0; > > lock_kernel(); >@@ -122,24 +122,24 @@ int nfs_callback_up(void) > ret = svc_create_xprt(serv, "tcp", nfs_callback_set_tcpport, > SVC_SOCK_ANONYMOUS); > if (ret <= 0) >- goto out_destroy; >+ goto out_err; > nfs_callback_tcpport = ret; > dprintk("Callback port = 0x%x\n", nfs_callback_tcpport); > > ret = svc_create_thread(nfs_callback_svc, serv); > if (ret < 0) >- goto out_destroy; >+ goto out_err; > nfs_callback_info.serv = serv; > wait_for_completion(&nfs_callback_info.started); > out: >+ if (serv) >+ svc_destroy(serv); > mutex_unlock(&nfs_callback_mutex); > unlock_kernel(); > return ret; >-out_destroy: >+out_err: > dprintk("Couldn't create callback socket or server thread; err = %d\n", > ret); >- svc_destroy(serv); >-out_err: > nfs_callback_info.users--; > goto out; > } >-- >1.5.3.8 >
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 423521
:
294150
|
294151
|
294563
|
295296
|
302874