Blob Blame History Raw
From: Eric Dumazet <edumazet@google.com>
Date: Mon, 26 Feb 2018 10:52:46 -0800
Subject: test_bpf: add a schedule point
Patch-mainline: v4.16-rc5
Git-commit: d40bc96257fe070796c63934913f95cc183016b0
References: bsc#1109837

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>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 lib/test_bpf.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -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
@@ -6582,6 +6583,7 @@ static __init int test_bpf(void)
 		struct bpf_prog *fp;
 		int err;
 
+		cond_resched();
 		if (exclude_test(i))
 			continue;