find_lock_entries(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ find_lock_entries πŸ’…

hey bestie, welcome to the find_lock_entries(9) page from the Kernel API Manual β€” like, the kernel internals manual, and yes we're being cute about it πŸŽ€


🌸 NAME 🌸

find_lock_entries β€” bestie, it finds a batch of pagecache entries. that's it. that's the vibe. πŸ¦‹


✨ SYNOPSIS ✨

unsigned find_lock_entries (struct address_space *mapping , pgoff_t
*start , pgoff_t end , struct folio_batch *fbatch , pgoff_t *indices );

like, look at her. iconic signature. no cap. πŸ‘‘


πŸ’– ARGUMENTS πŸ’–

  • mapping β€” the address_space we're searching through, okurrr πŸ’«
  • start β€” the starting page cache index, the beginning of the whole thing 🌸
  • end β€” the final page index, and yes it's inclusive, don't forget that part 🫢
  • fbatch β€” where the resulting entries get placed, her little home πŸŽ€
  • indices β€” the cache indices of the entries chilling in fbatch ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so find_lock_entries will return a batch of entries from mapping. and listen β€” swap, shadow and DAX entries are included. all of them, invited to the party πŸ”₯

folios come back locked and with an incremented refcount, so stay on top of that, bestie, fr fr πŸ’…

folios that are locked by somebody else? skipped. folios under writeback? also skipped. folios that are partially outside the range? not returned, nope, not today πŸ™ˆ

the entries have ascending indexes ⭐ β€” but here's the thing, the indices may not be consecutive, and it's giving very much "it's complicated" 😭. why? because of not-present entries, large folios, folios which could not be locked, or folios under writeback. so many reasons. she's a mystery. 🧚


πŸ‘‘ RETURN πŸ‘‘

the number of entries which were found πŸ’œ β€” that's the return value, simple as that.


🌈 SEE ALSO 🌈

okay this list is literally a whole squad, buckle up bestie:


πŸ’€ reminder bestie: no inventing behaviour, everything above is straight from the page β€” if find_lock_entries skips your folio it's because it's locked by someone else, under writeback, or partially out of range. not personal. probably. πŸ“

and that's the page!! 🫢 sign-off time: this beauty comes from ./mm, dated October 2026, and it's find_lock_entries(9) β€” slay, periodt πŸ’–βœ¨

πŸ“¦ where this page comes from