From eaf4150c7bc0d12b1b1f39d1e257cdb56bfa165a Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Tue, 7 Jul 2015 17:17:20 +0200 Subject: [PATCH] cpu_quota.run: support X86 The timer driver on X86 needs CPU quota with highest priority as it frequently has to interrupt the counters to update the PIT. On ARM this makes no difference in the test results as ARM timer drivers, once configured, can sleep until the end of the timeouts. On X86 we raise the error tolerance to 2% (default 1%) to compensate the error caused by the timer. Fixes #1621 --- repos/os/run/cpu_quota.run | 42 +++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/repos/os/run/cpu_quota.run b/repos/os/run/cpu_quota.run index c474ff4344..c031e1fa2e 100644 --- a/repos/os/run/cpu_quota.run +++ b/repos/os/run/cpu_quota.run @@ -2,15 +2,8 @@ # Check platform # # HW is the only kernel that provides appliance of quota to the scheduling. -# On X86, the timer driver uses the PIT with a timeout of max. 54 ms. Thus, -# the driver needs to restart the timer permanently which is a hard job with 6 -# high-priority counter-threads in the background. As a consequence, timeouts -# take much longer than requested and the test fails. However, as the PIT -# tends to be replaced by a better timing source, we simply skip X86 for now. -# # assert_spec hw -assert_spec arm # # Build @@ -43,11 +36,6 @@ install_config { - - - - - @@ -55,9 +43,9 @@ install_config { - + - + @@ -77,7 +65,7 @@ install_config { - + @@ -88,9 +76,9 @@ install_config { - + - + @@ -110,13 +98,13 @@ install_config { - + - + @@ -124,6 +112,13 @@ install_config { + + + + + + + } @@ -149,6 +144,15 @@ proc check_counter { name opt cnt total_cnt } { set err 0.01 set is 0 + # + # On X86, the timer driver uses the PIT with a maximum timeout of 54 ms. + # Thus, the driver frequently interrupts the counters with highest + # priority to update the timer. This is why we need a higher error + # tolerance as for ARM where the driver, once configured, can sleep for + # the whole test timeout. + # + if {[have_spec x86]} { set err 0.02 } + if {[expr $total_cnt != 0]} { set is [expr double($cnt) / $total_cnt ] } set is_pc [expr double(round($is * 100000)) / 1000]