Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp166794ybn; Thu, 3 Oct 2019 03:19:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0Xq2RxfdTJTFPPDgyw6nIAUrGl/jInN2umqxYMMoI6DKw6hvty91ZMDkf/HIriSlG1K9X X-Received: by 2002:a50:e691:: with SMTP id z17mr8646580edm.84.1570097947790; Thu, 03 Oct 2019 03:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570097947; cv=none; d=google.com; s=arc-20160816; b=j/IbGIW0Ap36i9vrX4Iz7Pa2TnenCgo4QrcIiZFlZZxQouuYqUgf16uhSMROvjgcFt 89eSIfrwIpMEfPClbMCWF6oZCC1mY78W9dUf/FfZIHt8QEgwxKzgCtXDjmnv55Pw8A4A ieJLLQmXmnQNx6eEMgTFk/qFuMjUQN4XW5+hq94xQWcXi4ZL1CgOafcTYUYrLWQpHAtb O78W+XZlitSbSU7u3IHwSnRojSn6Ayj2orGLrvHU6ub4cOLtDOR7uchy3zUp5nTbkkc9 8+lpwhPVjFdTwANpyKz2PMbS8/8+86hUa8ltAtxBf8Rbs4xza85hClW3y7/qQJWq2hG9 1cRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=ia+gGf8D4RKqD3mYHNJW4KBxV39P1F98Z1sPmxgCPUE=; b=Edy3TVqispxS4zVXlC9uHD/kEG9QGgxMnTqoENJayPbuMRzpXpd4bVg+uJF6HLH9Nb EBhRn96Zwh4CgoHC1+dFqafEV0PljAYfQTa97D1swSlpSUgs+ZIb1ZH/yao1kQBD2gVt A8VpkXjuzTh5H6K0Z4ofZ3QxzXHfLU+5nLd6joHHgt7Hk0ZAJy7UiA9mj4Oa+hY7lHbK QzDOXl4nXYZO1Ad5Zrp19M7FJ5YondBg6bNhO77hpoVEedaWKm3ksYZdV2M2HQ+Mx1cN VxStAvmD8/yTYQwWyG2J+ERihCGMMkWNpk/a0RlzfRpZwF4r+cxJcjq5pTZcXMrIcGcS H4EQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i33si1143044eda.205.2019.10.03.03.18.42; Thu, 03 Oct 2019 03:19:07 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728935AbfJCKOh (ORCPT + 99 others); Thu, 3 Oct 2019 06:14:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34598 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725827AbfJCKOg (ORCPT ); Thu, 3 Oct 2019 06:14:36 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2AB658665A for ; Thu, 3 Oct 2019 10:14:36 +0000 (UTC) Received: by mail-wr1-f69.google.com with SMTP id n3so905102wrt.9 for ; Thu, 03 Oct 2019 03:14:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ia+gGf8D4RKqD3mYHNJW4KBxV39P1F98Z1sPmxgCPUE=; b=dFBnO5imJsSEz675kmxuuTWRZrgxtgcEUdn2dGRYAw0EdX87YVKHNN+qnDnsv6nSvM wXIneTZyLT/6Hd5qPJyKUOlNrS/T/xssYqiapilaudC+2WiiAfg8kbjFeDiaIHtbFu20 TxVwDPtXKRc4LU/xyhfciOsV9jHaPA1cN/Xw5dije6aMifBjK/uYRMa4KfVAPJ0ooyEV tzXDdwG6382gtDsAtLq3JEWpnarJKwZvwR+2y5ws943oVpFfS9xKA+1nYDQKuZMF8xEA cjgVxEXeNwQTAdar0F3YIS8cyQSgSCQkjD1Nbl/kqj/zhvcvoGykH3JE0zvUWwz42e2b Mxhg== X-Gm-Message-State: APjAAAWKeey/aMNZrmlqmLhY63AH1sXqCXYAzfceRBAksD6Coq9cckr/ MVv9/nsBn3uUSP5F+fWR8Oyur4cc4FBCHajiTAUNv+sYJ+5zp2XzBh3L+AbKP9jEgRgNycvJsbJ 3KvWRhp6EyZSgvJno2boKCqOk X-Received: by 2002:adf:fa86:: with SMTP id h6mr6381154wrr.152.1570097674773; Thu, 03 Oct 2019 03:14:34 -0700 (PDT) X-Received: by 2002:adf:fa86:: with SMTP id h6mr6381135wrr.152.1570097674523; Thu, 03 Oct 2019 03:14:34 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:b903:6d6f:a447:e464? ([2001:b07:6468:f312:b903:6d6f:a447:e464]) by smtp.gmail.com with ESMTPSA id n8sm2851784wma.7.2019.10.03.03.14.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Oct 2019 03:14:33 -0700 (PDT) Subject: Re: [PATCH tip/core/rcu 2/9] x86/kvm/pmu: Replace rcu_swap_protected() with rcu_replace() To: paulmck@kernel.org, rcu@vger.kernel.org Cc: 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, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org References: <20191003014153.GA13156@paulmck-ThinkPad-P72> <20191003014310.13262-2-paulmck@kernel.org> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: Date: Thu, 3 Oct 2019 12:14:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191003014310.13262-2-paulmck@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Paolo