Commit 7cba4775 authored by Paul E. McKenney's avatar Paul E. McKenney

rcu: Restructure rcu_check_gp_kthread_starvation()

This commit removes the rsp and gpa local variables, repurposes the j
local variable and adds a gpk (GP kthread) local to improve readability.
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent f7dd7d44
...@@ -1225,24 +1225,21 @@ static const char *gp_state_getname(short gs) ...@@ -1225,24 +1225,21 @@ static const char *gp_state_getname(short gs)
*/ */
static void rcu_check_gp_kthread_starvation(void) static void rcu_check_gp_kthread_starvation(void)
{ {
unsigned long gpa; struct task_struct *gpk = rcu_state.gp_kthread;
unsigned long j; unsigned long j;
struct rcu_state *rsp = &rcu_state;
j = jiffies; j = jiffies - READ_ONCE(rcu_state.gp_activity);
gpa = READ_ONCE(rsp->gp_activity); if (j > 2 * HZ) {
if (j - gpa > 2 * HZ) {
pr_err("%s kthread starved for %ld jiffies! g%ld f%#x %s(%d) ->state=%#lx ->cpu=%d\n", pr_err("%s kthread starved for %ld jiffies! g%ld f%#x %s(%d) ->state=%#lx ->cpu=%d\n",
rsp->name, j - gpa, rcu_state.name, j,
(long)rcu_seq_current(&rsp->gp_seq), (long)rcu_seq_current(&rcu_state.gp_seq),
rsp->gp_flags, rcu_state.gp_flags,
gp_state_getname(rsp->gp_state), rsp->gp_state, gp_state_getname(rcu_state.gp_state), rcu_state.gp_state,
rsp->gp_kthread ? rsp->gp_kthread->state : ~0, gpk ? gpk->state : ~0, gpk ? task_cpu(gpk) : -1);
rsp->gp_kthread ? task_cpu(rsp->gp_kthread) : -1); if (gpk) {
if (rsp->gp_kthread) {
pr_err("RCU grace-period kthread stack dump:\n"); pr_err("RCU grace-period kthread stack dump:\n");
sched_show_task(rsp->gp_kthread); sched_show_task(gpk);
wake_up_process(rsp->gp_kthread); wake_up_process(gpk);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment