Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp100291ybp; Thu, 3 Oct 2019 10:45:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0ZnvbkwiX+MD4LPh5sHu8wYqT2mKDdtPx3VH0ULhCC0Sd5EqHGuzvaXBkSDvoc345Uhkz X-Received: by 2002:a17:907:215a:: with SMTP id rk26mr8664570ejb.49.1570124744565; Thu, 03 Oct 2019 10:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570124744; cv=none; d=google.com; s=arc-20160816; b=dcMypT15C2NaZnTk7ifhuD8G4cUqCcOEwfd7zYnHNfZKjK7+yzZxAcFSdqv8Caq/W8 ml0/bLLglliHPLrY/5kmgAndjpKMGGw85SHDmQExucm8xmZb39S4zJZQOgpydJPa5rVf SLHuybWtYlNRUPgaqzEnD3ZeRvd7RbXPvkvmyuwoOI1mhKKkSap9SHWq3z9UcpxktVmw FjaMVtzYf/pQPrVvWu/+u/GQGeUMG/94TVP6ns7x5C+fMTadYSuVoMFQXkbAmABzMs/K SAcQC0vEAz5wAf1hjwZAKfszM/7WaW6Vk4AL0D97rdgQVBAw8kOJQpQp5ub3SuTJBuME GEYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=h5Rim9i4R2dtqePdDLpMCbY7rNwA6OH+nyEYI7LKahs=; b=Z/TI1kFw23llaBTzlzD0vSJGCAwNimTcu3jf/vr5tKHJeuWFtRuVHqmKx4XIrXH8u/ DCgWNje9nD/RlrKZkQdajQ1tqRdsd5/9rKsIiIm2iBmDG4gpZjKRPIfYCx5w9rUXtSRh NVk1XpdE8GwEkzbNsP6RDvzWWdxq+KikNIiSA6ShQzZYsKXC822WMBQe6RRkrGuMJVvF kCsh+z/bp5r6enpSEsOLoUlU1dDENxKrhzOkCLJgSFSn/pc+GSy8lgZ7J5qoyCwdyXmz VcDyQvlJ0G8kZDcDwhWcwqlJW393B+NYSSdgnPAPVcjL9j59V0eRIrAsq+6Uh7fX71SK ioKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=face39Zi; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si1852102edt.32.2019.10.03.10.45.18; Thu, 03 Oct 2019 10:45:44 -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=@gmail.com header.s=20161025 header.b=face39Zi; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730600AbfJCRZh (ORCPT + 99 others); Thu, 3 Oct 2019 13:25:37 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:36635 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390881AbfJCRVu (ORCPT ); Thu, 3 Oct 2019 13:21:50 -0400 Received: by mail-qt1-f195.google.com with SMTP id o12so4699988qtf.3; Thu, 03 Oct 2019 10:21:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h5Rim9i4R2dtqePdDLpMCbY7rNwA6OH+nyEYI7LKahs=; b=face39Zit5ry5Kv5MEk6wx4lT9nUPV/Qw7+B489XY4veUQ8Vg1354MpUcaarHInvO1 aEzb6pTQwv9J9IvU8iaZzbfOuYaNy9AWHG5qsRqVP2rR54qVMbGeueL2E/3PgqTc4MXR ERYhWFZjcnZZ/O7s7ZxeaayQozjcO04gBOE/16ykGd3/zHrsTlW8iQme/sniIEngN3iJ 03xPKJsMjHyvHH9hSqX25xoaOz2boH7cgLVicayHXn2As2h41G5rhsna0OLOKET9aJLB qSvFRZlxtr6FK0tcZQp0sH5NOthVXZtUhKxno5yWREXFDOzZpgs27BgDPFKAdTCJ1bIO jpSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h5Rim9i4R2dtqePdDLpMCbY7rNwA6OH+nyEYI7LKahs=; b=I4EpVSL9YNC+Lu7aJw9cSEOw36qC7eK7ZkKES5NcoXXjnXeyNKqUUKml1dtLwsHEtK IYYEBqMZGMSx4y9IR9jrhT8sxzj12ZtxaYxIzfldrJczoAKB4izga/LishtIiW2tlMp2 2w3RmI/LnFv/eV5bDd1Qh+lbc6tTQam6XIp5y4Ews41WAAQJ4lwaEYVVwL99hH3ayB21 ANrxuO6FNHy3NHY8lFM75YUz3HPLiANPtBGDMQX/7wMOCn6PyVIeEFwZMv7ooffcXPmp 8rOwY5kjEfIJRFVvzWeVsk4qMZhiLR+aQ3Wtle2s0h5ubX6jhbihycF87+chumURS/QJ kZKA== X-Gm-Message-State: APjAAAXg17UfeBrmBIhZAm6pUQIM1AcQ85PC45jWAlbAKCSukqrZB0nt ZSC0pmgDCd1UXZs8RBB/eTZfASEXc/nnj3jOjKFODxGSUbE= X-Received: by 2002:aed:2726:: with SMTP id n35mr10864628qtd.171.1570123309206; Thu, 03 Oct 2019 10:21:49 -0700 (PDT) MIME-Version: 1.0 References: <20191003014153.GA13156@paulmck-ThinkPad-P72> <20191003014310.13262-6-paulmck@kernel.org> In-Reply-To: <20191003014310.13262-6-paulmck@kernel.org> From: Andrii Nakryiko Date: Thu, 3 Oct 2019 10:21:38 -0700 Message-ID: Subject: Re: [PATCH tip/core/rcu 6/9] bpf/cgroup: Replace rcu_swap_protected() with rcu_replace() To: paulmck@kernel.org Cc: rcu@vger.kernel.org, open list , Ingo Molnar , jiangshanlai@gmail.com, dipankar@in.ibm.com, Andrew Morton , mathieu.desnoyers@efficios.com, josh@joshtriplett.org, Thomas Gleixner , Peter Ziljstra , Steven Rostedt , dhowells@redhat.com, Eric Dumazet , fweisbec@gmail.com, oleg@redhat.com, Joel Fernandes , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Networking , bpf Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 2, 2019 at 6:45 PM 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: Alexei Starovoitov > Cc: Daniel Borkmann > Cc: Martin KaFai Lau > Cc: Song Liu > Cc: Yonghong Song > Cc: > Cc: > --- Acked-by: Andrii Nakryiko > 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..06a0657 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(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 >