bpf: devmap, use cond_resched instead of cpu_relax
authorJohn Fastabend <john.fastabend@gmail.com>
Fri, 8 Sep 2017 21:01:10 +0000 (14:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 Sep 2017 04:11:00 +0000 (21:11 -0700)
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>
kernel/bpf/devmap.c

index ecf9f99ecc579e315f4651032a8b39415d5b4d81..959c9a07f318b14f6ab4719973f6010de061aadc 100644 (file)
@@ -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++) {