Thread (9 messages) flat view 9 messages, 2 authors, 2021-10-19

Re: [PATCH] bpf: use count for prealloc hashtab too

From: Alexei Starovoitov <hidden>
Date: 2021-10-15 19:58:56
Also in: bpf, lkml

On Fri, Oct 15, 2021 at 11:04 AM Chengming Zhou
[off-list ref] wrote:
We only use count for kmalloc hashtab not for prealloc hashtab, because
__pcpu_freelist_pop() return NULL when no more elem in pcpu freelist.

But the problem is that __pcpu_freelist_pop() will traverse all CPUs and
spin_lock for all CPUs to find there is no more elem at last.

We encountered bad case on big system with 96 CPUs that alloc_htab_elem()
would last for 1ms. This patch use count for prealloc hashtab too,
avoid traverse and spin_lock for all CPUs in this case.

Signed-off-by: Chengming Zhou <redacted>
It's not clear from the commit log what you're solving.
The atomic inc/dec in critical path of prealloc maps hurts performance.
That's why it's not used.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help