From: Jeff Layton <jlayton@redhat.com>
To: "Kevin Coffman" <kwc@umich.edu>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
linux-nfs@vger.kernel.org, nfsv4@linux-nfs.org
Subject: Re: possible module refcount leak with auth_gss
Date: Wed, 10 Dec 2008 11:25:06 -0500 [thread overview]
Message-ID: <20081210112506.2b2d2c3a@tleilax.poochiereds.net> (raw)
In-Reply-To: <4d569c330812091521s6b9405faq910cb94f067f3b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Tue, 9 Dec 2008 18:21:08 -0500
"Kevin Coffman" <kwc@umich.edu> wrote:
> On Tue, Dec 9, 2008 at 3:38 PM, Jeff Layton <jlayton@redhat.com> wrote:
> > On Mon, 8 Dec 2008 12:37:06 -0500
> > "J. Bruce Fields" <bfields@fieldses.org> wrote:
> >
> >> On Mon, Dec 08, 2008 at 10:28:55AM -0500, Jeff Layton wrote:
> >> > We had someone report a bug against Fedora that they were seeing very
> >> > high module reference counts for some krb5 related modules on his nfs
> >> > server. For instance:
> >> >
> >> > # lsmod
> >> > Module Size Used by
> >> > des_generic 25216 52736
> >> > cbc 12160 52736
> >> > rpcsec_gss_krb5 15632 26370
> >> >
> >> > ...the cbc and des_generic each have roughly 2 module references per
> >> > rpcsec_gss_krb5 refcount so I'm assuming that the "lynchpin" here is
> >> > the rpcsec_gss_krb5 refcount which seems to be increasing w/o bound.
> >>
> >> You may want to see this discussion:
> >>
> >> http://marc.info/?t=122819524700001&r=1&w=2
> >>
> >> And these patches:
> >>
> >> http://marc.info/?l=linux-nfs&m=122843371318602&w=2
> >>
> >
> > Doh! I saw that discussion and didn't make the connection. Thanks for
> > pointing that out.
> >
> >> In addition to increasing the timeouts on those cache entries, perhaps
> >> we could flush the contexts on rmmod? Or change the reference counting
> >> somehow--e.g., take a reference only in the presence of export cache
> >> entries that mention krb5, and destroy contexts when the last such goes
> >> away?
> >>
> >
> > That sounds like a better scheme than what we have currently. As it stands
> > now, you can't just unplug the module -- you have to wait for the entries
> > in the cache to time out.
> >
> > FWIW, I tested out Kevin's patches and it still didn't seem to help. The
> > refcounts never seemed to go down (even after several hours). How long
> > should the context live in the cache with those patches? Until the krb5
> > ticket expires? I'll leave the box in this state until around this time
> > tomorrow to be sure (that's when the ticket expires).
>
> Yes, that should be the normal expiration with my patches. The
> default ticket lifetime is 10 hours I believe, but that is
> configurable by realm (and service). You can shorten the lifetime for
> testing by setting an /etc/krb5.conf option. This example should
> limit lifetimes to 5 minutes (300 seconds) for testing purposes.
>
> [libdefaults]
> ticket_lifetime = 300s
>
Thanks Kevin,
It works. With a nfs-utils that has your patches to properly set the
cache timeouts it looks like this problem is generally fixed. The module
refcounts go back to normal once the tickets expire.
That said, I think we should have a look at Bruce's suggestion for changing
the way that the module refcounts are actually handled. It would seem to
make more sense to hold the reference based on the exports using that auth
scheme, and to purge the caches on module unload.
Not a huge deal, but probably something we should consider.
--
Jeff Layton <jlayton@redhat.com>
next prev parent reply other threads:[~2008-12-10 16:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-08 15:28 possible module refcount leak with auth_gss Jeff Layton
[not found] ` <20081208102855.30081708-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-12-08 17:37 ` J. Bruce Fields
2008-12-09 20:38 ` Jeff Layton
[not found] ` <20081209153849.6605559a-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-12-09 23:21 ` Kevin Coffman
[not found] ` <4d569c330812091521s6b9405faq910cb94f067f3b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-12-10 16:25 ` Jeff Layton [this message]
2008-12-10 16:31 ` J. Bruce Fields
2008-12-16 21:45 ` Jeff Layton
[not found] ` <20081216164532.22cab9d6-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-12-17 2:40 ` Jeff Layton
2008-12-17 19:20 ` J. Bruce Fields
2008-12-17 19:34 ` Jeff Layton
[not found] ` <20081217143458.080aa9be-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-12-17 19:41 ` J. Bruce Fields
2008-12-17 19:54 ` Trond Myklebust
2008-12-17 20:07 ` J. Bruce Fields
2008-12-17 20:09 ` J. Bruce Fields
2008-12-17 20:10 ` Trond Myklebust
2008-12-17 19:38 ` Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081210112506.2b2d2c3a@tleilax.poochiereds.net \
--to=jlayton@redhat.com \
--cc=bfields@fieldses.org \
--cc=kwc@umich.edu \
--cc=linux-nfs@vger.kernel.org \
--cc=nfsv4@linux-nfs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox