Skip to content

Commit dda64ea

Browse files
committed
Merge tag 'trace-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fixes from Steven Rostedt: "Minor tracing fixes: - Fix unregistering the same event twice. A user could disable the same event that osnoise will disable on unregistering. - Inform RCU of a quiescent state in the osnoise testing thread. - Fix some kerneldoc comments" * tag 'trace-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: ftrace: Fix some W=1 warnings in kernel doc comments tracing/osnoise: Force quiescent states while tracing tracing/osnoise: Do not unregister events twice
2 parents 186d32b + 78cbc65 commit dda64ea

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

kernel/trace/ftrace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7790,7 +7790,7 @@ int ftrace_is_dead(void)
77907790

77917791
/**
77927792
* register_ftrace_function - register a function for profiling
7793-
* @ops - ops structure that holds the function for profiling.
7793+
* @ops: ops structure that holds the function for profiling.
77947794
*
77957795
* Register a function to be called by all functions in the
77967796
* kernel.
@@ -7817,7 +7817,7 @@ EXPORT_SYMBOL_GPL(register_ftrace_function);
78177817

78187818
/**
78197819
* unregister_ftrace_function - unregister a function for profiling.
7820-
* @ops - ops structure that holds the function to unregister
7820+
* @ops: ops structure that holds the function to unregister
78217821
*
78227822
* Unregister a function that was added to be called by ftrace profiling.
78237823
*/

kernel/trace/trace_osnoise.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,26 @@ static int run_osnoise(void)
13861386
osnoise_stop_tracing();
13871387
}
13881388

1389+
/*
1390+
* In some cases, notably when running on a nohz_full CPU with
1391+
* a stopped tick PREEMPT_RCU has no way to account for QSs.
1392+
* This will eventually cause unwarranted noise as PREEMPT_RCU
1393+
* will force preemption as the means of ending the current
1394+
* grace period. We avoid this problem by calling
1395+
* rcu_momentary_dyntick_idle(), which performs a zero duration
1396+
* EQS allowing PREEMPT_RCU to end the current grace period.
1397+
* This call shouldn't be wrapped inside an RCU critical
1398+
* section.
1399+
*
1400+
* Note that in non PREEMPT_RCU kernels QSs are handled through
1401+
* cond_resched()
1402+
*/
1403+
if (IS_ENABLED(CONFIG_PREEMPT_RCU)) {
1404+
local_irq_disable();
1405+
rcu_momentary_dyntick_idle();
1406+
local_irq_enable();
1407+
}
1408+
13891409
/*
13901410
* For the non-preemptive kernel config: let threads runs, if
13911411
* they so wish.
@@ -2200,6 +2220,17 @@ static void osnoise_workload_stop(void)
22002220
if (osnoise_has_registered_instances())
22012221
return;
22022222

2223+
/*
2224+
* If callbacks were already disabled in a previous stop
2225+
* call, there is no need to disable then again.
2226+
*
2227+
* For instance, this happens when tracing is stopped via:
2228+
* echo 0 > tracing_on
2229+
* echo nop > current_tracer.
2230+
*/
2231+
if (!trace_osnoise_callback_enabled)
2232+
return;
2233+
22032234
trace_osnoise_callback_enabled = false;
22042235
/*
22052236
* Make sure that ftrace_nmi_enter/exit() see

0 commit comments

Comments
 (0)