idr_preload(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– idr_preload(9) πŸ’–

okay so bestie, welcome to the kernel API manual β€” this one lives in the 9 section and honestly it's a tiny little function with main character energy ✨


✨ NAME ✨

idr_preload β€” the preload hook for idr_alloc() πŸŽ€


🌸 SYNOPSIS 🌸

void idr_preload (gfp_t gfp_mask );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gfp_t gfp_mask β€” the allocation mask to use for the preloading, like the whole entire vibe of how you're allowed to grab memory πŸ’…

🌈 DESCRIPTION 🌈

So the way that this works is: you preallocate memory that's gonna be used for the next call to idr_alloc. That's it, that's the whole gig 🫢

But here's the part where you need to pay attention, bestie β€” this function returns with preemption disabled. Not a joke, not a drill. 😭 And then idr_preload_end is the one that turns it back on.

🚨 fr fr do not forget the idr_preload_end β€” preemption stays off until it runs. that's the whole deal, no cap.

πŸ‘‘ SEE ALSO πŸ‘‘

While you're here, the kernel file is ./lib/radix-tree.c and there's a whole friend group of related calls you might wanna go say hi to β€” obsessed with how many there are honestly:


later bestie πŸ’œ this one's from the ./lib corner of the world, dated October 2026, and it's filed under idr_preload(9) β€” slay ✨

πŸ“¦ where this page comes from