aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2017-09-08 17:01:10 -0400
committerDavid S. Miller <davem@davemloft.net>2017-09-09 00:11:00 -0400
commit374fb014fc5b15e420faa00af036868a635eadd3 (patch)
tree0925d65fb3e7e0eec9f6d08f22086a861d294dac
parent5a67da2a71c64daeb456f6f3e87b5c7cecdc5ffa (diff)
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 <daniel@iogearbox.net> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--kernel/bpf/devmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
index ecf9f99ecc57..959c9a07f318 100644
--- a/kernel/bpf/devmap.c
+++ b/kernel/bpf/devmap.c
@@ -159,7 +159,7 @@ static void dev_map_free(struct bpf_map *map)
159 unsigned long *bitmap = per_cpu_ptr(dtab->flush_needed, cpu); 159 unsigned long *bitmap = per_cpu_ptr(dtab->flush_needed, cpu);
160 160
161 while (!bitmap_empty(bitmap, dtab->map.max_entries)) 161 while (!bitmap_empty(bitmap, dtab->map.max_entries))
162 cpu_relax(); 162 cond_resched();
163 } 163 }
164 164
165 for (i = 0; i < dtab->map.max_entries; i++) { 165 for (i = 0; i < dtab->map.max_entries; i++) {