linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] record non-slab shrinkers for non-root memcgs when kmem is disabled
@ 2026-03-06  7:57 Haifeng Xu
  2026-03-06  7:57 ` [PATCH 1/3] mm: shrinker: introduce new function get_shrinker_id() Haifeng Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Haifeng Xu @ 2026-03-06  7:57 UTC (permalink / raw)
  To: akpm, david, roman.gushchin
  Cc: zhengqi.arch, muchun.song, linux-mm, linux-kernel, Haifeng Xu

When registering new shrinkers, all memcgs need to expand shrinker info
if new allocated id exceeds shrinker_nr_max. But if kmem is disabled,
only non-slab shrinkers is useful in memcg slab shrink. So in this case,
it is enough to allocate non-slab shrinker info for non-root memcg. This
can save a bit of memory and reduce the holding time of shrinker lock.

With this optimization, the finish time of pod creation in our internal
test is reduced from 150 senconds to 69 senconds. We test it based on
stable kernel 6.6.102.

Haifeng Xu (3):
  mm: shrinker: introduce new function get_shrinker_id()
  mm: shrinker: optimize the allocation of shrinker_info when setting
    cgroup_memory_nokmem
  mm: shrinker: remove unnecessary check in shrink_slab_memcg()

 include/linux/shrinker.h |   3 +
 mm/huge_memory.c         |  21 ++++--
 mm/shrinker.c            | 155 +++++++++++++++++++++++++++++++++------
 3 files changed, 150 insertions(+), 29 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-06 11:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-06  7:57 [PATCH 0/3] record non-slab shrinkers for non-root memcgs when kmem is disabled Haifeng Xu
2026-03-06  7:57 ` [PATCH 1/3] mm: shrinker: introduce new function get_shrinker_id() Haifeng Xu
2026-03-06  8:24   ` Qi Zheng
2026-03-06 11:21     ` Haifeng Xu
2026-03-06  7:57 ` [PATCH 2/3] mm: shrinker: optimize the allocation of shrinker_info when setting cgroup_memory_nokmem Haifeng Xu
2026-03-06  7:57 ` [PATCH 3/3] mm: shrinker: remove unnecessary check in shrink_slab_memcg() Haifeng Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox