On Tue, Feb 22, 2022 at 09:56:20AM +0100, David Hildenbrand wrote: > 2. Who triggers reclaim and when? > > Letting an application trigger reclaim of page tables is the "easiest > solution": let's imagine madvise(MADV_RECLAIM_PGTABLES). However, this > doesn't take care of malicious workloads and is more problematic when > having sparse files mapped into multiple processes. Further, there is no > need to reclaim if we're not under memory pressure. > > Letting the system do this automatically looks "cleaner". But, when to > start reclaiming? How to detect and handle malicious processes (do we > care?)? How to set an adequate soft/hard limit? I don't think we care about the difference between users that are performing useful work with an inefficient page table strategy and users that are trying to break the page table usage scheme. We have to account the page tables to each process (which we already do), and a process which is, say, trying to allocate memory might be shunted off to a path where it tries to reclaim its own page tables if it has a lot on the books. Particularly if it's trying to allocate memory for more page tables ;-) > While I do have answers to some of the questions and various ideas, it's > certainly an interesting topic to discuss and brainstorm. Indeed; it interests me too.