Skip to content

Commit 9420fb9

Browse files
qiangzh3paulmckrcu
authored andcommitted
rcu-tasks: Use accurate runstart time for RCU Tasks boot-time testing
Currently, test_rcu_tasks_callback() reads from the jiffies counter only once when this function is invoked. This introduces inaccuracies because of the latencies induced by the synchronize_rcu_tasks*() invocations. This commit therefore re-reads the jiffies counter at the beginning of each test, thus avoiding penalizing later tests for the latencies induced by earlier tests. Therefore, this commit at the start of each RCU Tasks test, re-fetch the jiffies time as the runstart time. Signed-off-by: Zqiang <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 1b929c0 commit 9420fb9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

kernel/rcu/tasks.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,23 +1815,21 @@ static void test_rcu_tasks_callback(struct rcu_head *rhp)
18151815

18161816
static void rcu_tasks_initiate_self_tests(void)
18171817
{
1818-
unsigned long j = jiffies;
1819-
18201818
pr_info("Running RCU-tasks wait API self tests\n");
18211819
#ifdef CONFIG_TASKS_RCU
1822-
tests[0].runstart = j;
1820+
tests[0].runstart = jiffies;
18231821
synchronize_rcu_tasks();
18241822
call_rcu_tasks(&tests[0].rh, test_rcu_tasks_callback);
18251823
#endif
18261824

18271825
#ifdef CONFIG_TASKS_RUDE_RCU
1828-
tests[1].runstart = j;
1826+
tests[1].runstart = jiffies;
18291827
synchronize_rcu_tasks_rude();
18301828
call_rcu_tasks_rude(&tests[1].rh, test_rcu_tasks_callback);
18311829
#endif
18321830

18331831
#ifdef CONFIG_TASKS_TRACE_RCU
1834-
tests[2].runstart = j;
1832+
tests[2].runstart = jiffies;
18351833
synchronize_rcu_tasks_trace();
18361834
call_rcu_tasks_trace(&tests[2].rh, test_rcu_tasks_callback);
18371835
#endif

0 commit comments

Comments
 (0)