idr_preload(9)
π 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:
radix_tree_find_next_bit(9)radix_tree_shrink(9)__radix_tree_create(9)radix_tree_insert(9)__radix_tree_lookup(9)radix_tree_lookup_slot(9)radix_tree_lookup(9)__radix_tree_replace(9)radix_tree_replace_slot(9)radix_tree_iter_replace(9)radix_tree_tag_set(9)radix_tree_tag_clear(9)radix_tree_iter_tag_clear(9)radix_tree_tag_get(9)radix_tree_next_chunk(9)radix_tree_gang_lookup(9)radix_tree_gang_lookup_tag(9)radix_tree_gang_lookup_tag_slot(9)radix_tree_iter_delete(9)radix_tree_delete_item(9)radix_tree_delete(9)radix_tree_tagged(9)idr_destroy(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms