<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
</head>
<body>
<pre>Hi Viresh
</pre>
<div class="moz-cite-prefix">
<pre>
</pre>
</div>
<blockquote type="cite"
cite="mid:20200703031532.bjkwhkpfobdsxj4p@vireshk-i7">
<pre class="moz-quote-pre" wrap="">On 02-07-20, 15:06, Cyril Hrubis wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Btw, we may as well add a check that the value is consistent with
/proc/sys/kernel/sched_rr_timeslice_ms.
</pre>
</blockquote>
</blockquote>
<pre>I guess cyril may want to add a check using TST_ASSERT_INT api like this</pre>
<pre>TST_ASSERT_INT("/proc/sys/kernel/sched_rr_timeslice_ms", tst_ts_to_ms(tp));</pre>
<blockquote type="cite"
cite="mid:20200703031532.bjkwhkpfobdsxj4p@vireshk-i7">
<pre class="moz-quote-pre" wrap="">
diff --git a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
index 31d7b5d56a52..0641b6651502 100644
--- a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
+++ b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
@@ -44,6 +44,7 @@ static void setup(void)
static void run(void)
{
struct test_variants *tv = &variants[tst_variant];
+ unsigned long long timeslice_ms;
TEST(tv->func(0, tst_ts_get(&tp)));
@@ -54,6 +55,8 @@ static void run(void)
TST_RET);
}
+ SAFE_FILE_SCANF("/proc/sys/kernel/sched_rr_timeslice_ms", "%llu", ×lice_ms);
+
if (!tst_ts_valid(&tp)) {
tst_res(TPASS, "Time quantum %llis %llins",
tst_ts_get_sec(tp), tst_ts_get_nsec(tp));
@@ -62,6 +65,7 @@ static void run(void)
tst_ts_get_sec(tp), tst_ts_get_nsec(tp));
}
+ tst_res(TINFO, "%llu: %llu", timeslice_ms, tst_ts_to_ms(tp));
}
static struct tst_test test = {
and it is coming as:
sched_rr_get_interval01.c:68: INFO: 25: 100
They aren't consistent here. Perhaps because first one is system wide
while other one is per process ?</pre>
</blockquote>
<pre>It is strange.
On my machine, the two values are all 100. AFAIK, it has a bug (<span style="display: inline !important; float: none; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: monospace; font-size: 13.33px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;">set in milliseconds
but the result is shown in jiffies.</span>) on old kernel when <span style="display: inline !important; float: none; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: monospace; font-size: 13.33px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;">CONFIG_HZ is not 1000. what kernel version
do you test?
</span>
[1] <a class="moz-txt-link-freetext" href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=975e155ed8732cb81f55c021c441ae662dd040b5">https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=975e155ed8732cb81f55c021c441ae662dd040b5</a>
</pre>
<blockquote type="cite"
cite="mid:20200703031532.bjkwhkpfobdsxj4p@vireshk-i7">
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
</body>
</html>