page_ext_lookup(9)
π page_ext_lookup β the Kernel API Manual, bestie edition π
okay so picture this: you're in the kernel, you've got a PFN, and you're like "hiii what's the page extension for this bad boy?" β that's literally this function. it's page_ext_lookup(9) from the Kernel API Manual, and she is iconic for exactly one job. no cap. π
β¨ NAME β¨
page_ext_lookup β Lookup a page extension for a PFN.
like, that's it. that's the whole gig. you hand her a PFN, she goes looking for the matching page extension. she's a specialist, she's booked, she's serving. π
π¦ SYNOPSIS π¦
struct page_ext * page_ext_lookup (unsigned long pfn );
that's the whole signature, copy it exactly, don't be weird about it. struct page_ext * is the return vibe, and unsigned long pfn is the one (1) argument she accepts. π«Ά
πΈ ARGUMENTS πΈ
pfnβ PFN of the page we're interested in. yes, that pfn. the page frame number. the one you came here for. π
π DESCRIPTION π
the rules, bestie, and you HAVE to follow them because the manpage said so:
- Must be called with RCU read lock taken.
- and
pfnmust be valid.
that's genuinely it. two conditions. take the RCU read lock, make sure the PFN is real and valid, and then you may proceed. don't skip the lock. don't pass a fake PFN. this is not a drill, this is a documented requirement. π
β οΈ both of those are hard requirements, not suggestions β RCU read lock taken, pfn valid, periodt.
β RETURN β
returns NULL if no page_ext exists for this page.
so like... if she doesn't find one, you get NULL. not an error code, not a little note, just NULL. handle it, bestie. π
π§ SEE ALSO π§
her friends!! the whole page_ext friend group, all living in the kernel file ./mm/page_ext.c:
go say hi. they're all linked, they're all in ./mm/page_ext.c, iykyk. π
okay that's the page!! she's sourced from ./mm, dated October 2026, and signed off as page_ext_lookup(9) β slay, go take your RCU read lock, mwah π©·β¨πππ₯
π¦ 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