[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191005161139.GF2689@paulmck-ThinkPad-P72>
Date: Sat, 5 Oct 2019 09:11:39 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: rcu@...r.kernel.org, linux-kernel@...r.kernel.org,
mingo@...nel.org, jiangshanlai@...il.com, dipankar@...ibm.com,
akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
josh@...htriplett.org, tglx@...utronix.de, peterz@...radead.org,
rostedt@...dmis.org, dhowells@...hat.com, edumazet@...gle.com,
fweisbec@...il.com, oleg@...hat.com, joel@...lfernandes.org,
Radim Krčmář <rkrcmar@...hat.com>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
kvm@...r.kernel.org
Subject: Re: [PATCH tip/core/rcu 2/9] x86/kvm/pmu: Replace
rcu_swap_protected() with rcu_replace()
On Thu, Oct 03, 2019 at 12:14:32PM +0200, Paolo Bonzini wrote:
> On 03/10/19 03:43, paulmck@...nel.org wrote:
> > From: "Paul E. McKenney" <paulmck@...nel.org>
> >
> > This commit replaces the use of rcu_swap_protected() with the more
> > intuitively appealing rcu_replace() as a step towards removing
> > rcu_swap_protected().
> >
> > Link: https://lore.kernel.org/lkml/CAHk-=wiAsJLw1egFEE=Z7-GGtM6wcvtyytXZA1+BHqta4gg6Hw@mail.gmail.com/
> > Reported-by: Linus Torvalds <torvalds@...ux-foundation.org>
> > Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
> > Cc: Paolo Bonzini <pbonzini@...hat.com>
> > Cc: "Radim Krčmář" <rkrcmar@...hat.com>
> > Cc: Thomas Gleixner <tglx@...utronix.de>
> > Cc: Ingo Molnar <mingo@...hat.com>
> > Cc: Borislav Petkov <bp@...en8.de>
> > Cc: "H. Peter Anvin" <hpa@...or.com>
> > Cc: <x86@...nel.org>
> > Cc: <kvm@...r.kernel.org>
> > ---
> > arch/x86/kvm/pmu.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c
> > index 46875bb..4c37266 100644
> > --- a/arch/x86/kvm/pmu.c
> > +++ b/arch/x86/kvm/pmu.c
> > @@ -416,8 +416,8 @@ int kvm_vm_ioctl_set_pmu_event_filter(struct kvm *kvm, void __user *argp)
> > *filter = tmp;
> >
> > mutex_lock(&kvm->lock);
> > - rcu_swap_protected(kvm->arch.pmu_event_filter, filter,
> > - mutex_is_locked(&kvm->lock));
> > + filter = rcu_replace(kvm->arch.pmu_event_filter, filter,
> > + mutex_is_locked(&kvm->lock));
> > mutex_unlock(&kvm->lock);
> >
> > synchronize_srcu_expedited(&kvm->srcu);
> >
>
> Should go without saying, but
>
> Acked-by: Paolo Bonzini <pbonzini@...hat.com>
It never goes without saying! ;-)
Applied, thank you!
Thanx, Paul
Powered by blists - more mailing lists