Re: [PATCH bpf-next v6 5/8] bpf: Use smaller low/high marks for percpu allocation

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

 




On 12/22/2023 11:17 AM, Yonghong Song wrote:
> Currently, refill low/high marks are set with the assumption
> of normal non-percpu memory allocation. For example, for
> an allocation size 256, for non-percpu memory allocation,
> low mark is 32 and high mark is 96, resulting in the
> batch allocation of 48 elements and the allocated memory
> will be 48 * 256 = 12KB for this particular cpu.
> Assuming an 128-cpu system, the total memory consumption
> across all cpus will be 12K * 128 = 1.5MB memory.
>
> This might be okay for non-percpu allocation, but may not be
> good for percpu allocation, which will consume 1.5MB * 128 = 192MB
> memory in the worst case if every cpu has a chance of memory
> allocation.
>
> In practice, percpu allocation is very rare compared to
> non-percpu allocation. So let us have smaller low/high marks
> which can avoid unnecessary memory consumption.
>
> Signed-off-by: Yonghong Song <yonghong.song@xxxxxxxxx>

Acked-by: Hou Tao <houtao1@xxxxxxxxxx>





[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