Skip to content

Commit 68e8349

Browse files
Nicolas Saenz Juliennerostedt
authored andcommitted
ftrace: Avoid synchronize_rcu_tasks_rude() call when not necessary
synchronize_rcu_tasks_rude() triggers IPIs and forces rescheduling on all CPUs. It is a costly operation and, when targeting nohz_full CPUs, very disrupting (hence the name). So avoid calling it when 'old_hash' doesn't need to be freed. Link: https://lkml.kernel.org/r/20210721114726.1545103-1-nsaenzju@redhat.com Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 9528c19 commit 68e8349

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kernel/trace/ftrace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5985,7 +5985,8 @@ ftrace_graph_release(struct inode *inode, struct file *file)
59855985
* infrastructure to do the synchronization, thus we must do it
59865986
* ourselves.
59875987
*/
5988-
synchronize_rcu_tasks_rude();
5988+
if (old_hash != EMPTY_HASH)
5989+
synchronize_rcu_tasks_rude();
59895990

59905991
free_ftrace_hash(old_hash);
59915992
}

0 commit comments

Comments
 (0)