From: Changwoo Min <changwoo@igalia.com>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: Song Liu <song@kernel.org>,
ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
martin.lau@linux.dev, eddyz87@gmail.com, yonghong.song@linux.dev,
john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me,
haoluo@google.com, jolsa@kernel.org, tj@kernel.org,
arighi@nvidia.com, kernel-dev@igalia.com, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next] bpf: Add a retry after refilling the free list when unit_alloc() fails
Date: Thu, 13 Feb 2025 19:11:47 +0900 [thread overview]
Message-ID: <90eda54b-6898-40bb-adbb-409404ad185f@igalia.com> (raw)
In-Reply-To: <CAP01T77mcUi4h_dT6QfEPg_xeUGhsegcV+NCqpQSY-VtxuLV4A@mail.gmail.com>
Hello Kumar,
On 25. 2. 13. 18:05, Kumar Kartikeya Dwivedi wrote:
> On Thu, 13 Feb 2025 at 09:42, Changwoo Min <changwoo@igalia.com> wrote:
>>
>> Hello Song,
>>
>> Thank you for the review!
>>
>> On 25. 2. 13. 03:33, Song Liu wrote:
>>> On Wed, Feb 12, 2025 at 12:49 AM Changwoo Min <changwoo@igalia.com> wrote:
>>>>
>>>> When there is no entry in the free list (c->free_llist), unit_alloc()
>>>> fails even when there is available memory in the system, causing allocation
>>>> failure in various BPF calls -- such as bpf_mem_alloc() and
>>>> bpf_cpumask_create().
>>>>
>>>> Such allocation failure can happen, especially when a BPF program tries many
>>>> allocations -- more than a delta between high and low watermarks -- in an
>>>> IRQ-disabled context.
>>>
>>> Can we add a selftests for this scenario?
>>
>> It would be a bit tricky to create an IRQ-disabled case in a BPF
>> program. However, I think it will be possible to reproduce the
>> allocation failure issue when allocating sufficiently enough
>> small allocations.
>
> You can also make use of recently introduced
> bpf_local_irq_{save,restore} in the selftest.
Thank you for the suggestion. I will try it out.
Regards,
Changwoo Min
next prev parent reply other threads:[~2025-02-13 10:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 8:48 [PATCH bpf-next] bpf: Add a retry after refilling the free list when unit_alloc() fails Changwoo Min
2025-02-12 18:33 ` Song Liu
2025-02-13 8:41 ` Changwoo Min
2025-02-13 9:05 ` Kumar Kartikeya Dwivedi
2025-02-13 10:11 ` Changwoo Min [this message]
2025-02-13 17:45 ` Alexei Starovoitov
2025-02-14 9:23 ` Changwoo Min
2025-02-15 3:51 ` Alexei Starovoitov
2025-02-15 15:16 ` Changwoo Min
2025-02-16 16:04 ` Changwoo Min
2025-02-17 2:19 ` Hou Tao
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=90eda54b-6898-40bb-adbb-409404ad185f@igalia.com \
--to=changwoo@igalia.com \
--cc=andrii@kernel.org \
--cc=arighi@nvidia.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kernel-dev@igalia.com \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=tj@kernel.org \
--cc=yonghong.song@linux.dev \
/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