Re: [PATCH bpf 1/2] bpf: Zero-fill other CPUs when BPF_F_CPU creates a per-cpu hash element
From: Alexei Starovoitov
Date: Sun Sep 20 2026 - 12:21:57 EST
On Sun, Sep 20, 2026 at 06:31 PM Donggeun Yoo <donggeunyoo.kernel@xxxxxxxxx> wrote:
> Fixes: c6936161fd55 ("bpf: Add BPF_F_CPU and BPF_F_ALL_CPUS flags support for percpu_hash and lru_percpu_hash maps")
> Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@xxxxxxxxx>
Pls cc Leon on respin.
[...]
> @@ -1056,12 +1056,12 @@ static void pcpu_init_value(struct bpf_htab *htab, void __percpu *pptr,
> * known initial values for cpus other than current one
> * (onallcpus=false always when coming from bpf prog).
> */
> - if (!onallcpus) {
> - int current_cpu = raw_smp_processor_id();
> + if (!onallcpus || (map_flags & BPF_F_CPU)) {
> + int init_cpu = onallcpus ? map_flags >> 32 : raw_smp_processor_id();
The comment above covers only the bpf prog case now.
Pls update it, but one short sentence about BPF_F_CPU is enough.
What you proposed in reply to the bot is too verbose.
pw-bot: cr