get_pfnblock_migratetype(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… get_pfnblock_migratetype(9) β€” a Kernel API Manual moment

okay so bestie, welcome to the <pink>Kernel API Manual</pink> ✨ today's main character is get_pfnblock_migratetype and honestly she's lowkey iconic for how much work she saves you 🫢


🌸 NAME 🌸

get_pfnblock_migratetype β€” returns the migratetype of a pageblock πŸ’– that's it, that's the vibe check


✨ SYNOPSIS ✨

enum migratetype get_pfnblock_migratetype (const struct page *page ,
unsigned long pfn );

look at her signature, so clean, so demure πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • page β€” the page that lives inside the block you're curious about πŸ‘€ she's your "where am I" coordinate
  • pfn β€” the target page frame number 🎯 literally the number, the pfn in question

⭐ RETURN ⭐

the migratetype of the pageblock πŸ’« that's what you get back, no cap


πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea: use get_pfnblock_migratetype when you, the caller, already have both page and pfn sitting right there in your hands πŸ™Œ because then you get to skip a whole page_to_pfn call β€” and honestly? saving a call like that is so satisfying, it's giving efficiency, it's giving "I already did the work" 😌πŸ”₯


πŸ”₯ SEE ALSO πŸ”₯

the friend group 🌈 all of these live in the Kernel file ./mm/page_alloc.c and honestly they're all worth a follow:


and that's the whole page, bestie, you ate that πŸ“ source is ./mm, version date October 2026, and yes it's still called get_pfnblock_migratetype(9) because legends don't change their names πŸ‘‘πŸ’… bye mwah πŸŽ€

πŸ“¦ where this page comes from