kthread_associate_blkcg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kthread_associate_blkcg πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” this is a kthread page and it's genuinely such a serve, let me tell you everything 🫢


✨ NAME ✨

kthread_associate_blkcg β€” associate blkcg to current kthread πŸŽ€

like, it's the little function that lets a kernel thread carry someone else's cgroup info around. iconic behavior, no cap.


🌸 SYNOPSIS 🌸

void kthread_associate_blkcg (struct cgroup_subsys_state *css );

literally one line, one argument, void return β€” she's lowkey minimal and I respect it πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • css β€” the cgroup info πŸ’– like, that's it, that's the whole thing. it's the cgroup info you're handing over.

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's the vibe check: the current thread must be a kthread. periodt. not optional, not a suggestion, it's literally the requirement πŸ™ˆ

The thread is running jobs on behalf of other threads β€” think of it as the friend who does the group project for everyone 😭 and in some cases, we expect the jobs to attach the cgroup info of the original threads instead of that of the current thread.

So what does this function actually do? It stores the original thread's cgroup info in the current kthread context for later retrieval. πŸ“¦βœ¨ That's the whole flex. Stash it now, grab it later. iykyk.

fr fr though β€” current thread must be a kthread, that's the one thing to remember 🌈

⭐ SEE ALSO ⭐

the whole friend group shows up for this one, they all ate πŸ”₯


and that's the whole page bestie πŸ“ slay πŸ’œ

this masterpiece lives under ./kernel in the Kernel API Manual, dated October 2026 β€” go off, and remember: current thread must be a kthread πŸ’€βœ¨

πŸ“¦ where this page comes from