set_comm_cgroup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… set_comm_cgroup(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so this is set_comm_cgroup, a little function living in the Kernel API Manual (section 9, kernel-dev vibes only ✨). It's the one that grabs threads by their name prefix and yeets them into a cgroup. Let's get into it πŸ¦‹


🌸 NAME 🌸

set_comm_cgroup β€” set the cgroup for all the threads whose names start with char *comm_prefix πŸ’–

Literally what it says on the tin: you give it a prefix, it goes and finds the matching threads, and moves them into a cgroup. iconic behaviour tbh πŸ‘‘


✨ SYNOPSIS ✨

int set_comm_cgroup (const char *comm_prefix , const char *cgroup );

that's the whole signature, no cap β€” two const char * args and it hands you back an int 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • comm_prefix β€” ngl the man page itself just says -- undescribed -- 😭 so like, the prefix that thread names get matched against, per the NAME section. That's all we've got, bestie, don't come for me πŸ™ˆ
  • cgroup β€” also literally -- undescribed -- πŸ’€ see DESCRIPTION for what it actually does with it, that's where the lore is ✨
fr fr these two are marked undescribed in the source page, so I'm not out here inventing details. staying in my lane πŸ’…

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea β˜•

If the cgroup argument is not NULL, the threads will move to the given cgroup. slay, that's the main character behaviour right there πŸ‘‘

Otherwise β€” like, when cgroup is NULL β€” the cgroup of the calling thread will be used. and by "the calling thread" we specifically mean rtla, iykyk 🧚

It supports cgroup v2. only v2, so don't come at it with your legacy cgroup v1 energy, it's not the vibe 🌈

Returns 1 on success, 0 otherwise. that's it. one for yes, zero for nope πŸ“


πŸ¦‹ SEE ALSO πŸ¦‹

go read those if you want the full picture, bestie πŸ“šβœ¨


and that's the whole page!! mwah πŸ’‹ this lil gem comes from ./tools/tracing/rtla/src, dated October 2026 β€” so like, future vibes πŸ‘‘πŸ«Ά periodt πŸ’œ

πŸ“¦ where this page comes from