The patch titled Subject: mm-shrinker-make-shrinker-not-depend-on-memcg-kmem-fix-2 has been added to the -mm tree. Its filename is mm-shrinker-make-shrinker-not-depend-on-memcg-kmem-fix-2.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-shrinker-make-shrinker-not-depend-on-memcg-kmem-fix-2.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-shrinker-make-shrinker-not-depend-on-memcg-kmem-fix-2.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Yang Shi <shy828301@xxxxxxxxx> Subject: mm-shrinker-make-shrinker-not-depend-on-memcg-kmem-fix-2 The below patch should fix the issue, which is for linux-next 2019-07-08 on top of Andrew's fix. And, this patch fixed the redundant #ifdef CONFIG_MEMCG problem pointed out by Randy. Copied Randy too. Link: http://lkml.kernel.org/r/CAHbLzkr8h0t+2xs6f7htKZFdKDbsD5F4z-AAt+CDa-uVwSkQ1Q@xxxxxxxxxxxxxx Cc: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: "Kirill A . Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Shakeel Butt <shakeelb@xxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> Cc: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/memcontrol.h | 10 +++------- mm/memcontrol.c | 9 +-------- 2 files changed, 4 insertions(+), 15 deletions(-) --- a/include/linux/memcontrol.h~mm-shrinker-make-shrinker-not-depend-on-memcg-kmem-fix-2 +++ a/include/linux/memcontrol.h @@ -128,9 +128,8 @@ struct mem_cgroup_per_node { struct mem_cgroup_reclaim_iter iter[DEF_PRIORITY + 1]; -#ifdef CONFIG_MEMCG struct memcg_shrinker_map __rcu *shrinker_map; -#endif + struct rb_node tree_node; /* RB tree node */ unsigned long usage_in_excess;/* Set to the value by which */ /* the soft limit is exceeded*/ @@ -1273,6 +1272,8 @@ static inline bool mem_cgroup_under_sock struct kmem_cache *memcg_kmem_get_cache(struct kmem_cache *cachep); void memcg_kmem_put_cache(struct kmem_cache *cachep); extern int memcg_expand_shrinker_maps(int new_id); +extern void memcg_set_shrinker_bit(struct mem_cgroup *memcg, + int nid, int shrinker_id); #ifdef CONFIG_MEMCG_KMEM int __memcg_kmem_charge(struct page *page, gfp_t gfp, int order); @@ -1340,8 +1341,6 @@ static inline int memcg_cache_id(struct return memcg ? memcg->kmemcg_id : -1; } -extern void memcg_set_shrinker_bit(struct mem_cgroup *memcg, - int nid, int shrinker_id); #else static inline int memcg_kmem_charge(struct page *page, gfp_t gfp, int order) @@ -1382,9 +1381,6 @@ static inline void memcg_get_cache_ids(v static inline void memcg_put_cache_ids(void) { } - -static inline void memcg_set_shrinker_bit(struct mem_cgroup *memcg, - int nid, int shrinker_id) { } #endif /* CONFIG_MEMCG_KMEM */ #endif /* _LINUX_MEMCONTROL_H */ --- a/mm/memcontrol.c~mm-shrinker-make-shrinker-not-depend-on-memcg-kmem-fix-2 +++ a/mm/memcontrol.c @@ -313,6 +313,7 @@ DEFINE_STATIC_KEY_FALSE(memcg_kmem_enabl EXPORT_SYMBOL(memcg_kmem_enabled_key); struct workqueue_struct *memcg_kmem_cache_wq; +#endif static int memcg_shrinker_map_size; static DEFINE_MUTEX(memcg_shrinker_map_mutex); @@ -436,14 +437,6 @@ void memcg_set_shrinker_bit(struct mem_c } } -#else /* CONFIG_MEMCG_KMEM */ -static int memcg_alloc_shrinker_maps(struct mem_cgroup *memcg) -{ - return 0; -} -static void memcg_free_shrinker_maps(struct mem_cgroup *memcg) { } -#endif /* CONFIG_MEMCG_KMEM */ - /** * mem_cgroup_css_from_page - css of the memcg associated with a page * @page: page of interest _ Patches currently in -mm which might be from shy828301@xxxxxxxxx are mm-shrinker-make-shrinker-not-depend-on-memcg-kmem-fix-2.patch