softleaf_has_pfn(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… softleaf_has_pfn β€” like, does this leaf entry actually hold a real PFN?

okay so this is the softleaf_has_pfn page from section 9 of the Kernel API Manual. yes, the kernel manual. we're doing kernel lore today bestie, stay with me 🫢

✨ NAME ✨

softleaf_has_pfn β€” the vibe check function. it asks the important question: does this leaf entry encode a valid PFN number? πŸ”

🌸 SYNOPSIS 🌸

bool softleaf_has_pfn (softleaf_t entry );

πŸŽ€ ARGUMENTS πŸŽ€

  • entry β€” the leaf entry in question. just the one. that's your whole input, babe, no cap.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so context first, because this is giving lore. a pfn swap entry is a special lil type of swap entry β€” the way it's special is that it always has a pfn stored in the swap offset. always. periodt. πŸ’…

and what are these pfn swap entries even for? glad you asked, here's the tea, three whole situations:

  • representing unaddressable device memory πŸ“΅
  • restricting access to a page that's undergoing migration 🚚
  • representing a pfn that has been hwpoisoned and unmapped πŸ’€ (yeah. poisoned. dramatic but accurate.)

so when you're holding a leaf entry and you need to know if it's this kind of entry, you come here. iykyk.

πŸ”₯ RETURN πŸ”₯

  • true β€” the leaf entry encodes a PFN, slay ✨
  • false β€” otherwise. it does not. no pfn. πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file is ./include/linux/leafops.h β€” that's where the family lives. and the family is big, so buckle up bestie, we're listing every single one because they all deserve their moment 🫢

like i said. huge family. iconic honestly 🌈


and that's the page!! brought to you by ./include/linux, dated October 2026 β€” mwah, go read some leafops, ily πŸ’œ

πŸ“¦ where this page comes from