IDR SYNC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ idr sync ✨

okay so this is from the Kernel API Manual, section 9, and it's literally called idr sync πŸ’…

πŸŽ€ idr synchronization (stolen from radix-tree.h)

bestie, listen. idr_find is able to be called locklessly, using RCU πŸ‘‘ the caller must ensure calls to this function are made within rcu_read_lock regions. periodt.

other readers (lock-free or otherwise) and modifications may be running concurrently, so like… vibe check your assumptions before you go touching stuff πŸ™ˆ


πŸ¦‹ the part where you still have to do your homework

it is still required that the caller manage the synchronization and lifetimes of the items. no cap, that's on you 🫢

so if RCU lock-free lookups are used, typically this would mean that:

  • the items have their own locks, or are amenable to lock-free access ✨
  • and that the items are freed by RCU (or only freed after having been deleted from the idr tree and a synchronize_rcu grace period) 😭
fr fr do not skip the lifetimes part. the kernel will not be cute about it πŸ’€

🌈 SEE ALSO


πŸ’– and that's the whole page, bestie β€” so iconic of you to read it. shoutout to ./include/linux for the source, dated October 2026, filed under idr sync(9). slay πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from