From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Max Kellermann <max@duempel.org>
Cc: linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: Re: High load in 2.6.27, NFS / rpcauth_lookup_credcache()?
Date: Wed, 19 Nov 2008 17:31:01 -0500 [thread overview]
Message-ID: <1227133861.28898.26.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <20081117123536.GA16539@squirrel.roonstrasse.net>
On Mon, 2008-11-17 at 13:35 +0100, Max Kellermann wrote:
> On 2008/10/27 16:48, Trond Myklebust <trond.myklebust@fys.uio.no> wrote:
> > OK. That points a finger at the garbage collector. Does the following
> > patch help at all?
>
> Hi Trond,
>
> the server's load seems to be a little bit lower with 2.6.27.6 plus
> your patch, but OProfile still gives me 45% in
> rpcauth_lookup_credcache(). See:
>
> 1060627 45.1474 (no location information) rpcauth_lookup_credcache
> 289362 12.3172 auth_generic.c:0 generic_match
> 31886 1.3573 page_alloc.c:0 get_page_from_freelist
> 23932 1.0187 (no location information) page_fault
> 22176 0.9440 (no location information) schedule
> 14613 0.6220 (no location information) __d_lookup
> [...]
>
> Max
Looking at the above, it seems that you're spending an inordinate amount
of time in generic_match too.
Could you see if the following patch helps?
Cheers
Trond
-------------------------------------------------------------------------------
From: Trond Myklebust <Trond.Myklebust@netapp.com>
SUNRPC: Fix up generic_match()
Cut down on the number of similar copies of group_info.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
net/sunrpc/auth_generic.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/net/sunrpc/auth_generic.c b/net/sunrpc/auth_generic.c
index 744b79f..4028502 100644
--- a/net/sunrpc/auth_generic.c
+++ b/net/sunrpc/auth_generic.c
@@ -133,13 +133,29 @@ static int
generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags)
{
struct generic_cred *gcred = container_of(cred, struct generic_cred, gc_base);
+ int i;
if (gcred->acred.uid != acred->uid ||
gcred->acred.gid != acred->gid ||
- gcred->acred.group_info != acred->group_info ||
gcred->acred.machine_cred != acred->machine_cred)
- return 0;
+ goto out_nomatch;
+
+ /* Optimisation in the case where pointers are identical... */
+ if (gcred->acred.group_info == acred->group_info)
+ goto out_match;
+
+ /* Slow path... */
+ if (gcred->acred.group_info->ngroups != acred->group_info->ngroups)
+ goto out_nomatch;
+ for (i = 0; i < gcred->acred.group_info->ngroups; i++) {
+ if (GROUP_AT(gcred->acred.group_info, i) !=
+ GROUP_AT(acred->group_info, i))
+ goto out_nomatch;
+ }
+out_match:
return 1;
+out_nomatch:
+ return 0;
}
void __init rpc_init_generic_auth(void)
next prev parent reply other threads:[~2008-11-19 22:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-22 9:12 Max Kellermann
2008-10-22 17:56 ` J. Bruce Fields
2008-10-23 12:36 ` Max Kellermann
2008-10-23 14:55 ` Trond Myklebust
2008-10-24 8:39 ` Max Kellermann
2008-10-24 18:09 ` Trond Myklebust
2008-10-27 9:58 ` Max Kellermann
2008-10-27 15:48 ` Trond Myklebust
2008-11-17 12:35 ` Max Kellermann
2008-11-19 22:31 ` Trond Myklebust [this message]
2008-11-20 14:08 ` Max Kellermann
2008-12-15 23:44 ` Harry Edmon
2008-12-16 13:02 ` Trond Myklebust
2008-12-16 21:21 ` Willy Tarreau
2008-12-16 23:21 ` [stable] " Greg KH
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=1227133861.28898.26.camel@heimdal.trondhjem.org \
--to=trond.myklebust@fys.uio.no \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=max@duempel.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
all inboxes | Powered by JetHome®