Skip to contentSkip to conversation

xprt sharing (2nd try)

PATCH New Mike Waychison 1 participant 1 message Dec 9, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xprt sharing (2nd try)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

So, I managed to figure out why the patch I posted yesterday wasn't working for me. It would appear that in comparing transport timeouts, to_increment is only used when to_exponential is false. nfs uses to_exponential = 1, and doens't set to_increment at all. I didn't catch this earlier because I likely had slab debugging on and instead of to_increment being garbage values, it was the test pattern (a5a5a5a5).

Anyhow, here is an updated version of the patch which does the timeout
comparison the right way. Works for me in a not-so-tested environment.

- --
Mike Waychison
Sun Microsystems, Inc.
1 (650) 352-5299 voice
1 (416) 202-8336 voice

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE: The opinions expressed in this email are held by me, and may not represent the views of Sun Microsystems, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBuJgOdQs4kOxk3/MRAr/jAJ9ogzmFQ2iCZGbvvdc/EYewbWjmdACdHI7A 5Uay1xrNaYhGzDY1rft2EVY=
=ndVJ
-----END PGP SIGNATURE-----

This patch allows for sharing of xprts. This is done by keeping a list of current xprts and passing them back to the caller of xprt_create_proto if they match the specifications required (IP X port X protocol X timeout).

We do this multiplexing at the xprt layer as it handles transport creation and destruction.

This patch has been tested in a test-only environment but has been able to handle a couple hundreds distinct nfs mounts from the same server over a single tcp stream.

This effectively gets rid of the 800 nfs mounts max problem, as long as you aren't mounting from many (800) nfs servers.

include/linux/sunrpc/xprt.h +5 -0
Index: linux-2.6.9-quilt/include/linux/sunrpc/xprt.h
===================================================================
@@ -15,6 +15,8 @@
 #include <linux/sunrpc/sched.h>
 #include <linux/sunrpc/xdr.h>
 
+#include <asm/atomic.h>
+
 /*
  * The transport code maintains an estimate on the maximum number of out-
  * standing RPC requests, using a smoothed version of the congestion
@@ -194,6 +196,9 @@ struct rpc_xprt {
 	void			(*old_write_space)(struct sock *);
 
 	wait_queue_head_t	cong_wait;
+
+	atomic_t		count;		/* shared xprt refcount */
+	struct list_head	shared;		/* link to shared list */
 };
 
 #ifdef __KERNEL__
net/sunrpc/xprt.c +93 -4

136 lines not on this page · raw message