[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAADnVQJXbyB2LR=P9yzTR_OLQjOoCNh7QirQ5st8g7KJKAa6YQ@mail.gmail.com>
Date: Mon, 10 May 2021 17:55:59 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Lorenz Bauer <lmb@...udflare.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
kernel-team <kernel-team@...udflare.com>,
Network Development <netdev@...r.kernel.org>,
bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH bpf-next 0/3] Reduce kmalloc / kfree churn in the verifier
On Thu, Apr 29, 2021 at 6:47 AM Lorenz Bauer <lmb@...udflare.com> wrote:
>
> github.com/cilium/ebpf runs integration tests with libbpf in a vm on CI.
> I recently did some work to increase the code coverage from that, and
> started experiencing OOM-kills in the VM. That led me down a rabbit
> hole looking at verifier memory allocation patterns. I didn't figure out
> what triggered the OOM-kills but refactored some often called memory
> allocation code.
>
> The key insight is that often times we don't need to do a full kfree /
> kmalloc, but can instead just reallocate. The first patch adds two helpers
> which do just that for the use cases in the verifier, which are sufficiently
> different that they can't use stock krealloc_array and friends.
>
> The series makes bpf_verif_scale about 10% faster in my VM set up, which
> is especially noticeable when running with KASAN enabled.
The series looks great. Applied to bpf-next.
Powered by blists - more mailing lists