Re: [PATCH mm-unstable v2 01/10] mm/kvm: add mmu_notifier_ops->test_clear_young()

2023-06-20 Thread Nicholas Piggin
On Sat May 27, 2023 at 9:44 AM AEST, Yu Zhao wrote: > Add mmu_notifier_ops->test_clear_young() to supersede test_young() > and clear_young(). > > test_clear_young() has a fast path, which if supported, allows its > callers to safely clear the accessed bit without taking > kvm->mmu_lock. > > The

Re: [PATCH mm-unstable v2 01/10] mm/kvm: add mmu_notifier_ops->test_clear_young()

2023-06-15 Thread Sean Christopherson
On Fri, May 26, 2023, Yu Zhao wrote: > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index 0e571e973bc2..374262545f96 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -258,6 +258,7 @@ int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); > #ifdef

Re: [PATCH mm-unstable v2 01/10] mm/kvm: add mmu_notifier_ops->test_clear_young()

2023-06-09 Thread Paolo Bonzini
On 5/31/23 21:17, Jason Gunthorpe wrote: + int (*test_clear_young)(struct mmu_notifier *mn, struct mm_struct *mm, + unsigned long start, unsigned long end, + bool clear, unsigned long *bitmap); + Why leave clear_young behind?

Re: [PATCH mm-unstable v2 01/10] mm/kvm: add mmu_notifier_ops->test_clear_young()

2023-06-08 Thread Yu Zhao
On Tue, Jun 6, 2023 at 2:34 AM Tzung-Bi Shih wrote: > > On Fri, May 26, 2023 at 05:44:26PM -0600, Yu Zhao wrote: > > +/* > > + * Architectures that implement kvm_arch_test_clear_young() should override > > + * kvm_arch_has_test_clear_young(). > > + * > > + * kvm_arch_has_test_clear_young() is

Re: [PATCH mm-unstable v2 01/10] mm/kvm: add mmu_notifier_ops->test_clear_young()

2023-06-06 Thread Tzung-Bi Shih
On Fri, May 26, 2023 at 05:44:26PM -0600, Yu Zhao wrote: > +/* > + * Architectures that implement kvm_arch_test_clear_young() should override > + * kvm_arch_has_test_clear_young(). > + * > + * kvm_arch_has_test_clear_young() is allowed to return false positive, > i.e., it > + * can return true if

Re: [PATCH mm-unstable v2 01/10] mm/kvm: add mmu_notifier_ops->test_clear_young()

2023-05-31 Thread Jason Gunthorpe
On Fri, May 26, 2023 at 05:44:26PM -0600, Yu Zhao wrote: > @@ -122,6 +124,10 @@ struct mmu_notifier_ops { > struct mm_struct *mm, > unsigned long address); > > + int (*test_clear_young)(struct mmu_notifier *mn, struct mm_struct *mm, > +

[PATCH mm-unstable v2 01/10] mm/kvm: add mmu_notifier_ops->test_clear_young()

2023-05-26 Thread Yu Zhao
Add mmu_notifier_ops->test_clear_young() to supersede test_young() and clear_young(). test_clear_young() has a fast path, which if supported, allows its callers to safely clear the accessed bit without taking kvm->mmu_lock. The fast path requires arch-specific code that generally relies on RCU