blkcg_activate_policy(9)
β¨ blkcg_activate_policy(9) β¨
okay so bestie, welcome to the kernel API manual page for blkcg_activate_policy π
you're gonna do great, i promise.
π¦ NAME π¦
blkcg_activate_policy β activate a blkcg policy on a gendisk
πΈ SYNOPSIS πΈ
int blkcg_activate_policy (struct gendisk *disk , const struct
blkcg_policy *pol );
π ARGUMENTS π
diskβ the gendisk you care about, your main character π«Άpolβ the blkcg policy you wanna activate, slay
π DESCRIPTION π
So the whole vibe here: you're activating pol on disk. That's it, that's the function. β¨
It requires GFP_KERNEL context, no cap. And disk goes through bypass mode to populate its blkgs with policy_data for pol. lowkey iconic behavior.
Activation happens with disk bypassed, so nobody would be accessing blkgs from the IO path β vibe check passed π no one's touching them mid-update. Every blkg update is protected by both queue and blkcg locks, so that holding either lock and testing blkcg_policy_enabled is always enough for dereferencing policy data. That's the guarantee, periodt. π₯
Also, heads up bestie: the caller is responsible for synchronizing [de]activations and policy [un]registerations. Not us. You. π
Returns 0 on success, -errno on failure. Easy. π
π SEE ALSO π
Kernel file ./block/blk-cgroup.c π and honestly the whole friend group:
blkcg_css(9), blkg_free(9), bio_blkcg_css(9), blkcg_parent(9), blkg_alloc(9), blkg_lookup_create(9), blkcg_print_blkgs(9), __blkg_prfill_u64(9), blkg_conf_init(9), blkg_conf_open_bdev(9), blkg_conf_prep(9), blkg_conf_unprep(9), blkg_conf_close_bdev(9), blkcg_destroy_blkgs(9), blkcg_pin_online(9), blkcg_unpin_online(9), blkcg_css_offline(9), blkcg_deactivate_policy(9), blkcg_policy_register(9), blkcg_policy_unregister(9), blkcg_maybe_throttle_current(9), blkcg_schedule_throttle(9), blkcg_add_delay(9), blkg_tryget_closest(9), bio_associate_blkg_from_css(9), bio_associate_blkg(9), bio_clone_blkg_association(9)
that's the whole page, bestie, you ate it up π
β¨ this one lives in ./block and the version/date on the tin is October 2026 β so like, future vibes fr fr π¦ go forth and activate those policies, iykyk ππ
π¦ 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