[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzaBuktutCZr2ZUC6b-XK_JJ7prWZmO-5Yew2tVp5DxbBA@mail.gmail.com>
Date: Thu, 3 Oct 2019 10:21:38 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: paulmck@...nel.org
Cc: rcu@...r.kernel.org, open list <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>, jiangshanlai@...il.com,
dipankar@...ibm.com, Andrew Morton <akpm@...ux-foundation.org>,
mathieu.desnoyers@...icios.com, josh@...htriplett.org,
Thomas Gleixner <tglx@...utronix.de>,
Peter Ziljstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>, dhowells@...hat.com,
Eric Dumazet <edumazet@...gle.com>, fweisbec@...il.com,
oleg@...hat.com, Joel Fernandes <joel@...lfernandes.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH tip/core/rcu 6/9] bpf/cgroup: Replace rcu_swap_protected()
with rcu_replace()
On Wed, Oct 2, 2019 at 6:45 PM <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: Alexei Starovoitov <ast@...nel.org>
> Cc: Daniel Borkmann <daniel@...earbox.net>
> Cc: Martin KaFai Lau <kafai@...com>
> Cc: Song Liu <songliubraving@...com>
> Cc: Yonghong Song <yhs@...com>
> Cc: <netdev@...r.kernel.org>
> Cc: <bpf@...r.kernel.org>
> ---
Acked-by: Andrii Nakryiko <andriin@...com>
> 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
>
Powered by blists - more mailing lists