softleaf_from_pte(9)
π softleaf_from_pte(9) β like, the leaf-entry glow-up of a PTE β¨
okay so bestie, welcome to the Kernel API Manual (section 9, we're in kernel-land now π§). This is the page for softleaf_from_pte, and it's genuinely such a small little function but it does exactly one job and it does it iconically. Let's get into it π«Ά
πΈ NAME πΈ
softleaf_from_pte β obtain a leaf entry from a PTE entry. That's it. That's the whole personality. π
β¨ SYNOPSIS β¨
softleaf_t softleaf_from_pte (pte_t pte );
Not me writing out the exact signature with the exact spacing because we do not freestyle the synopsis, periodt. π
π ARGUMENTS π
pteβ a PTE entry. yes, that's the whole description, it's giving "minimalist main character energy" but it's also accurate so we move. π
π DESCRIPTION π
okay here's the vibe check on what this function actually does, and it's lowkey the plot twist of the page:
if pte is present (and therefore not a leaf entry β read that twice, bestie, because it's the whole point π) the function returns an empty leaf entry. Otherwise, it returns a leaf entry.
yeah. the branch is flipped from what your brain expects, and honestly? we respect it. it ate. π₯
β RETURN β
a leaf entry. that's the return value. short and slay. π
π¦ SEE ALSO π¦
okay this is the part where the manpage absolutely unloads the whole friend group on you β 34 references, no cap, and we are listing every single one because they're all part of the lore. the kernel file to know is ./include/linux/leafops.h π
softleaf_mk_none(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_has_pfn(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. the whole group chat. go say hi to all of them. π
lowkey reminder bestie: the description says present β empty leaf entry, otherwise a leaf entry. don't invert it in your head and then blame the manpage, iykyk π
and that's the page!! this one lives in ./include/linux and it's dated October 2026, so when you see softleaf_from_pte(9) with that October 2026 timestamp just know it's the same iconic little function we just talked about π
β¨ bye bestie, go read leafops.h π
π¦ 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