Meelap Shah c2f1a551de knfsd: nfsd4: vary maximum delegation limit based on RAM size
Our original NFSv4 delegation policy was to give out a read delegation on any
open when it was possible to.

Since the lifetime of a delegation isn't limited to that of an open, a client
may quite reasonably hang on to a delegation as long as it has the inode
cached.  This becomes an obvious problem the first time a client's inode cache
approaches the size of the server's total memory.

Our first quick solution was to add a hard-coded limit.  This patch makes a
mild incremental improvement by varying that limit according to the server's
total memory size, allowing at most 4 delegations per megabyte of RAM.

My quick back-of-the-envelope calculation finds that in the worst case (where
every delegation is for a different inode), a delegation could take about
1.5K, which would make the worst case usage about 6% of memory.  The new limit
works out to be about the same as the old on a 1-gig server.

[akpm@linux-foundation.org: Don't needlessly bloat vmlinux]
[akpm@linux-foundation.org: Make it right for highmem machines]
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17 10:23:07 -07:00
..
2007-03-27 08:52:47 +02:00
2007-07-10 08:04:15 +02:00
2007-07-17 10:22:59 -07:00
2006-12-22 08:55:49 -08:00
2007-07-17 10:22:59 -07:00
2007-02-15 09:57:03 -08:00
2007-07-16 09:05:37 -07:00
2007-05-21 09:18:19 -07:00
2007-05-07 12:12:55 -07:00
2005-04-16 15:20:36 -07:00
2007-05-07 12:12:54 -07:00
2007-05-07 12:12:52 -07:00
2007-07-17 10:23:06 -07:00
2007-07-17 10:22:59 -07:00