rcu-tasks: Add a grace-period start time for throttling and debug
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 17 Mar 2020 15:57:02 +0000 (08:57 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 27 Apr 2020 18:03:52 +0000 (11:03 -0700)
This commit adds a place to record the grace-period start in jiffies.
This will be used by later commits for debugging purposes and to throttle
IPIs early in the grace period.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tasks.h

index 6f8a4040fbddf147b5114bdbbb81d3f3c28087ee..71462cf3d4bd32b0611964cb2292057016bd7063 100644 (file)
@@ -46,6 +46,7 @@ struct rcu_tasks {
        raw_spinlock_t cbs_lock;
        int gp_state;
        unsigned long gp_jiffies;
+       unsigned long gp_start;
        struct task_struct *kthread_ptr;
        rcu_tasks_gp_func_t gp_func;
        pregp_func_t pregp_func;
@@ -200,6 +201,7 @@ static int __noreturn rcu_tasks_kthread(void *arg)
 
                // Wait for one grace period.
                set_tasks_gp_state(rtp, RTGS_WAIT_GP);
+               rtp->gp_start = jiffies;
                rtp->gp_func(rtp);
 
                /* Invoke the callbacks. */