Re: [PATCH bpf-next v6 3/8] bpf: Allow per unit prefill for non-fix-size percpu memory allocator

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

 




On 1/3/24 9:21 PM, Alexei Starovoitov wrote:
On Thu, Dec 21, 2023 at 7:18 PM Yonghong Song <yonghong.song@xxxxxxxxx> wrote:

Later on, Commit 1fda5bb66ad8 ("bpf: Do not allocate percpu memory
at init stage") moved the non-fix-size percpu memory allocation
to bpf verificaiton stage.
Only noticed after already applying and didn't want to force push
to fix it up.
But in the future please do not break commit one-liner into
multiple lines. Commit should be lower case as well.

Sorry about the format issue. Will pay attention to this next time
and as you suggested, will run spellcheck as well.


spellcheck is a good idea as well.

+
+       for_each_possible_cpu(cpu) {
+               cc = per_cpu_ptr(pcc, cpu);
+               c = &cc->cache[i];
+               if (cpu == 0 && c->unit_size)
+                       break;
I think this part ensures that repeated
bpf_percpu_obj_new() in a bpf prog don't keep prefilling,
right?
I think it works, but cpu == 0 part is confusing.
It will work with just: if (c->unit_size) break;
right?

You are right. cpu == 0 is a leftover from one of
previous revisions and should be removed. Will send
a followup to remove it.


+
+               c->unit_size = unit_size;
+               c->objcg = objcg;
+               c->percpu_size = percpu_size;
+               c->tgt = c;
+
+               init_refill_work(c);
+               prefill_mem_cache(c, cpu);
+       }
+
+       return 0;
+}




[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