Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b980b117 authored by Steven Rostedt (VMware)'s avatar Steven Rostedt (VMware)
Browse files

tracing: Have the trace_event benchmark thread call cond_resched_rcu_qs()



The trace_event benchmark thread runs in kernel space in an infinite loop
while also calling cond_resched() in case anything else wants to schedule
in. Unfortunately, on a PREEMPT kernel, that makes it a nop, in which case,
this will never voluntarily schedule. That will cause synchronize_rcu_tasks()
to forever block on this thread, while it is running.

This is exactly what cond_resched_rcu_qs() is for. Use that instead.

Acked-by: default avatar"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent fcdc7125
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -153,10 +153,18 @@ static int benchmark_event_kthread(void *arg)
		trace_do_benchmark();

		/*
		 * We don't go to sleep, but let others
		 * run as well.
		 * We don't go to sleep, but let others run as well.
		 * This is bascially a "yield()" to let any task that
		 * wants to run, schedule in, but if the CPU is idle,
		 * we'll keep burning cycles.
		 *
		 * Note the _rcu_qs() version of cond_resched() will
		 * notify synchronize_rcu_tasks() that this thread has
		 * passed a quiescent state for rcu_tasks. Otherwise
		 * this thread will never voluntarily schedule which would
		 * block synchronize_rcu_tasks() indefinitely.
		 */
		cond_resched();
		cond_resched_rcu_qs();
	}

	return 0;