From d8c98bb6aee804c47b6462d3012aae38d0b043e0 Mon Sep 17 00:00:00 2001 From: Vinayak Menon Date: Fri, 14 Apr 2017 12:15:18 +0530 Subject: mm: separate out the invocation of lowmemorykiller shrinker The commit '6b4f77 (mm: vmscan: invoke slab shrinkers from shrink_zone())' fixed the invocation of shrinkers but resulted in lowmemorykiller shrinker being called more. Reduce the number of lowmemorykiller shrinker invocations by separating out the lowmemorykiller shrinker from shrink_slab. This will make lowmemorykiller invoked only once for all zones reclaimed in the direct reclaim path, and once for each zone in the kswap path. As a consequence the eligible pages passed to shrink_slab_lmk is now the reclaimable pages of all zones. Reducing the number of lowmemorykiller invocations reduces the unnecessary time spent in lowmemorykiller and thus contention or failures on lowmemorykiller's scan_mutex. Change-Id: Iaabb9e441711f1dc804980b5853b64b3f214698d Signed-off-by: Vinayak Menon --- include/linux/shrinker.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h index 4fcacd915d45..e77f648f9662 100644 --- a/include/linux/shrinker.h +++ b/include/linux/shrinker.h @@ -66,6 +66,7 @@ struct shrinker { /* Flags */ #define SHRINKER_NUMA_AWARE (1 << 0) #define SHRINKER_MEMCG_AWARE (1 << 1) +#define SHRINKER_LMK (1 << 2) extern int register_shrinker(struct shrinker *); extern void unregister_shrinker(struct shrinker *); -- cgit v1.2.3