diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-03-21 20:20:09 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-03-21 20:20:09 -0400 |
commit | 1a9d73b5c0b949fd4b53935a43e7dc1e0d9d1127 (patch) | |
tree | cbe5bbae21ca9f9a4cf2f206d6bd665903ae0084 /include/linux/slab.h | |
parent | 205d75307a7c71f3807c8aa74405cd7267a40e4b (diff) |
Shrinker improvements
After memory allocation failure, don't rely on /proc/meminfo to figure
out how much memory we should free - instead unconditionally free 1/8th
of each cache.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r-- | include/linux/slab.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h index bc99973f..557c0411 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -20,7 +20,7 @@ static inline void *kmalloc(size_t size, gfp_t flags) void *p; do { - run_shrinkers(); + run_shrinkers(flags, i != 0); if (size) { size_t alignment = min(rounddown_pow_of_two(size), (size_t)PAGE_SIZE); @@ -83,7 +83,7 @@ static inline struct page *alloc_pages(gfp_t flags, unsigned int order) void *p; do { - run_shrinkers(); + run_shrinkers(flags, i != 0); p = aligned_alloc(PAGE_SIZE, size); if (p && (flags & __GFP_ZERO)) |