get_pfnblock_bit(9)
πΈ get_pfnblock_bit(9) β kernel API manual, but make it make sense πΈ
okay bestie, so this one is from the kernel API manual (get_pfnblock_bit(9), section 9, we stan a numbered manual section) and it's genuinely one of the smaller little guys in ./mm, so let's get into it π
β¨ NAME β¨
get_pfnblock_bit β the "is this one single standalone bit of a pageblock actually set?" check π
π¦ SYNOPSIS π¦
bool get_pfnblock_bit (const struct page *page , unsigned long pfn ,
enum pageblock_bits pb_bit );
like, yes, that's the whole signature, keep it exactly as-is, no notes π«Ά
π ARGUMENTS π
pageβconst struct page *β the page that lives inside the block you care about, iykyk πpfnβunsigned longβ the target page frame number, aka the exact frame you're pointing at π―pb_bitβenum pageblock_bitsβ which pageblock bit you wanna check π
β RETURN β
trueif the bit is set π- otherwise
falseπ
that's it. that's the whole return contract. no cap.
π SEE ALSO π
so this function does NOT live alone, it has a whole friend group, and the kernel file it hangs out in is ./mm/page_alloc.c β here's everyone π
__get_pfnblock_flags_mask(9)get_pfnblock_migratetype(9)__set_pfnblock_flags_mask(9)set_pfnblock_bit(9)clear_pfnblock_bit(9)set_pageblock_migratetype(9)__move_freepages_block_isolate(9)__putback_isolated_page(9)__free_pages(9)free_pages(9)alloc_pages_exact(9)alloc_pages_exact_nid(9)free_pages_exact(9)nr_free_zone_pages(9)nr_free_buffer_pages(9)find_next_best_node(9)free_reserved_pages(9)setup_per_zone_wmarks(9)__free_contig_range(9)alloc_contig_frozen_range(9)alloc_contig_range(9)alloc_contig_frozen_pages(9)alloc_contig_pages(9)free_contig_frozen_range(9)free_contig_range(9)alloc_pages_nolock(9)
bestie reminder: every one of those is literally spelled the same in the real page, so don't go "fixing" the underscores, the double underscores mean something π
and that's the whole vibe check π this page came from ./mm and it's dated October 2026, so go off, read the source, slay, periodt β¨ππ¦
π¦ 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