diff options
author | J. Bruce Fields <bfields@redhat.com> | 2017-09-19 20:51:31 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2017-10-04 16:25:01 -0400 |
commit | 44d8660d3bb0a1c8363ebcb906af2343ea8e15f6 (patch) | |
tree | ae880e4bda7d39b6e4162e05db962b59e85bedc3 /fs/nfsd | |
parent | 9542446048e01871fd323cba9a1d468b46cfceea (diff) |
nfsd: increase DRC cache limit
An NFSv4.1+ client negotiates the size of its duplicate reply cache size
in the initial CREATE_SESSION request. The server preallocates the
memory for the duplicate reply cache to ensure that we'll never fail to
record the response to a nonidempotent operation.
To prevent a few CREATE_SESSIONs from consuming all of memory we set an
upper limit based on nr_free_buffer_pages(). 1/2^10 has been too
limiting in practice; 1/2^7 is still less than one percent.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfssvc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 7e3af3ef0917..6bbc717f40f2 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c | |||
@@ -446,7 +446,7 @@ void nfsd_reset_versions(void) | |||
446 | */ | 446 | */ |
447 | static void set_max_drc(void) | 447 | static void set_max_drc(void) |
448 | { | 448 | { |
449 | #define NFSD_DRC_SIZE_SHIFT 10 | 449 | #define NFSD_DRC_SIZE_SHIFT 7 |
450 | nfsd_drc_max_mem = (nr_free_buffer_pages() | 450 | nfsd_drc_max_mem = (nr_free_buffer_pages() |
451 | >> NFSD_DRC_SIZE_SHIFT) * PAGE_SIZE; | 451 | >> NFSD_DRC_SIZE_SHIFT) * PAGE_SIZE; |
452 | nfsd_drc_mem_used = 0; | 452 | nfsd_drc_mem_used = 0; |