]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: multi-gen LRU: use {ptep,pmdp}_clear_young_notify()
authorYu Zhao <yuzhao@google.com>
Sat, 19 Oct 2024 01:29:39 +0000 (01:29 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 1 Nov 2024 04:28:04 +0000 (21:28 -0700)
commit082525fa8a9141104aa4a42eeec92659e0be9b6a
treeee89e391ade9a3b6140e3ea0b0b8992d9ef8f5bc
parent930085cde1846154f1caa903dd6d3f0baaedc3b5
mm: multi-gen LRU: use {ptep,pmdp}_clear_young_notify()

When the MM_WALK capability is enabled, memory that is mostly accessed by
a VM appears younger than it really is, therefore this memory will be less
likely to be evicted.  Therefore, the presence of a running VM can
significantly increase swap-outs for non-VM memory, regressing the
performance for the rest of the system.

Fix this regression by always calling {ptep,pmdp}_clear_young_notify()
whenever we clear the young bits on PMDs/PTEs.

Link: https://lkml.kernel.org/r/20241019012940.3656292-3-jthoughton@google.com
Fixes: bd74fdaea146 ("mm: multi-gen LRU: support page table walks")
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: James Houghton <jthoughton@google.com>
Reported-by: David Stevens <stevensd@google.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: David Matlack <dmatlack@google.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Wei Xu <weixugc@google.com>
Cc: <stable@vger.kernel.org>
Cc: kernel test robot <lkp@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mmzone.h
mm/rmap.c
mm/vmscan.c