[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAADnVQ+UJ5bhRNdnHM62_XFzMp3q1-Njh80ZNvs=4=PH1jAmpw@mail.gmail.com>
Date: Wed, 29 Sep 2021 14:17:01 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Lorenz Bauer <lmb@...udflare.com>
Cc: Björn Töpel <bjorn@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
kernel-team <kernel-team@...udflare.com>,
Network Development <netdev@...r.kernel.org>,
bpf <bpf@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf-next] bpf: do not invoke the XDP dispatcher for
PROG_RUN with single repeat
On Tue, Sep 28, 2021 at 2:31 AM Lorenz Bauer <lmb@...udflare.com> wrote:
>
> We have a unit test that invokes an XDP program with 1m different
> inputs, aka 1m BPF_PROG_RUN syscalls. We run this test concurrently
> with slight variations in how we generated the input.
>
> Since commit f23c4b3924d2 ("bpf: Start using the BPF dispatcher in BPF_TEST_RUN")
> the unit test has slowed down significantly. Digging deeper reveals that
> the concurrent tests are serialised in the kernel on the XDP dispatcher.
> This is a global resource that is protected by a mutex, on which we contend.
>
> Fix this by not calling into the XDP dispatcher if we only want to perform
> a single run of the BPF program.
>
> See: https://lore.kernel.org/bpf/CACAyw9_y4QumOW35qpgTbLsJ532uGq-kVW-VESJzGyiZkypnvw@mail.gmail.com/
>
> Signed-off-by: Lorenz Bauer <lmb@...udflare.com>
Applied. Thanks
Powered by blists - more mailing lists