Re: [RFC PATCH bpf-next 2/3] bpf: Implement bpf mem allocator dtor for hash map

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

 



Hi,

On 6/5/2025 1:55 AM, Alexei Starovoitov wrote:
> On Mon, Jun 2, 2025 at 9:01 PM Hou Tao <houtao@xxxxxxxxxxxxxxx> wrote:
>>>> Maybe adding a
>>>> bit flag to the pointer of the element to indicate that it has been
>>>> destroyed is OK ? Will try it in the next revision.
>>> Not sure what you have in mind.
>> Er. I was just wondering that if it is possible to the bit 0 of the
>> element pointer to indicate that the element has been destroyed,
>> therefore, the second invocation of dtor can be avoided.
> but the element was deleted from htab bucket,
> so what pointer will you tag with extra bit?

Sorry for the late reply. Had a lot of work recently. I was thinking
that when the pointer has been freed through bpf_mem_cache_free(), the
pointer would be tracked in llist_node. It would be possible to reuse
the bit 0 of ->first and ->next of the lockless list to indicate whether
the pointed pointer has already been destroyed or not.  After the second
thought, that would need to duplicate each lockless list API and may not
worth it.





[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