All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Bristot de Oliveira <bristot@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Daniel Bristot de Oliveira <bristot@kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Tom Zanussi <zanussi@kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Clark Williams <williams@redhat.com>,
	John Kacur <jkacur@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	linux-rt-users@vger.kernel.org,
	linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH V5 01/20] trace/osnoise: Do not follow tracing_cpumask
Date: Mon, 25 Oct 2021 19:40:26 +0200	[thread overview]
Message-ID: <c46adc4a72c1b498a392ca81263083b4c8f774b5.1635181938.git.bristot@kernel.org> (raw)
In-Reply-To: <cover.1635181938.git.bristot@kernel.org>

In preparation to support multiple instances, decouple the
osnoise/timelat workload from instance-specific tracing_cpumask.

Different instances can have conflicting cpumasks, making osnoise
workload management needlessly complex. Osnoise already has its
global cpumask.

I also thought about using the first instance mask, but the
"first" instance could be removed before the others.

This also fixes the problem that changing the tracing_mask was not
re-starting the trace.

Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
Cc: linux-rt-users@vger.kernel.org
Cc: linux-trace-devel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
---
 kernel/trace/trace_osnoise.c | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index ce053619f289..73f9609cba3d 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -1553,13 +1553,9 @@ static int start_per_cpu_kthreads(struct trace_array *tr)
 
 	cpus_read_lock();
 	/*
-	 * Run only on CPUs in which trace and osnoise are allowed to run.
+	 * Run only on online CPUs in which osnoise is allowed to run.
 	 */
-	cpumask_and(current_mask, tr->tracing_cpumask, &osnoise_cpumask);
-	/*
-	 * And the CPU is online.
-	 */
-	cpumask_and(current_mask, cpu_online_mask, current_mask);
+	cpumask_and(current_mask, cpu_online_mask, &osnoise_cpumask);
 
 	for_each_possible_cpu(cpu)
 		per_cpu(per_cpu_osnoise_var, cpu).kthread = NULL;
@@ -1580,10 +1576,8 @@ static int start_per_cpu_kthreads(struct trace_array *tr)
 #ifdef CONFIG_HOTPLUG_CPU
 static void osnoise_hotplug_workfn(struct work_struct *dummy)
 {
-	struct trace_array *tr = osnoise_trace;
 	unsigned int cpu = smp_processor_id();
 
-
 	mutex_lock(&trace_types_lock);
 
 	if (!osnoise_busy)
@@ -1595,9 +1589,6 @@ static void osnoise_hotplug_workfn(struct work_struct *dummy)
 	if (!cpumask_test_cpu(cpu, &osnoise_cpumask))
 		goto out_unlock;
 
-	if (!cpumask_test_cpu(cpu, tr->tracing_cpumask))
-		goto out_unlock;
-
 	start_kthread(cpu);
 
 out_unlock:
@@ -1700,13 +1691,10 @@ static void osnoise_tracer_stop(struct trace_array *tr);
  * interface to the osnoise trace. By default, it lists all  CPUs,
  * in this way, allowing osnoise threads to run on any online CPU
  * of the system. It serves to restrict the execution of osnoise to the
- * set of CPUs writing via this interface. Note that osnoise also
- * respects the "tracing_cpumask." Hence, osnoise threads will run only
- * on the set of CPUs allowed here AND on "tracing_cpumask." Why not
- * have just "tracing_cpumask?" Because the user might be interested
- * in tracing what is running on other CPUs. For instance, one might
- * run osnoise in one HT CPU while observing what is running on the
- * sibling HT CPU.
+ * set of CPUs writing via this interface. Why not use "tracing_cpumask"?
+ * Because the user might be interested in tracing what is running on
+ * other CPUs. For instance, one might run osnoise in one HT CPU
+ * while observing what is running on the sibling HT CPU.
  */
 static ssize_t
 osnoise_cpus_write(struct file *filp, const char __user *ubuf, size_t count,
-- 
2.31.1


  reply	other threads:[~2021-10-25 17:41 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 17:40 [PATCH V5 00/20] RTLA: An interface for osnoise/timerlat tracers Daniel Bristot de Oliveira
2021-10-25 17:40 ` Daniel Bristot de Oliveira [this message]
2021-10-25 17:40 ` [PATCH V5 02/20] trace/osnoise: Improve comments about barrier need for NMI callbacks Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 03/20] trace/osnoise: Split workload start from the tracer start Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 04/20] trace/osnoise: Use start/stop_per_cpu_kthreads() on osnoise_cpus_write() Daniel Bristot de Oliveira
2021-10-26  1:08   ` Steven Rostedt
2021-10-26  8:23     ` Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 05/20] trace/osnoise: Support a list of trace_array *tr Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 06/20] trace/osnoise: Allow multiple instances of the same tracer Daniel Bristot de Oliveira
2021-10-26  2:08   ` Steven Rostedt
2021-10-26  8:38     ` Daniel Bristot de Oliveira
2021-10-26 13:02       ` Steven Rostedt
2021-10-25 17:40 ` [PATCH V5 07/20] rtla: Real-Time Linux Analysis tool Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 08/20] rtla: Helper functions for rtla Daniel Bristot de Oliveira
2021-10-26 16:22   ` Tao Zhou
2021-10-26 16:26     ` Steven Rostedt
2021-10-26 19:45       ` Daniel Bristot de Oliveira
2021-10-26 19:43     ` Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 09/20] rtla: Add osnoise tool Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 10/20] rtla/osnoise: Add osnoise top mode Daniel Bristot de Oliveira
2021-10-26 16:32   ` Tao Zhou
2021-10-26 19:50     ` Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 11/20] rtla/osnoise: Add the hist mode Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 12/20] rtla: Add timerlat tool and timelart top mode Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 13/20] rtla/timerlat: Add timerlat hist mode Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 14/20] rtla: Add Documentation Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 15/20] rtla: Add rtla osnoise man page Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 16/20] rtla: Add rtla osnoise top documentation Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 17/20] rtla: Add rtla osnoise hist documentation Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 18/20] rtla: Add rtla timerlat documentation Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 19/20] rtla: Add rtla timerlat top documentation Daniel Bristot de Oliveira
2021-10-25 17:40 ` [PATCH V5 20/20] rtla: Add rtla timerlat hist documentation 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=c46adc4a72c1b498a392ca81263083b4c8f774b5.1635181938.git.bristot@kernel.org \
    --to=bristot@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=jkacur@redhat.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=williams@redhat.com \
    --cc=zanussi@kernel.org \
    /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.