blkcg_activate_policy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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