swap_pte_batch(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… swap_pte_batch(9) β€” kernel API manual, but make it make sense

okay bestie, so this is swap_pte_batch, a page straight outta the Kernel API Manual (section 9, kernel land, we love her) β€” and she's here to help you figure out how many swap entries in a row can be batched together. lowkey iconic behavior tbh ✨


πŸŽ€ NAME

swap_pte_batch β€” detect a PTE batch for a set of contiguous swap entries πŸ’«


🌸 SYNOPSIS

int swap_pte_batch (pte_t *start_ptep , int max_nr , pte_t pte );

πŸ¦‹ ARGUMENTS

  • start_ptep β€” Page table pointer for the first entry. like, where the party starts 🫢
  • max_nr β€” The maximum number of table entries to consider. it's giving "how many invites we printed" πŸ’Œ
  • pte β€” Page table entry for the first entry. the main character, the blueprint, the reference point πŸ‘‘

✨ DESCRIPTION

okay so the whole vibe: this function detects a batch of contiguous swap entries β€” meaning consecutive (non-present) PTEs that contain swap entries, where the swap entries all have consecutive offsets, all target the same swap type, and all have matching swp pte bits. fr fr, they have to match on everything to count as a batch πŸ’–

🚨 bestie, heads up: max_nr must be at least one, and must be limited by the caller so that scanning cannot exceed a single page table. no overachieving, no crossing boundaries, we stay in our lane πŸ’…

πŸ”₯ RETURN

the number of table entries in the batch. that's it, that's the answer, periodt ✨


πŸ‘‘ SEE ALSO

Kernel file ./mm/internal.h, plus all these besties:

go read them, iykwim 🧚


okay that's the whole page, no cap πŸ’œ β€” this one lives in ./mm (source/version) and it's dated October 2026, and the page itself is swap_pte_batch(9). mwah, study hard, slay πŸŽ€πŸŒˆπŸŒΈ

πŸ“¦ where this page comes from