Yu Zhao 6609d55504
CHROMIUM: mm: multigenerational lru: scan kvm mmu pages
For each kvm instance, we add a list of its mmu pages. And each kvm
mmu page is reference counted and will not be freed before an rcu
grace period has expired. This allows us to walk each kvm mmu page
list under the rcu lock, and we can reschedule as long as we hold a
reference to any mmu page on the list (and unlock the rcu).

For data pages, we call get_page_unless_zero() and verify that it is
the right page, using cmpxchg64 to make sure that the kvm pte hasn't
changed.

BUG=b:123039911
TEST=Ran crostini.DiskIOPerf and crostini.VimCompile

Signed-off-by: Yu Zhao <yuzhao@google.com>
Change-Id: Ie047b349964063356fbbc604d0a935508ced5096
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2931318
Reviewed-by: Yu Zhao <yuzhao@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Yu Zhao <yuzhao@chromium.org>
Commit-Queue: Yu Zhao <yuzhao@chromium.org>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-06-10 15:54:20 +07:00
..