From: John Fastabend Date: Fri, 8 Sep 2017 21:01:10 +0000 (-0700) Subject: bpf: devmap, use cond_resched instead of cpu_relax X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=374fb014fc5b15e420faa00af036868a635eadd3;p=linux.git bpf: devmap, use cond_resched instead of cpu_relax Be a bit more friendly about waiting for flush bits to complete. Replace the cpu_relax() with a cond_resched(). Suggested-by: Daniel Borkmann Acked-by: Daniel Borkmann Signed-off-by: John Fastabend Acked-by: Alexei Starovoitov Signed-off-by: David S. Miller --- diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c index ecf9f99ecc579..959c9a07f318b 100644 --- a/kernel/bpf/devmap.c +++ b/kernel/bpf/devmap.c @@ -159,7 +159,7 @@ static void dev_map_free(struct bpf_map *map) unsigned long *bitmap = per_cpu_ptr(dtab->flush_needed, cpu); while (!bitmap_empty(bitmap, dtab->map.max_entries)) - cpu_relax(); + cond_resched(); } for (i = 0; i < dtab->map.max_entries; i++) {