Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp6047706ybg; Tue, 22 Oct 2019 12:15:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQ8d3t4escgsx84LX+mRFz2IWB/u6ajN5LMuOWxhGm/W4TodjNYm8ljR70565lvr1snatP X-Received: by 2002:a17:907:397:: with SMTP id ss23mr18292992ejb.177.1571771752367; Tue, 22 Oct 2019 12:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571771752; cv=none; d=google.com; s=arc-20160816; b=l4cd+jmKHhODG+HQw8AK3ros0QScTJ5wTFjudGL2bxrjq9JbGDjhVFw1nSReLEwSkm fNkqq8ydirum2iEIeRDoCZIxiPIfx4w1DGIAs3DzTkC5xoVbvXVw0AZZmFGePHunBFqJ AWmDRGJpxEV3kcQHBohrW/eudwayVxRwSmSc7OZDhdgCrMfFvQWUMMZnNw54+64HAGGi KRe1bGlNBnyXnalQ4JMDCxNbb3+gMAB/LlYmj95YMDRYV7sY6Rf1/yXu5XNH+f0cOJIs VreDVraAo9fQYr1KM52bAm1O4orRrrQoo8d03dFviq/EaIUJTb0CQ+KSsXy5BYWIReVy Gs+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=xFYziHEmQ39fe029r8gYbz9S05aDF4H8QOZ6lHS5sPg=; b=b/IJil/wFWVKflZCbk/W0z0wKYl1kvQRZjy/QrbK5NEH3AhtS50jMrGSOc+OMWGztC Aw4vHkdLPDuXKl35m5MsMGXnt76D29YBN/6WQP1xVkuJtTjn/mq1AcsHkk/+g9KzJ8qR ROb1D3bWvMgFxSEUxOYE+ejYVDsiH3a9IBnGNdrILa3yk24fSqsUH3OXqnlAbM4NQvjZ 4gXvdmGvJzMygeeL8vIT3Gsjxl/VmmXog7ghaXajO2QdMw040/17sKrjgMNr7LzEHRr/ 7vYumFEPd9WJLKyCCrrObxw+9rAa0k3HpnSaFHVbz6sUQOPdxgscU8gUJwSI2TJDOEJG u1wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h+ekN0hJ; 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 z16si2473858edi.241.2019.10.22.12.15.28; Tue, 22 Oct 2019 12:15:52 -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=h+ekN0hJ; 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 S1733059AbfJVTMh (ORCPT + 99 others); Tue, 22 Oct 2019 15:12:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:43634 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732990AbfJVTMb (ORCPT ); Tue, 22 Oct 2019 15:12:31 -0400 Received: from localhost.localdomain (rrcs-50-75-166-42.nys.biz.rr.com [50.75.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9992F222C2; Tue, 22 Oct 2019 19:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571771550; bh=xvqU+DkqSwLSkL389M85X3LHYTzrsH2JRYG7WtqfMbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h+ekN0hJzMU6y7DMOH26WIIjasFP1wEm2W7tmFmXMVmVnWIFEjzWc+3aEMLt1aJLf uqCIUtizCEUE9vYjvYO4kaIuK3ZWvUaYAB/ltFiGNOqUe5QlCYsLhrkYcTPdQ/WfCa hcbWtgPXvvD4um8tPHqzLemVfgPOVJ1XTi4u6pqU= From: paulmck@kernel.org To: 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, "Paul E. McKenney" , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Yonghong Song , netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH tip/core/rcu 06/10] bpf/cgroup: Replace rcu_swap_protected() with rcu_replace() Date: Tue, 22 Oct 2019 12:12:11 -0700 Message-Id: <20191022191215.25781-6-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20191022191136.GA25627@paulmck-ThinkPad-P72> References: <20191022191136.GA25627@paulmck-ThinkPad-P72> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 [ paulmck: From rcu_replace() to rcu_replace_pointer() per Ingo Molnar. ] Signed-off-by: Paul E. McKenney Acked-by: Andrii Nakryiko Acked-by: Song Liu Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Martin KaFai Lau Cc: Yonghong Song Cc: Cc: --- kernel/bpf/cgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c index ddd8add..c684cf4 100644 --- a/kernel/bpf/cgroup.c +++ b/kernel/bpf/cgroup.c @@ -180,8 +180,8 @@ static void activate_effective_progs(struct cgroup *cgrp, enum bpf_attach_type type, struct bpf_prog_array *old_array) { - rcu_swap_protected(cgrp->bpf.effective[type], old_array, - lockdep_is_held(&cgroup_mutex)); + old_array = rcu_replace_pointer(cgrp->bpf.effective[type], old_array, + lockdep_is_held(&cgroup_mutex)); /* free prog array after grace period, since __cgroup_bpf_run_*() * might be still walking the array */ -- 2.9.5