diff options
author | Tony Luck <tony.luck@intel.com> | 2022-05-11 09:14:05 -0700 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2022-05-11 09:14:05 -0700 |
commit | 4fd699e132f4d4b743ac9980d43ddee649829c77 (patch) | |
tree | bfc67707fb96539febf313b9fcfcc50c3fad5dde | |
parent | 596cddca9d4328d548ca6673ded2732b65665b57 (diff) | |
download | ras-tools-4fd699e132f4d4b743ac9980d43ddee649829c77.tar.gz |
einj_mem_uc: Wait longer for patrol scrub CMCI
It may take up to 20 seconds for the patrol scrubber to restart
and scan to the specific location where the error was injected.
Add a flag to indicate that the test should wait for much longer
to check for patrol scrub CMCI.
Also change the message to print the actual delay in units of
seconds, not microseconds (since the values are large enough
that this is a more human readable format).
Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r-- | einj_mem_uc.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/einj_mem_uc.c b/einj_mem_uc.c index e62f1f5..a48357d 100644 --- a/einj_mem_uc.c +++ b/einj_mem_uc.c @@ -427,6 +427,7 @@ int trigger_futex(char *addr) #define F_SIGBUS 4 #define F_FATAL 8 #define F_EITHER 16 +#define F_LONGWAIT 32 struct test { char *testname; @@ -467,7 +468,7 @@ struct test { }, { "patrol", "Patrol scrubber, generates SRAO machine check", - data_alloc, inject_uc, 0, trigger_patrol, F_EITHER, + data_alloc, inject_uc, 0, trigger_patrol, F_EITHER|F_LONGWAIT, }, { "llc", "Cache write-back, generates SRAO machine check", @@ -656,19 +657,21 @@ int main(int argc, char **argv) } skip1: if (Sflag == 0 && (t->flags & (F_CMCI | F_EITHER))) { + int maxwait = (t->flags & F_LONGWAIT) ? 20000 : 500; + while (a_cmci < b_cmci + lcpus_persocket) { - if (cmci_wait_count > 1000) { + if (cmci_wait_count > maxwait) { break; } - usleep(100); + usleep(1000); proc_interrupts(&a_mce, &a_cmci); cmci_wait_count++; } - if (cmci_wait_count != 0) { + if (a_cmci != b_cmci && cmci_wait_count != 0) { gettimeofday(&t2, NULL); - printf("CMCIs took ~%ld usecs to be reported.\n", - 1000000 * (t2.tv_sec - t1.tv_sec) + - (t2.tv_usec - t1.tv_usec)); + printf("CMCIs took ~%.6f secs to be reported.\n", + (t2.tv_sec - t1.tv_sec) + + (t2.tv_usec - t1.tv_usec) /1.0e6); } if (a_cmci == b_cmci) { if (t->flags & F_EITHER) |