diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-11-04 11:10:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-04 15:27:08 -0500 |
commit | cc0ac1999589c9f713550adde85a09b0dbb75d86 (patch) | |
tree | 8d2abcf4fdee4db65750cccafddaba5f1a05ef2d /lib | |
parent | cea80ea8d2a4c646f240a8fd6ece5c8e7bc969d3 (diff) |
lib: crc32: conditionally resched when running testcases
Fengguang reports that when crc32 selftests are running on startup, on
some e.g. 32bit systems, we can get a CPU stall like "INFO: rcu_sched
self-detected stall on CPU { 0} (t=2101 jiffies g=4294967081 c=4294967080
q=41)". As this is not intended, add a cond_resched() at the end of a
test case to fix it. Introduced by efba721f63 ("lib: crc32: add test cases
for crc32{, c}_combine routines").
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/crc32.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/crc32.c b/lib/crc32.c index 69dd124f0cfc..3a1dfa84203c 100644 --- a/lib/crc32.c +++ b/lib/crc32.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/crc32.h> | 29 | #include <linux/crc32.h> |
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/types.h> | 31 | #include <linux/types.h> |
32 | #include <linux/sched.h> | ||
32 | #include "crc32defs.h" | 33 | #include "crc32defs.h" |
33 | 34 | ||
34 | #if CRC_LE_BITS > 8 | 35 | #if CRC_LE_BITS > 8 |
@@ -1054,6 +1055,7 @@ static int __init crc32c_combine_test(void) | |||
1054 | crc_full == test[i].crc32c_le)) | 1055 | crc_full == test[i].crc32c_le)) |
1055 | errors++; | 1056 | errors++; |
1056 | runs++; | 1057 | runs++; |
1058 | cond_resched(); | ||
1057 | } | 1059 | } |
1058 | } | 1060 | } |
1059 | 1061 | ||
@@ -1147,6 +1149,7 @@ static int __init crc32_combine_test(void) | |||
1147 | crc_full == test[i].crc_le)) | 1149 | crc_full == test[i].crc_le)) |
1148 | errors++; | 1150 | errors++; |
1149 | runs++; | 1151 | runs++; |
1152 | cond_resched(); | ||
1150 | } | 1153 | } |
1151 | } | 1154 | } |
1152 | 1155 | ||