Hacker News new | ask | show | jobs
by quotemstr 110 days ago
It is possible to unify things behind a single mechanism, yet apply different policies to different instances of this mechanism depending on circumstances and heuristics. We do not need almost entirely disjoint paging systems in the Linux kernel to notice that some kinds of memory have access patterns different from other kinds of memory. Instead of guessing based on whether someone used MAP_ANONYMOUS, we should observe what a program is actually doing.
1 comments

All LRUs, file-backend and anonymous are handled by the same code. There are some conditionals here and there - executable pages are promoted to active LRU on the first access, locked pages (if I remember correctly) too, but all pages go through the same cycle. See this Linux Plumbers conference presentation https://www.youtube.com/watch?v=0bnWQF7WQP0 with the following slides https://d3s.mff.cuni.cz/files/teaching/nswi161/2023_24/08_li...