[kernel] r13531 - in dists/lenny/linux-2.6/debian: . patches/bugfix/all patches/series

Dann Frazier dannf at alioth.debian.org
Sat May 2 16:28:15 UTC 2009


Author: dannf
Date: Sat May  2 16:28:13 2009
New Revision: 13531

Log:
SUNRPC: Fix a performance regression in the RPC authentication code
(Closes: #524199)

Added:
   dists/lenny/linux-2.6/debian/patches/bugfix/all/sunrpc-fix-performance-regression-in-rpc-auth-code.patch
Modified:
   dists/lenny/linux-2.6/debian/changelog
   dists/lenny/linux-2.6/debian/patches/series/16

Modified: dists/lenny/linux-2.6/debian/changelog
==============================================================================
--- dists/lenny/linux-2.6/debian/changelog	Sat May  2 01:27:57 2009	(r13530)
+++ dists/lenny/linux-2.6/debian/changelog	Sat May  2 16:28:13 2009	(r13531)
@@ -16,6 +16,8 @@
 
   [ dann frazier ]
   * [s390] Fix __div64_31 for CONFIG_MARCH_G5 (Closes: #511334)
+  * SUNRPC: Fix a performance regression in the RPC authentication code
+    (Closes: #524199)
 
   [ Martin Michlmayr ]
   * cdc-acm: Add quirk for MTK II GPS, such as Qstarz BT-Q1000X (closes:

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/sunrpc-fix-performance-regression-in-rpc-auth-code.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/sunrpc-fix-performance-regression-in-rpc-auth-code.patch	Sat May  2 16:28:13 2009	(r13531)
@@ -0,0 +1,57 @@
+commit 23918b03060f6e572168fdde1798a905679d2e06
+Author: Trond Myklebust <Trond.Myklebust at netapp.com>
+Date:   Thu Nov 20 16:06:21 2008 -0500
+
+    SUNRPC: Fix a performance regression in the RPC authentication code
+    
+    Fix a regression reported by Max Kellermann whereby kernel profiling
+    showed that his clients were spending 45% of their time in
+    rpcauth_lookup_credcache.
+    
+    It turns out that although his processes had identical uid/gid/groups,
+    generic_match() was failing to detect this, because the task->group_info
+    pointers were not shared. This again lead to the creation of a huge number
+    of identical credentials at the RPC layer.
+    
+    The regression is fixed by comparing the contents of task->group_info
+    if the actual pointers are not identical.
+    
+    Signed-off-by: Trond Myklebust <Trond.Myklebust at netapp.com>
+    Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
+
+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)

Modified: dists/lenny/linux-2.6/debian/patches/series/16
==============================================================================
--- dists/lenny/linux-2.6/debian/patches/series/16	Sat May  2 01:27:57 2009	(r13530)
+++ dists/lenny/linux-2.6/debian/patches/series/16	Sat May  2 16:28:13 2009	(r13531)
@@ -2,3 +2,4 @@
 + bugfix/s390/fix__div64_31_for_G5.patch
 + bugfix/all/cdc-acm-mtk-gps-quirk.patch
 + bugfix/x86/gettimeofday-vDSO-NULL-tv-segv.patch
++ bugfix/all/sunrpc-fix-performance-regression-in-rpc-auth-code.patch



More information about the Kernel-svn-changes mailing list