All of lore.kernel.org
 help / color / mirror / Atom feed
From: KP Singh <kpsingh@kernel.org>
To: Alexei Starovoitov <ast@fb.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH v3 bpf-next 7/8] bpf: Allows per-cpu maps and map-in-map in sleepable programs
Date: Wed, 10 Feb 2021 00:22:20 +0100	[thread overview]
Message-ID: <CACYkzJ6Cda4QR8m8QJ_SZ0rx0hj3LQahrz4cwiNuPC9PVRhyFQ@mail.gmail.com> (raw)
In-Reply-To: <61dffef3-ab23-8d9b-70da-3e84caa84fe3@fb.com>

On Wed, Feb 10, 2021 at 12:14 AM Alexei Starovoitov <ast@fb.com> wrote:
>
> On 2/9/21 2:43 PM, KP Singh wrote:
> > On Tue, Feb 9, 2021 at 11:32 PM Alexei Starovoitov <ast@fb.com> wrote:
> >>
> >> On 2/9/21 1:12 PM, KP Singh wrote:
> >>> On Tue, Feb 9, 2021 at 9:57 PM Alexei Starovoitov
> >>> <alexei.starovoitov@gmail.com> wrote:
> >>>>
> >>>> From: Alexei Starovoitov <ast@kernel.org>
> >>>>
> >>>> Since sleepable programs are now executing under migrate_disable
> >>>> the per-cpu maps are safe to use.
> >>>> The map-in-map were ok to use in sleepable from the time sleepable
> >>>> progs were introduced.
> >>>>
> >>>> Note that non-preallocated maps are still not safe, since there is
> >>>> no rcu_read_lock yet in sleepable programs and dynamically allocated
> >>>> map elements are relying on rcu protection. The sleepable programs
> >>>> have rcu_read_lock_trace instead. That limitation will be addresses
> >>>> in the future.
> >>>>
> >>>> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
> >>>> Acked-by: Andrii Nakryiko <andrii@kernel.org>
> >>>
> >>> Acked-by: KP Singh <kpsingh@kernel.org>
> >>>
> >>> Thanks! I actually tested out some of our logic which uses per-cpu maps by
> >>> switching the programs to their sleepable counterparts
> >>
> >> You mean after applying this set, right?
> >> migrate_disable is the key.
> >> It will be difficult to backport to your kernels though.
> >> The bpf change to enable per-cpu is easy, but backporting
> >> sched support is a different game.
> >>
> >
> > Yes after applying the whole set.
> >
> > Also, I think I also got it to work on 5.10 by (I am little less sure
> > of this one though)
> >
> > -  Backporting https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=12fa97c64dce2f3c2e6eed5dc618bb9046e40bf0
> > -  Backporting https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=74d862b682f51e45d25b95b1ecf212428a4967b0
> > - And, backporting this set (I initially missed
> > https://lore.kernel.org/bpf/20210209194856.24269-3-alexei.starovoitov@gmail.com
> > where you add the
> >    calls and ran into issues).
>
> and the whole machinery that it depends on.

 https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=12fa97c64dce2f3c2e6eed5dc618bb9046e40bf0
and https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=74d862b682f51e45d25b95b1ecf212428a4967b0
is the machinery I could find between 5.10 and now. But the backport
is not really relevant here, I just mentioned it to clarify that I was
testing the series more than just applying this single patch :)

  reply	other threads:[~2021-02-09 23:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 19:48 [PATCH v3 bpf-next 0/8] bpf: Misc improvements Alexei Starovoitov
2021-02-09 19:48 ` [PATCH v3 bpf-next 1/8] bpf: Optimize program stats Alexei Starovoitov
2021-02-09 19:48 ` [PATCH v3 bpf-next 2/8] bpf: Compute program stats for sleepable programs Alexei Starovoitov
2021-02-09 22:47   ` KP Singh
2021-02-09 23:11     ` Alexei Starovoitov
2021-02-09 23:17       ` KP Singh
2021-02-09 19:48 ` [PATCH v3 bpf-next 3/8] bpf: Add per-program recursion prevention mechanism Alexei Starovoitov
2021-02-09 19:48 ` [PATCH v3 bpf-next 4/8] selftest/bpf: Add a recursion test Alexei Starovoitov
2021-02-09 19:48 ` [PATCH v3 bpf-next 5/8] bpf: Count the number of times recursion was prevented Alexei Starovoitov
2021-02-09 19:48 ` [PATCH v3 bpf-next 6/8] selftests/bpf: Improve recursion selftest Alexei Starovoitov
2021-02-09 19:48 ` [PATCH v3 bpf-next 7/8] bpf: Allows per-cpu maps and map-in-map in sleepable programs Alexei Starovoitov
2021-02-09 21:12   ` KP Singh
2021-02-09 22:31     ` Alexei Starovoitov
2021-02-09 22:43       ` KP Singh
2021-02-09 23:13         ` Alexei Starovoitov
2021-02-09 23:22           ` KP Singh [this message]
2021-02-09 19:48 ` [PATCH v3 bpf-next 8/8] selftests/bpf: Add a test for map-in-map and per-cpu maps in sleepable progs Alexei Starovoitov
2021-02-09 21:14   ` KP Singh

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=CACYkzJ6Cda4QR8m8QJ_SZ0rx0hj3LQahrz4cwiNuPC9PVRhyFQ@mail.gmail.com \
    --to=kpsingh@kernel.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=kernel-team@fb.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.