Skip to content

Commit

Permalink
tracing: Avoid isolated CPUs when queueing fsnotify irqwork
Browse files Browse the repository at this point in the history
Ftrace's fsnotify irq_work doesn't need to be run locally, so avoid
doing so when the CPU is isolated.

Note that this is especially bad when tracing an isolated CPU, as the
noise from running the irq_work might be bigger than what was actually
meant to be traced.

Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
  • Loading branch information
vianpl authored and intel-lab-lkp committed Feb 28, 2022
1 parent 4215bc9 commit e3ec0b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/trace/trace.c
Expand Up @@ -12,6 +12,7 @@
* Copyright (C) 2004-2006 Ingo Molnar
* Copyright (C) 2004 Nadia Yvette Chambers
*/
#include <linux/sched/isolation.h>
#include <linux/ring_buffer.h>
#include <generated/utsrelease.h>
#include <linux/stacktrace.h>
Expand Down Expand Up @@ -1724,7 +1725,7 @@ void latency_fsnotify(struct trace_array *tr)
* possible that we are called from __schedule() or do_idle(), which
* could cause a deadlock.
*/
irq_work_queue(&tr->fsnotify_irqwork);
irq_work_queue_on(&tr->fsnotify_irqwork, housekeeping_any_cpu(HK_FLAG_MISC));
}

#elif defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) \
Expand Down

0 comments on commit e3ec0b4

Please sign in to comment.