folio_isolate_lru(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to folio_isolate_lru(9) from the Kernel API Manual πŸ’… β€” this is the LRU-isolation glow-up you didn’t know you needed. We’re gonna keep every detail, no cap, and make it make sense. πŸ’–


🌸 NAME 🌸

folio_isolate_lru β€” try to isolate a folio from its LRU list. 🫢

✨ SYNOPSIS ✨

bool folio_isolate_lru (struct folio *folio );

πŸŽ€ ARGUMENTS πŸŽ€

  • folio β€” the folio to isolate from its LRU list. πŸ¦‹

πŸ’… DESCRIPTION πŸ’…

Okay so the main character here is isolating a folio from an LRU list, and adjusting the vmstat statistic that corresponds to whatever LRU list the folio was on. ✨

After that: the folio will have its LRU flag cleared. If it was found on the active list, it will have the Active flag set. If it was found on the unevictable list, it will have the Unevictable flag set. Heads up, bestie: these flags may need to be cleared by the caller before letting the page go. 🫢

Now the rules, and yes they are giving strict:

  1. Must be called with an elevated refcount on the folio. This is a fundamental difference from isolate_lru_folios (which is called without a stable reference). πŸ”₯
  2. The lru_lock must not be held. πŸ’€
  3. Interrupts must be enabled. ⭐

🫧 CONTEXT 🫧

Blank in the original β€” no context notes here, just vibes. 🫧

πŸ¦‹ RETURN πŸ¦‹

  • true if the folio was removed from an LRU list. πŸ‘‘
  • false if the folio was not on an LRU list. πŸ™ˆ

🌈 SEE ALSO 🌈

Kernel file ./mm/vmscan.c β€” that’s the source file mentioned. Then the squad:

xoxo from ./mm, dated October 2026 πŸŽ€βœ¨ β€” bestie, go isolate responsibly. πŸ’…

πŸ“¦ where this page comes from