Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2291298ybp; Sat, 5 Oct 2019 09:13:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqycYSqqFu04mN5u5uo6mciskKmMw9knSYg6vXpptv34pwgeF98KRo5dOeyA1+ehbFOvM5G9 X-Received: by 2002:a17:907:214e:: with SMTP id rk14mr17350018ejb.60.1570292026100; Sat, 05 Oct 2019 09:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570292026; cv=none; d=google.com; s=arc-20160816; b=lVGpzyzMyhrY7B3gpwBb+8GebV1dApQtMy/JMxQQs09nfrrDhK8/c9TnSZYR8zZl2B tqL4QmASYrGyaVjn0y5QkN9cP5k2fmQGjoPT0Xi0cT/5u3maTCMjZxWJZPt+8+FEZtW2 F/XhBQalV9XQZ0OocqC6la5Ef4BZMvhE/uCbMVvH+VzbJ7IDsCPgz72m94LERdqI652m DuCv4YOsedmHmmpZAYvalfFoW29edn52obcac6WSi1r5LoeSo/z5O8dQPeMb5Ncw5ruC gwvMC7XGXZHHJ63ioy60PkbeqKMC/hAKSEe5qJ7tbAULF6Cqg/XqjRz26eoqityz2tvD rYXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=eat8q9OV7WfPSq+89Jex7smo39EXaLu9qkIvfP9lzc0=; b=mfLpg7nsN88os5gKPQfja6Q5oSPPNGbm9QugPXOYieLONAcUC2gl80aalooTo6lTA1 Nh1OnB0fuwxpiL2aBVAFpb3X6TVK8V44k0a+C8JCJoetStvPKppge0fMiVY2yDBXIHKl b1D46qJNTklGkbigMyip8zAB1iUhjscZ142nhuQNC2Zi2blqs8sE7VOFZtE1CeueT7aZ gxiqRgXXj/Fi/9xFxcDLy2ucJuIpXystAtUvnoN87gUBkEy42iok5q9TQIyUzdQ6FjmR TcyQPiheRTUB9WDNTqhwjb62P6i+C548QLBcJY5Ick+iVQq8drjcIITXc2j7MAujsJiY +g3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tyjDMtSM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 29si4901605eje.235.2019.10.05.09.13.22; Sat, 05 Oct 2019 09:13:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tyjDMtSM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729290AbfJEQLm (ORCPT + 99 others); Sat, 5 Oct 2019 12:11:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:37502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726069AbfJEQLm (ORCPT ); Sat, 5 Oct 2019 12:11:42 -0400 Received: from paulmck-ThinkPad-P72 (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 24CA7222C8; Sat, 5 Oct 2019 16:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570291901; bh=2CMzIaR11Kg9OxlJablRvzbt0vt48j7Jf7oHeyy/j6o=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=tyjDMtSMnJjosZMCLOf2j36jsGyBJyB4qN7nJZvXnlKBa1UFGMRSisD0wxntGYrpb MXmoN383cxXCzvpAdTagMRf7DjkfFN3+lI5Zt0TLAh5n0IUW4bd64xLh7lH0uyMQsS 5LoBYF6j80tY6Q6ZK2+ccxj608SQRYGEjorv0eSs= Date: Sat, 5 Oct 2019 09:11:39 -0700 From: "Paul E. McKenney" To: Paolo Bonzini Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH tip/core/rcu 2/9] x86/kvm/pmu: Replace rcu_swap_protected() with rcu_replace() Message-ID: <20191005161139.GF2689@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20191003014153.GA13156@paulmck-ThinkPad-P72> <20191003014310.13262-2-paulmck@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 03, 2019 at 12:14:32PM +0200, Paolo Bonzini wrote: > On 03/10/19 03:43, paulmck@kernel.org wrote: > > From: "Paul E. McKenney" > > > > 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 > > Signed-off-by: Paul E. McKenney > > Cc: Paolo Bonzini > > Cc: "Radim Krčmář" > > Cc: Thomas Gleixner > > Cc: Ingo Molnar > > Cc: Borislav Petkov > > Cc: "H. Peter Anvin" > > Cc: > > Cc: > > --- > > 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 It never goes without saying! ;-) Applied, thank you! Thanx, Paul