Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3186004pxb; Mon, 18 Oct 2021 09:51:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3oubO+XW/CzpHwXgP0gF7pQckjKJHNMyxdgTGP9tCY0LtlNRhqCH/u38Wis0Vp0/26d0P X-Received: by 2002:a17:907:7848:: with SMTP id lb8mr30410193ejc.494.1634575874231; Mon, 18 Oct 2021 09:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634575874; cv=none; d=google.com; s=arc-20160816; b=apZOyz7RTVxPiNLy4mLp64/n51+tzUcZQsrIAciSgkEtRYRPzu9bkKOTgnaFq8qUA2 ndHAyKV85lW/v2Jf9gGj9X3wGgYw1uZ85LTWExcTcCV6oMNM6mDkFEX6kXV45In0JaiJ c2vYyMWb0J2KgVWxSYtqZKph8LBd2g3LPseiMGxiww5nkZUqBOfPDm3YCdtu2imyrlbA yfjvW1EUnIfX1L0h3MvCUyldNTtg0oU7gPQhCOlt6hIEwirpqRTqI/SiV2KjzJ7EG/QF EdY094yUUt92dR+BogGS4GyzBRDGAaN7wSqCM5uq0IJ6OHWNgI9ytZbKAjPHGDXEKS4N cJSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GnBgP2NqtqlaOVFmU4s4Rn5UkfjoYVpvL+9CoepEz+Y=; b=tTdayHRRgVTKj9LQVTKQi9m5P6/QQqUurG0bcRo70y0VePKMrItTBUwvp0KD0WWv44 TOBvEKrPuzQlKCFw9ASFbidJDCuvyvJw2NU+tIRuKQIpDl7UNBKrixJeBUBb3eLQksgL YpEHNIp86wE8kcPssQGhP5nRNDinBPX566DHLaZWYPGTc7wKdQTurSbcKos7Grx3hQ6r aj3GIB5FNlkFpecJH9KwtrWskrOyRtISrIpQl8QUKSB/iHtvbhZogSiSnaeRroPdZ8Se Uep/JMtLZCJwcAliUBfZtgAzyRyR/cNIlVskTAJ10uk5I4ytLS9XzkLrhf3pv8tvXAis R1hg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si629248ede.525.2021.10.18.09.50.50; Mon, 18 Oct 2021 09:51:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233747AbhJRQvL convert rfc822-to-8bit (ORCPT + 99 others); Mon, 18 Oct 2021 12:51:11 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:24924 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233742AbhJRQvH (ORCPT ); Mon, 18 Oct 2021 12:51:07 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-600-M7SyurvtOWuXn4CT7EhdsQ-1; Mon, 18 Oct 2021 12:48:52 -0400 X-MC-Unique: M7SyurvtOWuXn4CT7EhdsQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3EE2210A8E00; Mon, 18 Oct 2021 16:48:50 +0000 (UTC) Received: from x1.com (unknown [10.22.18.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 605C410016F4; Mon, 18 Oct 2021 16:48:47 +0000 (UTC) From: Daniel Bristot de Oliveira To: Steven Rostedt Cc: Daniel Bristot de Oliveira , Ingo Molnar , Tom Zanussi , Masami Hiramatsu , Juri Lelli , Clark Williams , John Kacur , Peter Zijlstra , Thomas Gleixner , Sebastian Andrzej Siewior , linux-rt-users@vger.kernel.org, linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 01/19] trace/osnoise: Do not follow tracing_cpumask Date: Mon, 18 Oct 2021 18:48:14 +0200 Message-Id: <36d34e131ab1507eda786195d305ae622a14f75b.1634574261.git.bristot@kernel.org> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=bristot@kernel.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=WINDOWS-1252 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation to support multiple instances, decople the osnoise/timelat workload from instance specific tracing_cpumask. Different instances can have conflicing cpumasks, making osnoise workload management needlessly complex. Osnoise already have its global cpu mask. 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 Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira 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 --- kernel/trace/trace_osnoise.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index ce053619f289..7b1f8187764c 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -1553,13 +1553,10 @@ 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 trace and osnoise are 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 +1577,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 +1590,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 +1692,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