Re: [PATCH bpf-next] bpf: Add a retry after refilling the free list when unit_alloc() fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Kumar,

On 25. 2. 13. 18:05, Kumar Kartikeya Dwivedi wrote:
On Thu, 13 Feb 2025 at 09:42, Changwoo Min <changwoo@xxxxxxxxxx> 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@xxxxxxxxxx> 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





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux