All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenzju@redhat.com>
To: mingo@redhat.com, peterz@infradead.org, frederic@kernel.org,
	rostedt@goodmis.org
Cc: tglx@linutronix.de, mtosatti@redhat.com, bristot@redhat.com,
	linux-kernel@vger.kernel.org,
	Nicolas Saenz Julienne <nsaenzju@redhat.com>
Subject: [PATCH v2 2/2] tracing: Avoid isolated CPUs when queueing fsnotify irqwork
Date: Tue,  1 Mar 2022 12:30:53 +0100	[thread overview]
Message-ID: <20220301113053.141514-2-nsaenzju@redhat.com> (raw)
In-Reply-To: <20220301113053.141514-1-nsaenzju@redhat.com>

There isn't any need for this irq_work to be run locally, so avoid doing
so when the CPU is isolated.

Note that this is especially bad as queueing it into a local isolated
CPU might add noise to what was meant to be traced in the first place.

Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
---

Changes since v1:
 - Rebase to cater for:
     04d4e665a609 ("sched/isolation: Use single feature type while
     referring to housekeeping cpumask")

 kernel/trace/trace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index bb2caf6aac01..250603b4eb3e 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -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>
@@ -1726,7 +1727,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_TYPE_MISC));
 }
 
 #elif defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)	\
-- 
2.35.1


  reply	other threads:[~2022-03-01 11:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 11:30 [PATCH v2 1/2] sched/isolation: use raw_smp_processor_id() in housekeeping_any_cpu() Nicolas Saenz Julienne
2022-03-01 11:30 ` Nicolas Saenz Julienne [this message]
2022-03-01 18:58   ` [PATCH v2 2/2] tracing: Avoid isolated CPUs when queueing fsnotify irqwork Daniel Bristot de Oliveira
2022-03-01 15:10 ` [PATCH v2 1/2] sched/isolation: use raw_smp_processor_id() in housekeeping_any_cpu() Steven Rostedt
2022-03-01 18:57 ` Daniel Bristot de Oliveira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220301113053.141514-2-nsaenzju@redhat.com \
    --to=nsaenzju@redhat.com \
    --cc=bristot@redhat.com \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.