wake_up_pollfree(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… wake_up_pollfree β€” a Kernel API Manual moment (section 9, bestie)

okay so this one is from the Kernel API Manual, section 9, and it's genuinely such a niche little icon. like, nobody knows her, but the people who know her know her, iykyk. πŸŽ€


✨ NAME ✨

wake_up_pollfree β€” the function that's literally like "hey bestie, this polled waitqueue is leaving the party, say your goodbyes" πŸ’Œ


πŸ¦‹ SYNOPSIS πŸ¦‹

void wake_up_pollfree (struct wait_queue_head *wq_head );

one function, one pointer, no drama.


🌸 ARGUMENTS 🌸

  • wq_head β€” the wait queue head. that's it. that's the whole personality. the wait queue head in question, the main character of this argument list πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

okay so picture this: in the very rare cases (like, very rare, we're talking "you will probably never touch this in your whole kernel career" rare πŸ™ˆ) where a ->poll implementation uses a waitqueue whose lifetime is tied to a task instead of the struct file being polled β€” you have to call this function before the waitqueue gets freed. why? bc otherwise the non-blocking polls (think epoll, the girlies who poll without blocking ✨) never find out that the queue is going away. and that's rude. and also a bug. 😭

the vibe check: call wake_up_pollfree first, free after. not the other way around, bestie, i'm begging 🫢

and there's a whole second requirement, no cap: the caller must also RCU-delay the freeing of the wait_queue_head. like, how? any of these ways, pick your slay:

  • an explicit synchronize_rcu
  • or call_rcu
  • or SLAB_TYPESAFE_BY_RCU

that's not optional, that's not a suggestion, that's the rules. ⭐


πŸ”₯ SEE ALSO πŸ”₯

buckle up bestie, this list is long β€” the whole waitqueue friend group showed up to the function. πŸ’€

like i said. the whole friend group. no one got left out of this SEE ALSO, periodt 🧚


okay that's the whole page!! mwah πŸ’‹ this one comes from ./include/linux, dated October 2026 β€” hope you had the most slay time reading about a waitqueue going away, love u, bye πŸŽ€βœ¨

πŸ“¦ where this page comes from