idle_cull_fn(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… idle_cull_fn โ€” a whole mood (NAME)

okay so bestie, welcome to idle_cull_fn(9) from the Kernel API Manual, and honestly? this one's short but it eats. it's the function that culls workers that have been idle for too long โ€” literally the "girl, you've been sitting here doing nothing, time to go" of the workqueue world. โœจ


๐Ÿ“œ SYNOPSIS (the vibe check)

void idle_cull_fn (struct work_struct *work );

that's it. that's the whole signature. no return value, no drama, she just does the thing. ๐ŸŽ€


๐Ÿงš ARGUMENTS (who's who)

  • work โ€” the pool's work for handling these idle workers. like, this is the work item that shows up and goes "hi, I'm here to handle the idle workers," and then it does exactly that. no cap, that's the whole job description. ๐Ÿซถ

๐ŸŒธ DESCRIPTION (the main character energy)

okay so here's what she does: this goes through a pool's idle workers and gets rid of those that have been idle for at least IDLE_WORKER_TIMEOUT seconds. bye bestie, you've been napping long enough. ๐Ÿ’€

and here's the part where it gets thoughtful: we don't want to disturb isolated CPUs because of a pcpu kworker being culled, so this also resets worker affinity. iconic, considerate, we love to see it. ๐Ÿ’œ

but โ€” and this is the important bit โ€” that affinity reset requires a sleepable context. hence the split between the timer callback and the work item. that's the whole reason this thing is a work item and not just doin' it inline in the timer. iykyk. ๐Ÿ”ฅ


๐Ÿ”ฎ SEE ALSO (the group chat, and it's a big group chat)

first up, the room where it all happens: Kernel file ./kernel/workqueue.c ๐Ÿ’–

then the extended fam โ€” every single one of them:

like, that's the whole friend group. say hi to all of them, it's only polite. ๐ŸŒˆ


quick reminder bestie: the IDLE_WORKER_TIMEOUT threshold and the affinity reset are the whole point of this function, and the affinity reset is why this lives in a work item instead of the timer callback โ€” it needs that sleepable context. don't skip the split, fr fr. ๐Ÿ™ˆ

and that's the page! ๐ŸŒŸ brought to you by the homies over at ./kernel, dated October 2026, filed under idle_cull_fn(9) โ€” go off, kernel workqueue, you absolute icon ๐Ÿ‘‘๐Ÿ’…๐Ÿ“

๐Ÿ“ฆ where this page comes from