Skip to content

Commit

Permalink
rcu: Add READ_ONCE() to rcu_do_batch() access to rcu_cpu_stall_ftrace…
Browse files Browse the repository at this point in the history
…_dump

Given that sysfs can change the value of rcu_cpu_stall_ftrace_dump at any
time, this commit adds a READ_ONCE() to the accesses to that variable.

Signed-off-by: Paul E. McKenney <[email protected]>
  • Loading branch information
paulmckrcu committed Aug 25, 2020
1 parent fe63b72 commit 1ef5a44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/rcu/tree_stall.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ static void check_cpu_stall(struct rcu_data *rdp)

/* We haven't checked in, so go dump stack. */
print_cpu_stall(gps);
if (rcu_cpu_stall_ftrace_dump)
if (READ_ONCE(rcu_cpu_stall_ftrace_dump))
rcu_ftrace_dump(DUMP_ALL);

} else if (rcu_gp_in_progress() &&
Expand All @@ -632,7 +632,7 @@ static void check_cpu_stall(struct rcu_data *rdp)

/* They had a few time units to dump stack, so complain. */
print_other_cpu_stall(gs2, gps);
if (rcu_cpu_stall_ftrace_dump)
if (READ_ONCE(rcu_cpu_stall_ftrace_dump))
rcu_ftrace_dump(DUMP_ALL);
}
}
Expand Down

0 comments on commit 1ef5a44

Please sign in to comment.