select_lru_page(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ select_lru_page(9) πŸŽ€

okay so this is select_lru_page(9) from the Kernel API Manual, and it's literally here to figure out which page is least recently used. Bestie, it's giving β€œLRU detective” and I'm obsessed. πŸ’–

✨ NAME ✨

select_lru_page β€” determine which page is least recently used. No cap, that's the whole name vibe. 🫢

πŸ› οΈ SYNOPSIS πŸ› οΈ

struct page_info * select_lru_page (struct vdo_page_cache *cache );

🧾 ARGUMENTS 🧾

  • cache β€” the page cache. That's it, that's the argument. 🌸

πŸ’… DESCRIPTION πŸ’…

Okay so select_lru_page() picks the least recently used page from among the non-busy entries at the front of each of the lru list. The way this works: whenever a page gets marked busy, it also gets put at the end of the list, so it's unlikely that the entries at the front are busy unless the queue is very short β€” but it's not impossible, bestie. Keep that in mind. ✨

🎁 RETURN 🎁

It returns a pointer to the info structure for a relevant page, or NULL if no such page can be found. The page can be dirty or resident. Slay. πŸ’–

πŸ‘€ SEE ALSO πŸ‘€

Also peep the Kernel file ./drivers/md/dm-vdo/block-map.c and the Block map eras(9) squad, fr fr:


Signed off with love from the ./drivers/md/dm-vdo source tree, dated October 2026, and yes bestie this page is still select_lru_page(9). Bye, go be iconic with your page cache πŸ’…βœ¨

πŸ“¦ where this page comes from