mpol_shared_policy_init(9)
π mpol_shared_policy_init β like, the shared policy glow-up for your inode β¨
okay bestie, welcome to the Kernel API Manual entry for mpol_shared_policy_init(9) β yes that whole manual, we're doing this π
πΈ NAME πΈ
mpol_shared_policy_init β initialize shared policy for inode. that's it, that's the whole vibe check π
β¨ SYNOPSIS β¨
void mpol_shared_policy_init (struct shared_policy *sp , struct mempolicy *mpol );
π«Ά ARGUMENTS π«Ά
spβ pointer to inode shared policy. it's giving "where the magic happens" β¨mpolβ thestruct mempolicyto install. this is the main character fr π
π DESCRIPTION π
okay so here's the tea π: you install a non-NULL mpol in the inode's shared policy rb-tree. literally just slot it in there, no cap.
ngl, there's a little caveat you cannot skip β on entry, the current task has a reference on a non-NULL mpol, and this must be released on exit. π like, do not forget, bestie, that's a leak waiting to happen.
the way this works: it's called at get_inode calls, and because of that we can use GFP_KERNEL. slay, convenient allocation context, we love to see it π
π₯ SEE ALSO π₯
- Kernel file
./mm/mempolicy.cπ numa_nearest_node(9)nearest_node_nodemask(9)folio_can_map_prot_numa(9)alloc_pages_mpol(9)vma_alloc_folio(9)alloc_pages(9)mpol_misplaced(9)mpol_parse_str(9)mpol_to_str(9)
like, the whole friend group, honestly π¦
mwah π that's the page β sourced from ./mm, dated October 2026, and yes this manual is Kernel API Manual energy through and through. go forth and initialize those shared policies, icon π
π¦ 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