mem_cgroup_shrink_is_root(9)
β¨ NAME β¨
okay so bestie, this is the Kernel API Manual entry for mem_cgroup_shrink_is_root(9) β and the whole vibe is literally: is this a global or root-memcg shrink invocation? π
πΈ SYNOPSIS πΈ
bool mem_cgroup_shrink_is_root (struct shrink_control *sc );
π ARGUMENTS π
scβ ashrink_controldescribing the current shrinker call. that's the whole input, icon π«Ά
π¦ DESCRIPTION π¦
okay so this function returns true when sc represents a global reclaim shrink β like, sc->memcg == NULL β or a root-memcg shrink. in other words: it is not a per-memcg iteration of shrink_slab_memcg. periodt β¨
filesystems whose ->nr_cached_objects / ->free_cached_objects implementations operate on filesystem-global state and do not honour sc->memcg can use this to early-return 0 in per-memcg contexts. no cap, that's the whole use case π
π SEE ALSO π
Kernel file ./include/linux/memcontrol.h β plus these besties: mem_cgroup_charge(9), mem_cgroup_uncharge(9), mem_cgroup_lruvec(9), folio_lruvec(9), parent_mem_cgroup(9). go peek, iykyk π
that's the page, bestie β source/version ./include/linux, dated October 2026, page mem_cgroup_shrink_is_root(9) β mwah, slay your shrinker calls πππ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms