bpf: add schedule point in htab_init_buckets()
Subsystems (3)
PATCH 1/1 bpf: add schedule point in htab_init_buckets()
From: Eric Dumazet <[email protected]>
We noticed that with a LOCKDEP enabled kernel,
allocating a hash table with 65536 buckets would
use more than 60ms.
htab_init_buckets() runs from process context,
it is safe to schedule to avoid latency spikes.
--- kernel/bpf/hashtab.c | 1 + 1 file changed, 1 insertion(+)
kernel/bpf/hashtab.c +1 -0
@@ -152,6 +152,7 @@ static void htab_init_buckets(struct bpf_htab *htab)lockdep_set_class (&htab->buckets[i].lock, &htab->lockdep_key); } +cond_resched (); } }
Signature · 1 line
2.29.2.729.g45daf8777d-goog
Quoted 10 lines · Eric Dumazet
From: Eric Dumazet <[email protected]>
We noticed that with a LOCKDEP enabled kernel,
allocating a hash table with 65536 buckets would
use more than 60ms.
Quoted 7 lines
htab_init_buckets()runs from process context,
it is safe to schedule to avoid latency spikes.Fixes c50eb518e262 ("bpf: Use separate lockdep class for each hashtab")Signed-off-by Eric Dumazet <[email protected]>Reported-By John Sperbeck <[email protected]>Cc Song Liu <[email protected]>
Thanks for the fix!
Quoted 19 lines
---
kernel/bpf/hashtab.c| 1 +1 file changed, 1 insertion(+)kernel/bpf/hashtab.c +1
-0@@ -152,6 +152,7 @@ static void htab_init_buckets(struct bpf_htab *htab)lockdep_set_class (&htab->buckets[i].lock, &htab->lockdep_key); } +cond_resched (); } }Signature · 1 line
2.29.2.729.g45daf8777d-goog
This patch was applied to bpf/bpf.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf.git (refs/heads/master):
Quoted 10 lines · On Mon, 21 Dec 2020 11:25:06 -0800 you wrote:
From: Eric Dumazet <[email protected]>
We noticed that with a LOCKDEP enabled kernel, allocating a hash table with 65536 buckets would use more than 60ms.
htab_init_buckets()runs from process context, it is safe to schedule to avoid latency spikes.[...]
Here is the summary with links:
- [bpf] bpf: add schedule point in htab_init_buckets()
https://git.kernel.org/bpf/bpf/c/e7e518053c26
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html