]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: add schedule points in percpu arrays management
authorEric Dumazet <edumazet@google.com>
Thu, 22 Feb 2018 16:33:24 +0000 (08:33 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 22 Feb 2018 20:27:06 +0000 (21:27 +0100)
commitae33e9f031daaa1dc6e05a4f17c0d389397213e4
tree35ee0de8ea4ebaea6511622d12bbe177f5ed45e1
parent8c14be05de5021de8b148e0385bd75036eba10b3
bpf: add schedule points in percpu arrays management

syszbot managed to trigger RCU detected stalls in
bpf_array_free_percpu()

It takes time to allocate a huge percpu map, but even more time to free
it.

Since we run in process context, use cond_resched() to yield cpu if
needed.

Fixes: 787ec2838b4a ("bpf: introduce BPF_MAP_TYPE_PERCPU_ARRAY map")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/arraymap.c