Re: [PATCH bpf 1/2] bpf: Zero-fill other CPUs when BPF_F_CPU creates a per-cpu hash element

From: Donggeun Yoo

Date: Sun Sep 20 2026 - 06:30:18 EST


On Sun, 20 Sep 2026 10:19:00 +0000 (UTC), bot+bpf-ci@xxxxxxxxxx wrote:
> Does the block comment above this condition need updating? It says the value
> goes to the "current one" and explains the whole branch with "onallcpus=false
> always when coming from bpf prog."
[...]
> Could the comment be updated to cover both entry conditions?

Yes, it should. What is there stays correct for the !onallcpus arm, where the
value does go to the current cpu and the reason is the one given, so v2 adds
the second arm rather than rewording the first:

/* When not setting the initial value on all cpus, zero-fill element
* values for other cpus. Otherwise, bpf program has no way to ensure
* known initial values for cpus other than current one
* (onallcpus=false always when coming from bpf prog). A BPF_F_CPU
* update also sets a single cpu, and the element may be recycled, so
* the other cpus must not keep what the previous key left there.
*/

Thanks,
Donggeun