]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rcutorture: Comment invocations of tick_dep_set_task()
authorPaul E. McKenney <paulmck@kernel.org>
Sun, 9 Feb 2025 13:09:26 +0000 (05:09 -0800)
committerJoel Fernandes <joelagnelf@nvidia.com>
Fri, 16 May 2025 15:12:26 +0000 (11:12 -0400)
The rcu_torture_reader() and rcu_torture_fwd_prog_cr() functions
run CPU-bound for extended periods of time (tens or even
hundreds of milliseconds), so they invoke tick_dep_set_task() and
tick_dep_clear_task() to ensure that the scheduling-clock tick helps
move grace periods forward.

So why doesn't rcu_torture_fwd_prog_nr() also invoke tick_dep_set_task()
and tick_dep_clear_task()?  Because the point of this function is to test
RCU's ability to (eventually) force grace periods forward even when the
tick has been disabled during long CPU-bound kernel execution.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
kernel/rcu/rcutorture.c

index ae7b6804315082ca0ae46eb4900bc4befe6ad4b7..393bb5790e0f987c60798f4cf46b593ee27aa59b 100644 (file)
@@ -2345,7 +2345,7 @@ rcu_torture_reader(void *arg)
        set_user_nice(current, MAX_NICE);
        if (irqreader && cur_ops->irq_capable)
                timer_setup_on_stack(&t, rcu_torture_timer, 0);
-       tick_dep_set_task(current, TICK_DEP_BIT_RCU);
+       tick_dep_set_task(current, TICK_DEP_BIT_RCU);  // CPU bound, so need tick.
        do {
                if (irqreader && cur_ops->irq_capable) {
                        if (!timer_pending(&t))
@@ -3074,7 +3074,7 @@ static void rcu_torture_fwd_prog_cr(struct rcu_fwd *rfp)
        cver = READ_ONCE(rcu_torture_current_version);
        gps = cur_ops->get_gp_seq();
        rfp->rcu_launder_gp_seq_start = gps;
-       tick_dep_set_task(current, TICK_DEP_BIT_RCU);
+       tick_dep_set_task(current, TICK_DEP_BIT_RCU);  // CPU bound, so need tick.
        while (time_before(jiffies, stopat) &&
               !shutdown_time_arrived() &&
               !READ_ONCE(rcu_fwd_emergency_stop) && !torture_must_stop()) {