Re: [PATCH bpf-next] bpf: Use separate RCU callbacks for freeing selem

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

 



On 3/3/23 9:45 AM, Kumar Kartikeya Dwivedi wrote:
On Fri, 3 Mar 2023 at 16:40, Martin KaFai Lau <martin.lau@xxxxxxxxx> wrote:

On 3/3/23 6:15 AM, Kumar Kartikeya Dwivedi wrote:
Martin suggested that instead of using a byte in the hole (which he has
a use for in his future patch) in bpf_local_storage_elem, we can
dispatch a different call_rcu callback based on whether we need to free
special fields in bpf_local_storage_elem data. The free path, described
in commit 9db44fdd8105 ("bpf: Support kptrs in local storage maps"),
only waits for call_rcu callbacks when there are special (kptrs, etc.)
fields in the map value, hence it is necessary that we only access
smap in this case.

Therefore, dispatch different RCU callbacks based on the BPF map has a
valid btf_record, which dereference and use smap's btf_record only when
it is valid.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx>

Thanks for your patch. I have already made a similar change in my local branch
which has some differences like refactored it a little for my work. The set is
almost ready. Do you mind if I include your patch in my set and keep your SOB?


No problem, please do.

Please ignore my previous message. I will make some adjustments on my set.

Applied with some changes on de-referencing SDATA(selem)->smap to address these warnings:

# this is addressed by rcu_dereference_protected(..., true)
../kernel/bpf/bpf_local_storage.c:117:41: warning: dereference of noderef expression

# this is addressed by directly using the earlier dereferenced smap pointer
../kernel/bpf/bpf_local_storage.c:200:27: warning: dereference of noderef expression





[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