sunrpc/cache: centralise handling of size limit on deferred list.
authorNeilBrown <neilb@suse.de>
Thu, 7 Oct 2010 04:29:46 +0000 (15:29 +1100)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 11 Oct 2010 23:30:28 +0000 (19:30 -0400)
commite33534d54f1fde3e541f64fa5ad0dd379fc45fa7
treed7136fd857a84576a984f2441b7ee03fc9afd24e
parentd29068c431599fa96729556846562eb18429092d
sunrpc/cache: centralise handling of size limit on deferred list.

We limit the number of 'defer' requests to DFR_MAX.

The imposition of this limit is spread about a bit - sometime we don't
add new things to the list, sometimes we remove old things.

Also it is currently applied to requests which we are 'waiting' for
rather than 'deferring'.  This doesn't seem ideal as 'waiting'
requests are naturally limited by the number of threads.

So gather the DFR_MAX handling code to one place and only apply it to
requests that are actually being deferred.

This means that not all 'cache_deferred_req' structures go on the
'cache_defer_list, so we need to be careful when adding and removing
things.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
net/sunrpc/cache.c