All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin KaFai Lau <kafai@fb.com>
To: Stanislav Fomichev <sdf@google.com>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, ast@kernel.org,
	daniel@iogearbox.net, andrii@kernel.org
Subject: Re: [PATCH bpf-next v2] bpf: move rcu lock management out of BPF_PROG_RUN routines
Date: Thu, 14 Apr 2022 13:23:45 -0700	[thread overview]
Message-ID: <20220414202345.kireigrz7jftmes4@kafai-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <20220414161233.170780-1-sdf@google.com>

On Thu, Apr 14, 2022 at 09:12:33AM -0700, Stanislav Fomichev wrote:
> Commit 7d08c2c91171 ("bpf: Refactor BPF_PROG_RUN_ARRAY family of macros
> into functions") switched a bunch of BPF_PROG_RUN macros to inline
> routines. This changed the semantic a bit. Due to arguments expansion
> of macros, it used to be:
> 
> 	rcu_read_lock();
> 	array = rcu_dereference(cgrp->bpf.effective[atype]);
> 	...
> 
> Now, with with inline routines, we have:
> 	array_rcu = rcu_dereference(cgrp->bpf.effective[atype]);
> 	/* array_rcu can be kfree'd here */
> 	rcu_read_lock();
> 	array = rcu_dereference(array_rcu);
> 
> I'm assuming in practice rcu subsystem isn't fast enough to trigger
> this but let's use rcu API properly.
> 
> Also, rename to lower caps to not confuse with macros. Additionally,
> drop and expand BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY.
> 
> See [1] for more context.
> 
>   [1] https://lore.kernel.org/bpf/CAKH8qBs60fOinFdxiiQikK_q0EcVxGvNTQoWvHLEUGbgcj1UYg@mail.gmail.com/T/#u
> 
> v2
> - keep rcu locks inside by passing cgroup_bpf
Acked-by: Martin KaFai Lau <kafai@fb.com>

  reply	other threads:[~2022-04-14 20:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 16:12 [PATCH bpf-next v2] bpf: move rcu lock management out of BPF_PROG_RUN routines Stanislav Fomichev
2022-04-14 20:23 ` Martin KaFai Lau [this message]
2022-04-16  1:28 ` Alexei Starovoitov
2022-04-18 16:50   ` sdf
2022-04-19  5:18     ` Alexei Starovoitov
2022-04-19 15:42       ` sdf
2022-04-19 16:20         ` Alexei Starovoitov
2022-04-19 16:32           ` Alexei Starovoitov
2022-04-19 16:35             ` Stanislav Fomichev
2022-04-19 16:48               ` Alexei Starovoitov
2022-04-19 17:01                 ` Stanislav Fomichev
2022-04-19 17:05                   ` Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220414202345.kireigrz7jftmes4@kafai-mbp.dhcp.thefacebook.com \
    --to=kafai@fb.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.