Re: [PATCH v2 bpf-next 20/20] selftests/bpf: Convert simple page_frag allocator to per-cpu.

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

 



On Fri, 9 Feb 2024 at 05:07, Alexei Starovoitov
<alexei.starovoitov@xxxxxxxxx> wrote:
>
> From: Alexei Starovoitov <ast@xxxxxxxxxx>
>
> Convert simple page_frag allocator to per-cpu page_frag to further stress test
> a combination of __arena global and static variables and alloc/free from arena.
>
> Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>
> ---

I know this organically grew from a toy implementation, but since
people will most likely be looking at selftests as usage examples, it
might be better to expose bpf_preempt_disable/enable and use it in the
case of per-CPU page_frag allocator? No need to block on this, can be
added on top later.

The kfunc is useful on its own for writing safe per-CPU data
structures or other memory allocators like bpf_ma on top of arenas.
It is also necessary as a building block for writing spin locks
natively in BPF on top of the arena map which we may add later.
I have a patch lying around for this, verifier plumbing is mostly the
same as rcu_read_lock.
I can send it out with tests, or otherwise if you want to add it to
this series, you go ahead.

>  [...]
>




[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