android_kernel_xiaomi_sm8350/mm
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
..
allocpercpu.c Slab allocators: Replace explicit zeroing with __GFP_ZERO 2007-07-17 10:23:02 -07:00
backing-dev.c remove mm/backing-dev.c:congestion_wait_interruptible() 2007-07-16 09:05:52 -07:00
bootmem.c
bounce.c
fadvise.c
filemap_xip.c xip sendfile removal 2007-07-10 08:04:15 +02:00
filemap.c Fix read/truncate race 2007-07-17 10:22:59 -07:00
filemap.h
fremap.c
highmem.c Create the ZONE_MOVABLE zone 2007-07-17 10:22:59 -07:00
hugetlb.c MM: Make needlessly global hugetlb_no_page() static. 2007-07-17 10:23:02 -07:00
internal.h
Kconfig CONFIG_BOUNCE to avoid useless inclusion of bounce buffer logic 2007-07-17 10:23:02 -07:00
madvise.c speed up madvise_need_mmap_write() usage 2007-07-16 09:05:36 -07:00
Makefile CONFIG_BOUNCE to avoid useless inclusion of bounce buffer logic 2007-07-17 10:23:02 -07:00
memory_hotplug.c memory hotplug: fix unnecessary calling of init_currenty_empty_zone() 2007-06-01 08:18:29 -07:00
memory.c Add __GFP_MOVABLE for callers to flag allocations from high memory that may be migrated 2007-07-17 10:22:59 -07:00
mempolicy.c Allow huge page allocations to use GFP_HIGH_MOVABLE 2007-07-17 10:22:59 -07:00
mempool.c Slab allocators: Replace explicit zeroing with __GFP_ZERO 2007-07-17 10:23:02 -07:00
migrate.c Add __GFP_MOVABLE for callers to flag allocations from high memory that may be migrated 2007-07-17 10:22:59 -07:00
mincore.c
mlock.c do not limit locked memory when RLIMIT_MEMLOCK is RLIM_INFINITY 2007-07-16 09:05:37 -07:00
mmap.c split mmap 2007-07-16 09:05:37 -07:00
mmzone.c
mprotect.c
mremap.c security: Protection for exploiting null dereference using mmap 2007-07-11 22:52:29 -04:00
msync.c
nommu.c nommu: stub expand_stack() for nommu case 2007-07-16 09:05:37 -07:00
oom_kill.c
page_alloc.c knfsd: nfsd4: vary maximum delegation limit based on RAM size 2007-07-17 10:23:07 -07:00
page_io.c
page-writeback.c fs: introduce some page/buffer invariants 2007-07-17 10:23:02 -07:00
pdflush.c Freezer: make kernel threads nonfreezable by default 2007-07-17 10:23:02 -07:00
prio_tree.c
quicklist.c
readahead.c
rmap.c mm: kill validate_anon_vma to avoid mapcount BUG 2007-06-28 11:34:53 -07:00
shmem_acl.c
shmem.c knfsd: exportfs: add exportfs.h header 2007-07-17 10:23:06 -07:00
slab.c kallsyms: make KSYM_NAME_LEN include space for trailing '\0' 2007-07-17 10:23:03 -07:00
slob.c Slab allocators: Cleanup zeroing allocations 2007-07-17 10:23:01 -07:00
slub.c SLUB: Fix CONFIG_SLUB_DEBUG use for CONFIG_NUMA 2007-07-17 10:23:02 -07:00
sparse.c Move three functions that are only needed for CONFIG_MEMORY_HOTPLUG 2007-06-08 17:23:33 -07:00
swap_state.c Add __GFP_MOVABLE for callers to flag allocations from high memory that may be migrated 2007-07-17 10:22:59 -07:00
swap.c
swapfile.c vmscan: fix comments related to shrink_list() 2007-07-16 09:05:35 -07:00
thrash.c
tiny-shmem.c
truncate.c fs: introduce some page/buffer invariants 2007-07-17 10:23:02 -07:00
util.c Slab allocators: Cleanup zeroing allocations 2007-07-17 10:23:01 -07:00
vmalloc.c Slab allocators: Replace explicit zeroing with __GFP_ZERO 2007-07-17 10:23:02 -07:00
vmscan.c Freezer: make kernel threads nonfreezable by default 2007-07-17 10:23:02 -07:00
vmstat.c Create the ZONE_MOVABLE zone 2007-07-17 10:22:59 -07:00