walk_kernel_..._table_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

walk_kernel_page_table_range β€” walk a range of kernel pagetables. This is a Kernel API Manual page, bestie, and it's giving β€œlet’s take a stroll through page tables” energy. Slay, honestly. πŸ’…βœ¨

✨ SYNOPSIS ✨

       int walk_kernel_page_table_range (unsigned long start , unsigned long
       end , const struct mm_walk_ops *ops , pgd_t *pgd , void *private );

πŸ’… ARGUMENTS πŸ’…

  • start β€” start address of the virtual address range. That's where the walk begins, periodt. 🌸
  • end β€” end address of the virtual address range. The range ends here, bestie. πŸŽ€
  • ops β€” operation to call during the walk. This is the callback situation. πŸ¦‹
  • pgd β€” pgd to walk if different from mm->pgd. iykyk. πŸ’œ
  • private β€” private data for callbacks' usage. The callbacks get to use it, periodt. πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

It's similar to walk_page_range, but this one can walk any page tables even if they are not backed by VMAs. The way that it doesn't need VMA backing? Iconic, honestly. πŸ’β€β™€οΈ

Because 'unusual' entries may be walked, this function will also not lock the PTEs for the pte_entry callback. That's the trade-off, bestie β€” keep that in mind. πŸ”₯

This is useful for walking kernel page tables or page tables for firmware. Very β€œwe go where the VMAs don't” of it. 🌈

🚨 NOTE 🚨

⚠️ Be careful when walking kernel page tables, bestie. The caller may need to take other effective approaches (mmap lock may be insufficient) to prevent the intermediate kernel page tables belonging to the specified address range from being freed (e.g. memory hot-remove). This is not a drill. πŸ˜­πŸ’€

🌈 SEE ALSO 🌈

All the related lore, no cap:

xoxo, from ./mm, October 2026 β€” walk_kernel_..._table_range(9) πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from