dmem_cgroup_...ict_valuable(9)
π dmem_cgroup_state_evict_valuable β Kernel API Manual, bestie edition π
okay so this is a page from the Kernel API Manual (yes, the actual kernel, we're literally in ./kernel/cgroup/dmem.c territory, main character energy) and it's about the very serious business of deciding whether to evict stuff from a pool. grab a strawberry drink π and let's go.
β¨ NAME β¨
dmem_cgroup_state_evict_valuable β the vibes check that tells you whether we should evict from test_pool. fr fr that's the whole job.
πΈ SYNOPSIS πΈ
bool dmem_cgroup_state_evict_valuable (struct dmem_cgroup_pool_state
*limit_pool , struct dmem_cgroup_pool_state *test_pool , bool ignore_low
, bool *ret_hit_low );
like, it takes four things and gives you back a bool. no cap.
π¦ ARGUMENTS π¦
limit_poolβ the pool where we actually hit the limits π this is the one that's causing the whole situation.test_poolβ the pool we're testing, i.e. the candidate we're lowkey side-eyeing to see if it's evictable.ignore_lowβ whether we have to respect low watermarks. yes, this is a real thing we care about πret_hit_lowβ a pointer to aboolthat says whether it even makes sense to consider the low watermark. it's giving "output parameter, but make it cute."
π DESCRIPTION π
So here's the tea β β this function returns true if we can evict from test_pool, and false if we can't. simple as that, periodt.
But wait, there's a plot twist π β when it returns false and ignore_low is false, ret_hit_low may be set to true. and what does that mean? it means you can literally retry this function with ignore_low set to true. it's giving "second chance, bestie" β¨. note the "may" β that's the function being coy, not me making stuff up.
β RETURN β
bool
that's it. that's the return. iconic. π
π SEE ALSO π
the source of truth lives in the kernel file ./kernel/cgroup/dmem.c β go read it, it's right there, iykyk π
dmem_cgroup_unregister_region(9)dmem_cgroup_register_region(9)dmem_cgroup_pool_state_put(9)dmem_cgroup_uncharge(9)dmem_cgroup_try_charge(9)dmem_cgroup_below_min(9)dmem_cgroup_below_low(9)dmem_cgroup_get_common_ancestor(9)
like a whole friend group of functions, honestly π«Ά
π«Ά cute little sign-off: this page lives under./kernel/cgroup, dated October 2026, and its manual name isdmem_cgroup_...ict_valuable(9). mwah π go evict responsibly, bestie π β¨
π¦ 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