__list_splice_init_rcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay so welcome to the glow-up of __list_splice_init_rcu(9), straight out of the Kernel API Manual. she joins an RCU-protected list into an existing list and honestly? she ate. ✨


🌸 NAME 🌸

__list_splice_init_rcu β€” join an RCU-protected list into an existing list. that's it, that's the whole personality 🫢


⭐ SYNOPSIS ⭐

void __list_splice_init_rcu (struct list_head *list , struct list_head *prev , struct list_head *next , void (*sync)(void) );

four arguments, one void return, zero notes. we love a low-maintenance signature πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • list β€” the RCU-protected list to splice. this is the little guy getting merged in πŸ₯Ί
  • prev β€” points to the last element of the existing list. yes, the last one, don't get it twisted πŸ’€
  • next β€” points to the first element of the existing list
  • sync β€” synchronize_rcu, synchronize_rcu_expedited, ... (the ... is doing so much work here, iykyk)

πŸ”₯ DESCRIPTION πŸ”₯

so the list that prev and next point at? it can be RCU-read traversed concurrently with this function running. no cap, that's the whole point of the RCU flavor. ✨

heads up: this function blocks. like, actually blocks. plan your little life around it 😭

important note, and girl i mean IMPORTANT: the caller has to take whatever action is necessary to prevent any other updates to the existing list. that's on you, not on her. πŸ™ˆ

in principle, it's possible to modify the list as soon as sync begins execution. so like, the door cracks open the moment sync starts doing its thing πŸ‘€

if this sort of thing becomes necessary, an alternative version based on call_rcu could be created. but like β€” only if -really- needed. there is literally no shortage of RCU API members, bestie, the RCU shelf is fully stocked πŸ‘‘πŸ’€


🌈 SEE ALSO 🌈

Kernel file ./include/linux/rculist.h, plus the whole extended fam β€” every single one of them, no skipping, we're doing the full group chat:


okay that's the whole page, go be safe with your list updates πŸ’œ

mwah πŸ’‹ from ./include/linux, dated October 2026 β€” that's the source and the date, bestie, and yes i remembered them both πŸŽ€βœ¨

πŸ“¦ where this page comes from