On Wed, 2024-08-28 at 09:17 +0300, Kirill A . Shutemov wrote: > On Tue, Aug 27, 2024 at 09:18:58PM -0400, Rik van Riel wrote: > > > > Workload owners are going to have a real problem trying to figure > > out what the best value of max_ptes_none should be for their > > workloads. > > > > However, giving workload owners the ability to say "this workload > > should not waste more than 1GB of memory on zero pages inside > > THPs", > > or 500MB, or 4GB or whatever, would then allow the kernel to > > automatically adjust the max_ptes_none threshold. > > The problem is that we don't have and cannot have the info on zero > pages > inside THPs readily available. It requires memory scanning which is > prohibitively expensive if we want the info to be somewhat up-to- > date. > I'm not sure it needs to be super up to date. After all, we only care when there is memory pressure, and when there is memory pressure we will be doing some sort of scanning, anyway. With a shrinker in the mix, we do not need totally up to date information, but can gradually approximate the target. -- All Rights Reversed.