Re: [PATCH v3 5/7] KVM: x86: Participate in bitmap-based PTE aging

2024-04-19 Thread James Houghton
On Fri, Apr 19, 2024 at 2:07 PM David Matlack wrote: > > On 2024-04-19 01:47 PM, James Houghton wrote: > > On Thu, Apr 11, 2024 at 10:28 AM David Matlack wrote: > > > On 2024-04-11 10:08 AM, David Matlack wrote: > > > bool kvm_age_gfn(struct kvm *kv

Re: [PATCH v3 0/7] mm/kvm: Improve parallelism for access bit harvesting

2024-04-19 Thread James Houghton
On Fri, Apr 12, 2024 at 11:41 AM David Matlack wrote: > > On 2024-04-01 11:29 PM, James Houghton wrote: > > This patchset adds a fast path in KVM to test and clear access bits on > > sptes without taking the mmu_lock. It also adds support for using a > > bitmap to (1)

Re: [PATCH v3 5/7] KVM: x86: Participate in bitmap-based PTE aging

2024-04-19 Thread James Houghton
On Fri, Apr 12, 2024 at 1:44 PM David Matlack wrote: > > On 2024-04-01 11:29 PM, James Houghton wrote: > > Only handle the TDP MMU case for now. In other cases, if a bitmap was > > not provided, fallback to the slowpath that takes mmu_lock, or, if a > > bitmap was provided

Re: [PATCH v3 5/7] KVM: x86: Participate in bitmap-based PTE aging

2024-04-19 Thread James Houghton
On Thu, Apr 11, 2024 at 10:28 AM David Matlack wrote: > > On 2024-04-11 10:08 AM, David Matlack wrote: > > On 2024-04-01 11:29 PM, James Houghton wrote: > > > Only handle the TDP MMU case for now. In other cases, if a bitmap was > > > not provided, fallback to the sl

Re: [PATCH v3 3/7] KVM: Add basic bitmap support into kvm_mmu_notifier_test/clear_young

2024-04-19 Thread James Houghton
On Fri, Apr 12, 2024 at 1:28 PM David Matlack wrote: > > On 2024-04-01 11:29 PM, James Houghton wrote: > > Add kvm_arch_prepare_bitmap_age() for architectures to indiciate that > > they support bitmap-based aging in kvm_mmu_notifier_test_clear_young() > > and that they do

Re: [PATCH v3 1/7] mm: Add a bitmap into mmu_notifier_{clear,test}_young

2024-04-19 Thread James Houghton
On Fri, Apr 12, 2024 at 11:45 AM David Matlack wrote: > > On 2024-04-01 11:29 PM, James Houghton wrote: > > The bitmap is provided for secondary MMUs to use if they support it. For > > test_young(), after it returns, the bitmap represents the pages that > > were young in

Re: [PATCH v3 1/7] mm: Add a bitmap into mmu_notifier_{clear,test}_young

2024-04-10 Thread James Houghton
On Tue, Apr 9, 2024 at 12:35 PM David Hildenbrand wrote: > > On 09.04.24 20:31, James Houghton wrote: > > Ah, I didn't see this in my inbox, sorry David! > > No worries :) > > > > > On Thu, Apr 4, 2024 at 11:52 AM David Hildenbrand wrote: > >&g

Re: [PATCH v3 1/7] mm: Add a bitmap into mmu_notifier_{clear,test}_young

2024-04-09 Thread James Houghton
Ah, I didn't see this in my inbox, sorry David! On Thu, Apr 4, 2024 at 11:52 AM David Hildenbrand wrote: > > On 02.04.24 01:29, James Houghton wrote: > > diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h > > index f349e08a9dfe..daaa9db625d3 100644

[PATCH v3 7/7] mm: multi-gen LRU: use mmu_notifier_test_clear_young()

2024-04-01 Thread James Houghton
m: rmap: Don't flush TLB after checking PTE young for page reference" was included so that the comparison is apples to apples. https://lore.kernel.org/r/20220706112041.3831-1-21cn...@gmail.com/ Signed-off-by: Yu Zhao Signed-off-by: James Houghton --- Documentation/admin-g

[PATCH v3 6/7] KVM: arm64: Participate in bitmap-based PTE aging

2024-04-01 Thread James Houghton
ed-in bitmap. When mkold == true, only age the pages that need aging according to the passed-in bitmap. Suggested-by: Yu Zhao Signed-off-by: James Houghton --- arch/arm64/include/asm/kvm_host.h| 5 + arch/arm64/include/asm/kvm_pgtable.h | 4 +++- arch/arm64/kvm/hyp/pgtable.c

[PATCH v3 5/7] KVM: x86: Participate in bitmap-based PTE aging

2024-04-01 Thread James Houghton
Only handle the TDP MMU case for now. In other cases, if a bitmap was not provided, fallback to the slowpath that takes mmu_lock, or, if a bitmap was provided, inform the caller that the bitmap is unreliable. Suggested-by: Yu Zhao Signed-off-by: James Houghton --- arch/x86/include/asm

[PATCH v3 4/7] KVM: x86: Move tdp_mmu_enabled and shadow_accessed_mask

2024-04-01 Thread James Houghton
From: Yu Zhao tdp_mmu_enabled and shadow_accessed_mask are needed to implement kvm_arch_prepare_bitmap_age(). Signed-off-by: Yu Zhao Signed-off-by: James Houghton --- arch/x86/include/asm/kvm_host.h | 6 ++ arch/x86/kvm/mmu.h | 6 -- arch/x86/kvm/mmu/spte.h | 1

[PATCH v3 3/7] KVM: Add basic bitmap support into kvm_mmu_notifier_test/clear_young

2024-04-01 Thread James Houghton
d_age(). Suggested-by: Yu Zhao Signed-off-by: James Houghton --- include/linux/kvm_host.h | 60 ++ virt/kvm/kvm_main.c | 92 +--- 2 files changed, 127 insertions(+), 25 deletions(-) diff --git a/include/linux/kvm_host.h b/include/

[PATCH v3 1/7] mm: Add a bitmap into mmu_notifier_{clear,test}_young

2024-04-01 Thread James Houghton
[1]: https://lore.kernel.org/all/20230609005935.42390-1-yuz...@google.com/ Suggested-by: Yu Zhao Signed-off-by: James Houghton --- include/linux/mmu_notifier.h | 93 +--- include/trace/events/kvm.h | 13 +++-- mm/mmu_notifier.c| 20 +--- virt/kvm/

[PATCH v3 2/7] KVM: Move MMU notifier function declarations

2024-04-01 Thread James Houghton
To allow new MMU-notifier-related functions to use gfn_to_hva_memslot(), move some declarations around. Also move mmu_notifier_to_kvm() for wider use later. Signed-off-by: James Houghton --- include/linux/kvm_host.h | 41 +--- virt/kvm/kvm_main.c | 5

[PATCH v3 0/7] mm/kvm: Improve parallelism for access bit harvesting

2024-04-01 Thread James Houghton
https://lore.kernel.org/kvmarm/20230526234435.662652-1-yuz...@google.com/ [4]: https://lore.kernel.org/all/zitx64bbx5vdj...@google.com/ James Houghton (5): mm: Add a bitmap into mmu_notifier_{clear,test}_young KVM: Move MMU notifier function declarations KVM: Add basic bitmap support into kvm