STRUCT DMEM_CGROUP_OPS(9)
π struct dmem_cgroup_ops(9) π
okay so this is a page from the Kernel API Manual, and it's all about one little struct: struct dmem_cgroup_ops β literally the operations table for a dmem cgroup region. bestie, it's giving "small but mighty." π
β¨ NAME β¨
struct dmem_cgroup_ops β the operations for a dmem cgroup region. that's it, that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
struct dmem_cgroup_ops {
int (*reclaim)(struct dmem_cgroup_pool_state *pool, u64
target_bytes, void *priv);
};
look at her. one function pointer. main character energy honestly. π
π Members π
reclaimβ this one's optional (so no pressure, but alsoβ¦ slay if you implement it π ). it's the callback that gets invoked whendmem.maxis set below the current usage of a pool. when that happens, the driver should attempt to free at leasttarget_bytesfrompool. and heads up β it may get called multiple times if usage is still above the limit after it returns. so like, don't assume it's a one-and-done situation, okay? π₯
π Return π
the return value of reclaim is doing a whole lot of storytelling, so let's break it down:
0β some progress was made. yes, even if you freed less thantarget_bytes. progress is progress, we celebrate it π«Ά-ENOSPCβ no progress could be made at all. the caller will retry, but only up to a bounded number of times, so don't get too comfy π- another negative error code β a fatal error happened. this stops further reclaim attempts immediately. like, hard stop. no more retries. π
fr fr, that last one is the dramatic exit β once you return a fatal negative error, the reclaim party is over.
π§ SEE ALSO π§
- Kernel file
./include/linux/cgroup_dmem.h struct dmem_cgroup_init(9)
that's the whole page, babes β go forth and reclaim responsibly β¨π
β with love, from ./include/linux, October 2026 edition of the Kernel API Manual ππ¦
π¦ 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