STRUCT FOLIO_WALK(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

struct folio_walk β€” bestie, this is literally just the data holder that folio_walk_start() / folio_walk_end() use πŸ’–

This page lives in the Kernel API Manual, and it's giving "quick reference for one struct" energy, so let's get into it 🫢


✨ SYNOPSIS ✨

struct folio_walk {
    struct page *page;
    enum folio_walk_level level;
    union {
      pte_t *ptep;
      pud_t *pudp;
      pmd_t *pmdp;
    };
    union {
      pte_t pte;
      pud_t pud;
      pmd_t pmd;
    };
    struct vm_area_struct *vma;
    spinlock_t *ptl;
 };

That's the whole vibe right there β€” two anonymous unions doing main character energy, plus the obvious faves 😌


πŸŽ€ Members πŸŽ€

  • page β€” the exact folio page being referenced (if applicable, so like… sometimes it's just not relevant, iykyk) πŸ“„
  • level β€” the page table level that identifies which entry type you're looking at πŸ”
  • {unnamed_union} β€” anonymous πŸ«₯
  • {unnamed_union} β€” anonymous πŸ«₯ (yes, twice, that's not me being lazy, that's the manpage being iconic)
  • pte β€” pointer to the page table entry (FW_LEVEL_PTE) 🎯
  • pud β€” pointer to the page table entry (FW_LEVEL_PUD) 🎯
  • pmd β€” pointer to the page table entry (FW_LEVEL_PMD) 🎯
  • ptl β€” pointer to the page table lock πŸ”’
ok so tiny heads-up πŸ™ˆ β€” vma shows up in the struct up top but the Members list doesn't say anything about it. Not me gatekeeping, that's just what's in the page, so don't come for me πŸ’€

πŸ’… Description πŸ’…

(see folio_walk_start documentation for more details)

Like β€” literally that's what it says. This page is a "go read the other page" situation and honestly? Respect the efficiency πŸŽ€


🌈 SEE ALSO 🌈

  • Kernel file ./include/linux/pagewalk.h
  • struct mm_walk_ops(9)
  • struct mm_walk(9)

bestie you made it to the end, so here's the cute sign-off πŸ¦‹ this one comes from ./include/linux, dated October 2026, and its whole identity is struct folio_walk(9) β€” slay, no cap βœ¨πŸ‘‘

πŸ“¦ where this page comes from