linux-kernel-test/net/sunrpc
NeilBrown f16b6e8d83 sunrpc/cache: allow threads to block while waiting for cache update.
The current practice of waiting for cache updates by queueing the
whole request to be retried has (at least) two problems.

1/ With NFSv4, requests can be quite complex and re-trying a whole
  request when a later part fails should only be a last-resort, not a
  normal practice.

2/ Large requests, and in particular any 'write' request, will not be
  queued by the current code and doing so would be undesirable.

In many cases only a very sort wait is needed before the cache gets
valid data.

So, providing the underlying transport permits it by setting
 ->thread_wait,
arrange to wait briefly for an upcall to be completed (as reflected in
the clearing of CACHE_PENDING).
If the short wait was not long enough and CACHE_PENDING is still set,
fall back on the old approach.

The 'thread_wait' value is set to 5 seconds when there are spare
threads, and 1 second when there are no spare threads.

These values are probably much higher than needed, but will ensure
some forward progress.

Note that as we only request an update for a non-valid item, and as
non-valid items are updated in place it is extremely unlikely that
cache_check will return -ETIMEDOUT.  Normally cache_defer_req will
sleep for a short while and then find that the item is_valid.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2010-09-07 19:22:07 -04:00
..
auth_gss SUNRPC: Defer deleting the security context until gss_do_free_ctx() 2010-08-04 08:55:14 -04:00
xprtrdma rpcrdma: Fix SQ size calculation when memreg is FRMR 2010-08-11 12:47:24 -04:00
addr.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
auth_generic.c SUNRPC: Clean up of rpc_bindcred() 2010-08-04 08:54:08 -04:00
auth_null.c SUNRPC: Move the bound cred to struct rpc_rqst 2010-08-04 08:54:09 -04:00
auth_unix.c SUNRPC: Move the bound cred to struct rpc_rqst 2010-08-04 08:54:09 -04:00
auth.c nfs: update for module_param_named API change 2010-08-11 23:04:15 +09:30
backchannel_rqst.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
bc_svc.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-04-11 14:53:53 -07:00
cache.c sunrpc/cache: allow threads to block while waiting for cache update. 2010-09-07 19:22:07 -04:00
clnt.c SUNRPC: Move the bound cred to struct rpc_rqst 2010-08-04 08:54:09 -04:00
Kconfig NFS: Fix the selection of security flavours in Kconfig 2010-08-17 17:42:45 -04:00
Makefile SUNRPC: Provide functions for managing universal addresses 2009-08-09 15:09:34 -04:00
rpc_pipe.c sunrpc: Pushdown the bkl from ioctl 2010-05-22 17:44:19 +02:00
rpcb_clnt.c kernel-wide: replace USHORT_MAX, SHORT_MAX and SHORT_MIN with USHRT_MAX, SHRT_MAX and SHRT_MIN 2010-05-25 08:07:02 -07:00
sched.c SUNRPC: Reduce asynchronous RPC task stack usage 2010-08-04 08:54:09 -04:00
socklib.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
stats.c SUNRPC: Move the task->tk_bytes_sent and tk_rtt to struct rpc_rqst 2010-05-14 15:09:36 -04:00
sunrpc_syms.c Merge branch 'for-2.6.36' of git://linux-nfs.org/~bfields/linux 2010-08-07 14:24:41 -07:00
sunrpc.h nfsd41: sunrpc: Added rpc server-side backchannel handling 2009-09-11 15:04:16 -04:00
svc_xprt.c sunrpc/cache: allow threads to block while waiting for cache update. 2010-09-07 19:22:07 -04:00
svc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
svcauth_unix.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
svcauth.c net: Move && and || to end of previous line 2009-11-29 16:55:45 -08:00
svcsock.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2010-05-20 21:04:44 -07:00
sysctl.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
timer.c SUNRPC: Add documenting comments in net/sunrpc/timer.c 2009-08-09 15:09:47 -04:00
xdr.c xdr: Add an export for the helper function write_bytes_to_xdr_buf() 2010-05-14 15:09:18 -04:00
xprt.c SUNRPC: prevent task_cleanup running on freed xprt 2010-08-04 08:54:10 -04:00
xprtsock.c Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6 2010-08-18 15:45:23 -07:00