Re: [PATCH bpf 1/2] bpf/memalloc: Non-atomically allocate freelist during prefill

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

 



Hi,

On 7/27/2023 2:44 AM, YiFei Zhu wrote:
> On Wed, Jul 26, 2023 at 4:38 AM Hou Tao <houtao@xxxxxxxxxxxxxxx> wrote:
>> Hi,
>>
>> On 7/21/2023 10:31 AM, YiFei Zhu wrote:
>>> On Thu, Jul 20, 2023 at 6:45 PM Hou Tao <houtao@xxxxxxxxxxxxxxx> wrote:
>>>> On 7/21/2023 4:44 AM, YiFei Zhu wrote:
>>>>> Sometimes during prefill all precpu chunks are full and atomic
>>>>> __alloc_percpu_gfp would not allocate new chunks. This will cause
>>>>> -ENOMEM immediately upon next unit_alloc.
>>>>>
>>>>> Prefill phase does not actually run in atomic context, so we can
>>>>> use this fact to allocate non-atomically with GFP_KERNEL instead
>>>>> of GFP_NOWAIT. This avoids the immediate -ENOMEM. Unfortunately
>>>>> unit_alloc runs in atomic context, even from map item allocation in
>>>>> syscalls, due to rcu_read_lock, so we can't do non-atomic
>>>>> workarounds in unit_alloc.
>>>>>
>>>>> Fixes: 4ab67149f3c6 ("bpf: Add percpu allocation support to bpf_mem_alloc.")
>>>>> Signed-off-by: YiFei Zhu <zhuyifei@xxxxxxxxxx>
>>>> Make sense to me, so
>>>>
>>>> Acked-by: Hou Tao <houtao1@xxxxxxxxxx>
>>>>
>>>> But I don't know whether or not it is suitable for bpf tree.
>>> I don't mind either way :) If changing to bpf-next requires a resend I
>>> can do that too.
>> Please resend and rebase the patch again bpf-next tree.
>>
> Will do. Should I drop the Fixes tag then?

Before the introduction of bpf memory allocator, the allocation flag for
per-cpu memory allocation in hash map is GFP_NOWAIT. BPF memory
allocator doesn't change that, so I think we could drop the Fixes tag.
>
> YiFei Zhu
>
> .





[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