Skip to contentSkip to conversation

Per-arg kfunc flags

LSF/MM/BPF TOPIC David Vernet 1 participant 1 message Jan 26, 2023 BPF

lore
Share & tools
lore
#0 lore raw

Hi all,

I would like to discuss how to enable per-arg kfunc flags.

As described in [0], kfunc flags are currently at the granularity of the entire kfunc. This means that, for example, only a single kfunc argument can be acquired (indicated by KF_ACQUIRE), released (indicated by KF_RELEASE), RCU-protected (KF_RCU), etc.

This hasn't really been a problem up to this point, though there are some per-arg annotations such as those described in [1], and patches here and there such as [2], which collectively indicate that it may be time to start aligning on what the design and implemention should look like (e.g. should we model the UX for defining kfuncs in a similar to way to helpers, go in a different direction, what blockers are there, etc).

[0]: https://docs.kernel.org/bpf/kfuncs.html#annotating-kfuncs
[1]: https://docs.kernel.org/bpf/kfuncs.html#annotating-kfunc-parameters
[2]: https://lore.kernel.org/bpf/[email protected]/

What do you all think?

Thanks,
David