From nobody Mon Feb 9 10:29:39 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86E2C2D057 for ; Sat, 25 Jan 2025 16:00:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737820814; cv=none; b=Y/vrl059wNQy6HO4v5Y18X0iO2Amn91k/fENKrtbP34pTGQRA+ap6+ynSymJTxIORtoIp1SJjfjA9sBmE6VjBZRv5IwSGHhXhgQlsJUYz8QodWf4bDBPJUXWbjH+u+ObuVehEAvaU6y46FLYIZHTAHtSn2KtDo/v279rZYextfk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737820814; c=relaxed/simple; bh=lx7ws9vj8Da30+5wxzKBv4l2bBvD6jlMVmyXw6+PH9w=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=EN59fGUdNofyBlC7qBZtEH0eM7GtqPFHELISY7WgAn/3kwczujwkzkXITyctH8fRJCwCo6ep9LlremWfMBIbRuD+uCkKJgPnn5vlbjm+3mXTvX6bQAKmLGB9wNm/9iqfh2aSudMiGjwNH5DmfqZajJ0tJuxPAvV3VCBBgTULX2U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11D9FC4CED6; Sat, 25 Jan 2025 16:00:11 +0000 (UTC) Date: Sat, 25 Jan 2025 11:00:24 -0500 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Masami Hiramatsu , Mathieu Desnoyers , Tomas Glozar , John Kacur , Gabriele Monaco Subject: [GIT PULL] rv: osnoise: Fixes for 6.14 Message-ID: <20250125110024.680cf413@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Linus, Runtime verifier and osnoise fixes for 6.14: - Reset idle tasks on reset for runtime verifier When the runtime verifier is reset, it resets the task's data that is bei= ng monitored. But it only iterates for_each_process() which does not include the idle tasks. As the idle tasks can be monitored, they need to be reset as well. - Fix the enabling and disabling of tracepoints in osnoise If timerlat is enabled and the WORKLOAD flag is not set, then the osnoise tracer will enable the migrate task tracepoint to monitor it for its own workload. The test to enable the tracepoint is done against user space modifiable parameters. On disabling of the tracer, those same parameters are used to determine if the tracepoint should be disabled. The problem is if user space were to modify the parameters after it enables the tracer then it may not disable the tracepoint. Instead, a static variable is used to keep track if the tracepoint was enabled or not. Then when the tracer shuts down, it will use this variable to decide to disable the tracepoint or not, instead of looking at the user space parameters. Please pull the latest trace-rv-v6.14 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-rv-v6.14 Tag SHA1: 70b59fc97fd30b5f3df891555bb409450f7db63f Head SHA1: e3ff4245928f948f3eb2e852aa350b870421c358 Gabriele Monaco (1): rv: Reset per-task monitors also for idle tasks Steven Rostedt (1): tracing/osnoise: Fix resetting of tracepoints ---- include/rv/da_monitor.h | 4 ++++ kernel/trace/trace_osnoise.c | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) --------------------------- diff --git a/include/rv/da_monitor.h b/include/rv/da_monitor.h index 9705b2a98e49..510c88bfabd4 100644 --- a/include/rv/da_monitor.h +++ b/include/rv/da_monitor.h @@ -14,6 +14,7 @@ #include #include #include +#include =20 #ifdef CONFIG_RV_REACTORS =20 @@ -324,10 +325,13 @@ static inline struct da_monitor *da_get_monitor_##nam= e(struct task_struct *tsk) static void da_monitor_reset_all_##name(void) \ { \ struct task_struct *g, *p; \ + int cpu; \ \ read_lock(&tasklist_lock); \ for_each_process_thread(g, p) \ da_monitor_reset_##name(da_get_monitor_##name(p)); \ + for_each_present_cpu(cpu) \ + da_monitor_reset_##name(da_get_monitor_##name(idle_task(cpu))); \ read_unlock(&tasklist_lock); \ } \ \ diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index b9f96c77527d..23cbc24ed292 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -1229,6 +1229,8 @@ static void trace_sched_migrate_callback(void *data, = struct task_struct *p, int } } =20 +static bool monitor_enabled; + static int register_migration_monitor(void) { int ret =3D 0; @@ -1237,16 +1239,25 @@ static int register_migration_monitor(void) * Timerlat thread migration check is only required when running timerlat= in user-space. * Thus, enable callback only if timerlat is set with no workload. */ - if (timerlat_enabled() && !test_bit(OSN_WORKLOAD, &osnoise_options)) + if (timerlat_enabled() && !test_bit(OSN_WORKLOAD, &osnoise_options)) { + if (WARN_ON_ONCE(monitor_enabled)) + return 0; + ret =3D register_trace_sched_migrate_task(trace_sched_migrate_callback, = NULL); + if (!ret) + monitor_enabled =3D true; + } =20 return ret; } =20 static void unregister_migration_monitor(void) { - if (timerlat_enabled() && !test_bit(OSN_WORKLOAD, &osnoise_options)) - unregister_trace_sched_migrate_task(trace_sched_migrate_callback, NULL); + if (!monitor_enabled) + return; + + unregister_trace_sched_migrate_task(trace_sched_migrate_callback, NULL); + monitor_enabled =3D false; } #else static int register_migration_monitor(void)