 
            On 2025/10/22 19:33, Jiayuan Chen wrote:
This path introduces several kfuncs to help BPF programs determine their current execution context. When hooking functions for statistics, we often need to use current->comm to get the process name.
However, these hooked functions can be called from either process context or interrupt context. When called from interrupt context, the current we obtain may refer to the process that was interrupted, which may not be what we need.
These new kfuncs expose APIs that allow users to determine the actual execution context.
Hi Jiayuan,
Rather than introducing multiple kfuncs to determine the current execution context, this can already be achieved by using the 'bpf_this_cpu_ptr()' helper to read the underlying preemption count.
Please refer to my earlier patch, "selftests/bpf: Introduce experimental bpf_in_interrupt()"[1], which demonstrates this approach.
Links: [1] https://lore.kernel.org/bpf/20250903140438.59517-1-leon.hwang@linux.dev/
Thanks, Leon
[...]