diff mbox series

[kvm-unit-tests,v2,2/3] tscdeadline_latency: Limit size

Message ID 20190712022825.1366-3-peterx@redhat.com (mailing list archive)
State New, archived
Headers show
Series tscdeadline_latency: Some fixes of hangs | expand

Commit Message

Peter Xu July 12, 2019, 2:28 a.m. UTC
When size>TABLE_SIZE it can hang as well (say, 10001), because when we
get TABLE_SIZE IRQs we'll stop increasing table_idx, then we'll never
be able to get out of the main loop.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 x86/tscdeadline_latency.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/x86/tscdeadline_latency.c b/x86/tscdeadline_latency.c
index 3ad2950..0a3532d 100644
--- a/x86/tscdeadline_latency.c
+++ b/x86/tscdeadline_latency.c
@@ -112,7 +112,11 @@  int main(int argc, char **argv)
     delta = argc <= 1 ? 200000 : atol(argv[1]);
     size = argc <= 2 ? TABLE_SIZE : atol(argv[2]);
     breakmax = argc <= 3 ? 0 : atol(argv[3]);
-    printf("breakmax=%d\n", breakmax);
+
+    if (size >= TABLE_SIZE)
+	    size = TABLE_SIZE;
+    printf("delta=%d, size=%d, breakmax=%d\n", delta, size, breakmax);
+
     test_tsc_deadline_timer();
 
     do {