Skip to content

Commit 374fb01

Browse files
jrfastabdavem330
authored andcommitted
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>
1 parent 5a67da2 commit 374fb01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/devmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static void dev_map_free(struct bpf_map *map)
159159
unsigned long *bitmap = per_cpu_ptr(dtab->flush_needed, cpu);
160160

161161
while (!bitmap_empty(bitmap, dtab->map.max_entries))
162-
cpu_relax();
162+
cond_resched();
163163
}
164164

165165
for (i = 0; i < dtab->map.max_entries; i++) {

0 commit comments

Comments
 (0)