wb_get_create(9)
π wb_get_create β the Kernel API Manual tea π
okay so bestie, welcome to the Kernel API Manual entry for wb_get_create(9) β and yes it's giving "small function, big responsibilities" energy and we're gonna get into it πΈ
β¨ NAME β¨
wb_get_create β get wb for a given memcg, create if necessary
literally the whole vibe: you want the wb, you maybe don't have the wb, so we make the wb. iconic π
π¦ SYNOPSIS π¦
struct bdi_writeback * wb_get_create (struct backing_dev_info *bdi ,
struct cgroup_subsys_state *memcg_css , gfp_t gfp );
that's the whole signature, no cap β check the return type: a struct bdi_writeback * π
π ARGUMENTS π
bdiβ the targetbdi, like the destination of this whole little journey π«memcg_cssβ thecgroup_subsys_stateof the target memcg. heads up bestie, it must have positive ref β that's a hard requirement, not a suggestion πgfpβ the allocation mask to use π
π§ DESCRIPTION π§
So here's the plot: try to get the wb for memcg_css on bdi. simple enough right?
but if it doesn't exist? bestie, we try to create one. that's the "create if necessary" part of the name doing its thing β¨
and for the deeper lore, the manpage says see wb_get_lookup for more details β so like, if you want the full story, that's where you go π
π SEE ALSO π
Kernel file ./mm/backing-dev.c β that's where the source lives π«Ά
π friendly reminder from your girl: memcg_css needs a positive ref. don't come crying to me if you skip that. i warned you. periodt.
and that's the page!! π this one comes from the ./mm source, dated October 2026 β so yeah, she's fresh, she's current, she ate and left no crumbs π byeee ππ
π¦ 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