Commit 1ef5a442 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

rcu: Add READ_ONCE() to rcu_do_batch() access to rcu_cpu_stall_ftrace_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: default avatarPaul E. McKenney <paulmck@kernel.org>
parent fe63b723
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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() &&
@@ -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);
	}
}