Skip to content

Commit

Permalink
lib: crc32: conditionally resched when running testcases
Browse files Browse the repository at this point in the history
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 efba721 ("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>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Nov 4, 2013
1 parent cea80ea commit cc0ac19
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/crc32.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/sched.h>
#include "crc32defs.h"

#if CRC_LE_BITS > 8
Expand Down Expand Up @@ -1054,6 +1055,7 @@ static int __init crc32c_combine_test(void)
crc_full == test[i].crc32c_le))
errors++;
runs++;
cond_resched();
}
}

Expand Down Expand Up @@ -1147,6 +1149,7 @@ static int __init crc32_combine_test(void)
crc_full == test[i].crc_le))
errors++;
runs++;
cond_resched();
}
}

Expand Down

0 comments on commit cc0ac19

Please sign in to comment.