Skip to content

Commit

Permalink
test_bpf: add a schedule point
Browse files Browse the repository at this point in the history
test_bpf() is taking 1.6 seconds nowadays, it is time
to add a schedule point in it.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Eric Dumazet authored and Daniel Borkmann committed Feb 26, 2018
1 parent ca36960 commit d40bc96
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/test_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/if_vlan.h>
#include <linux/random.h>
#include <linux/highmem.h>
#include <linux/sched.h>

/* General test specific settings */
#define MAX_SUBTESTS 3
Expand Down Expand Up @@ -6582,6 +6583,7 @@ static __init int test_bpf(void)
struct bpf_prog *fp;
int err;

cond_resched();
if (exclude_test(i))
continue;

Expand Down

0 comments on commit d40bc96

Please sign in to comment.