Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2023-05-25 Thread Peter Zijlstra
On Wed, May 24, 2023 at 02:39:50PM -0700, Sean Christopherson wrote: > On Wed, May 24, 2023, Peter Zijlstra wrote: > > On Wed, May 24, 2023 at 01:16:03PM -0700, Sean Christopherson wrote: > > > Of course, the only accesses outside of mmu_lock are reads, so on x86 that > > > "atomic" access is just

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2023-05-24 Thread Kautuk Consul
On 2023-05-24 22:33:36, Peter Zijlstra wrote: > On Wed, May 24, 2023 at 01:16:03PM -0700, Sean Christopherson wrote: > > > Atomics aren't memory barriers on all architectures, e.g. see the various > > definitions of smp_mb__after_atomic(). > > > > Even if atomic operations did provide barriers, u

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2023-05-24 Thread Sean Christopherson
On Wed, May 24, 2023, Peter Zijlstra wrote: > On Wed, May 24, 2023 at 01:16:03PM -0700, Sean Christopherson wrote: > > Of course, the only accesses outside of mmu_lock are reads, so on x86 that > > "atomic" access is just a READ_ONCE() load, but that's not the case for all > > architectures. > > T

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2023-05-24 Thread Peter Zijlstra
On Wed, May 24, 2023 at 01:16:03PM -0700, Sean Christopherson wrote: > Atomics aren't memory barriers on all architectures, e.g. see the various > definitions of smp_mb__after_atomic(). > > Even if atomic operations did provide barriers, using an atomic would be > overkill > and a net negative.

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2023-05-24 Thread Peter Zijlstra
On Wed, May 24, 2023 at 11:42:15AM +0530, Kautuk Consul wrote: > My comment was based on the assumption that "all atomic operations are > implicit memory barriers". If that assumption is true then we won't need It is not -- also see Documentation/atomic_t.txt. Specifically atomic_read() doesn't

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2023-05-24 Thread Sean Christopherson
On Wed, May 24, 2023, Kautuk Consul wrote: > On 2023-05-23 07:19:43, Sean Christopherson wrote: > > On Tue, May 23, 2023, Kautuk Consul wrote: > > > On 2022-07-06 16:20:10, Chao Peng wrote: > > > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > > > > index e9153b54e2a4..c262ebb1

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2023-05-23 Thread Kautuk Consul
On 2023-05-23 07:19:43, Sean Christopherson wrote: > On Tue, May 23, 2023, Kautuk Consul wrote: > > On 2022-07-06 16:20:10, Chao Peng wrote: > > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > > > index e9153b54e2a4..c262ebb168a7 100644 > > > --- a/include/linux/kvm_host.h > >

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2023-05-23 Thread Sean Christopherson
On Tue, May 23, 2023, Kautuk Consul wrote: > On 2022-07-06 16:20:10, Chao Peng wrote: > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > > index e9153b54e2a4..c262ebb168a7 100644 > > --- a/include/linux/kvm_host.h > > +++ b/include/linux/kvm_host.h > > @@ -765,10 +765,10 @@ stru

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2023-05-23 Thread Kautuk Consul
On 2022-07-06 16:20:10, Chao Peng wrote: > The sync mechanism between mmu_notifier and page fault handler employs > fields mmu_notifier_seq/count and mmu_notifier_range_start/end. For the > to be added private memory, there is the same mechanism needed but not > rely on mmu_notifier (It uses new in

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2022-08-10 Thread Chao Peng
On Fri, Aug 05, 2022 at 09:54:35PM +0200, Paolo Bonzini wrote: > On 7/29/22 21:02, Sean Christopherson wrote: > > If we really want a different name, I'd vote for nomenclature that captures > > the > > invalidation aspect, which is really what the variables are all trackng, > > e.g. > > > >m

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2022-08-05 Thread Paolo Bonzini
On 7/29/22 21:02, Sean Christopherson wrote: If we really want a different name, I'd vote for nomenclature that captures the invalidation aspect, which is really what the variables are all trackng, e.g. mmu_invalidate_seq mmu_invalidate_in_progress mmu_invalidate_range_start mmu_inva

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2022-08-03 Thread Chao Peng
On Fri, Jul 29, 2022 at 07:02:12PM +, Sean Christopherson wrote: > On Wed, Jul 06, 2022, Chao Peng wrote: > > The sync mechanism between mmu_notifier and page fault handler employs > > fields mmu_notifier_seq/count and mmu_notifier_range_start/end. For the > > to be added private memory, there

Re: [PATCH v7 08/14] KVM: Rename mmu_notifier_*

2022-07-29 Thread Sean Christopherson
On Wed, Jul 06, 2022, Chao Peng wrote: > The sync mechanism between mmu_notifier and page fault handler employs > fields mmu_notifier_seq/count and mmu_notifier_range_start/end. For the > to be added private memory, there is the same mechanism needed but not > rely on mmu_notifier (It uses new intr

[PATCH v7 08/14] KVM: Rename mmu_notifier_*

2022-07-06 Thread Chao Peng
The sync mechanism between mmu_notifier and page fault handler employs fields mmu_notifier_seq/count and mmu_notifier_range_start/end. For the to be added private memory, there is the same mechanism needed but not rely on mmu_notifier (It uses new introduced memfile_notifier). This patch renames th