softleaf_has_pfn(9)
π 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 π«Ά
softleaf_mk_none(9)softleaf_from_pte(9)softleaf_to_pte(9)softleaf_from_pmd(9)softleaf_to_pmd(9)softleaf_is_none(9)softleaf_type(9)softleaf_is_swap(9)softleaf_is_migration_write(9)softleaf_is_migration_read(9)softleaf_is_migration_read_exclusive(9)softleaf_is_migration(9)softleaf_is_device_private_write(9)softleaf_is_device_private(9)softleaf_is_device_exclusive(9)softleaf_is_hwpoison(9)softleaf_is_marker(9)softleaf_to_marker(9)softleaf_to_pfn(9)softleaf_to_page(9)softleaf_to_folio(9)softleaf_is_poison_marker(9)softleaf_is_guard_marker(9)softleaf_is_uffd_wp_marker(9)softleaf_is_migration_young(9)softleaf_is_migration_dirty(9)pte_is_marker(9)pte_is_uffd_wp_marker(9)pte_is_uffd_marker(9)pmd_is_device_private_entry(9)pmd_is_migration_entry(9)softleaf_is_valid_pmd_entry(9)pmd_is_valid_softleaf(9)pmd_to_softleaf_folio(9)
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
- 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