BPF List
 help / color / mirror / Atom feed
From: Delyan Kratunov <delyank@fb.com>
To: "daniel@iogearbox.net" <daniel@iogearbox.net>,
	"ast@kernel.org" <ast@kernel.org>,
	"andrii@kernel.org" <andrii@kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v3 2/5] bpf: implement sleepable uprobes by chaining gps
Date: Fri, 13 May 2022 17:05:21 +0000	[thread overview]
Message-ID: <d902c2267ffbf744a455ead43c2766ff39ca38fa.camel@fb.com> (raw)
In-Reply-To: <861a77c8-80dc-7360-d7a6-d8eabc84461b@iogearbox.net>

On Fri, 2022-05-13 at 18:00 +0200, Daniel Borkmann wrote:
> On 5/13/22 3:22 AM, Delyan Kratunov wrote:
> [...]
> >   struct bpf_prog_array *bpf_prog_array_alloc(u32 prog_cnt, gfp_t flags);
> >   void bpf_prog_array_free(struct bpf_prog_array *progs);
> > +/* Use when traversal over the bpf_prog_array uses tasks_trace rcu */
> > +void bpf_prog_array_free_sleepable(struct bpf_prog_array *progs);
> >   int bpf_prog_array_length(struct bpf_prog_array *progs);
> >   bool bpf_prog_array_is_empty(struct bpf_prog_array *array);
> >   int bpf_prog_array_copy_to_user(struct bpf_prog_array *progs,
> > @@ -1451,6 +1454,56 @@ bpf_prog_run_array(const struct bpf_prog_array *array,
> >   	return ret;
> >   }
> >   
> > +/**
> > + * Notes on RCU design for bpf_prog_arrays containing sleepable programs:
> > + *
> > + * We use the tasks_trace rcu flavor read section to protect the bpf_prog_array
> > + * overall. As a result, we must use the bpf_prog_array_free_sleepable
> > + * in order to use the tasks_trace rcu grace period.
> > + *
> > + * When a non-sleepable program is inside the array, we take the rcu read
> > + * section and disable preemption for that program alone, so it can access
> > + * rcu-protected dynamically sized maps.
> > + */
> 
> Btw, there are a number of kdoc warnings around your series, pls make sure to
> fix or use 'regular' comment:
> 
> https://patchwork.hopto.org/static/nipa/641204/12848281/kdoc/stderr 
> https://patchwork.hopto.org/static/nipa/641204/12848282/kdoc/stderr 

Yeah, I just saw these too, I'll take care of them before the next reroll. Let's see
if there's any other high level comments first.

-- Delyan

  reply	other threads:[~2022-05-13 17:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13  1:22 [PATCH bpf-next v3 0/5] sleepable uprobe support Delyan Kratunov
2022-05-13  1:22 ` [PATCH bpf-next v3 3/5] bpf: allow sleepable uprobe programs to attach Delyan Kratunov
2022-05-13  1:22 ` [PATCH bpf-next v3 1/5] bpf: move bpf_prog to bpf.h Delyan Kratunov
2022-05-13  1:22 ` [PATCH bpf-next v3 4/5] libbpf: add support for sleepable uprobe programs Delyan Kratunov
2022-05-13  1:22 ` [PATCH bpf-next v3 2/5] bpf: implement sleepable uprobes by chaining gps Delyan Kratunov
2022-05-13 16:00   ` Daniel Borkmann
2022-05-13 17:05     ` Delyan Kratunov [this message]
2022-05-13  1:22 ` [PATCH bpf-next v3 5/5] selftests/bpf: add tests for sleepable (uk)probes Delyan Kratunov

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=d902c2267ffbf744a455ead43c2766ff39ca38fa.camel@fb.com \
    --to=delyank@fb.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox