From mboxrd@z Thu Jan 1 00:00:00 1970 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 205F126B087; Thu, 13 Feb 2025 15:32:15 +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=1739460735; cv=none; b=KmGiXhw8Sh7Ml+T0QlM9pynATfgcaDgqFMghVeZT8q8d5U5pe3vfv5Bg0xs0N94/g5xbqhrXtiO5FVkwv+5zrb4LU8giIw1+E4GAlFNJdJU/QlK2taCDFc6t4QDjsD8WWfP2gYTRO55EWR+w2UAAJnHJNCePnMUeTU6e6gnCgDw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739460735; c=relaxed/simple; bh=mWGrj0xOkohZt5zpy2T8y6k1llGCKFsKcAHiKYt4v7E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HQuRzwsIXsUaDoa+BXHNftK2F0xH2GphAQmzIqXAhG80rDRtuJxw8bLic3ae96ahOfbBrVlaNs5Mmwy+FzQOiYi57k5ayhUnSGhcAnZBEZ9igjiASvBov8ePu/62xsgVNeUgej5obU5w36DcJBSogsZ8Ox/2s4mysr88C2+uEBk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pIFK4uMp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="pIFK4uMp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 812B5C4CED1; Thu, 13 Feb 2025 15:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1739460735; bh=mWGrj0xOkohZt5zpy2T8y6k1llGCKFsKcAHiKYt4v7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pIFK4uMpjANmysx3LtTc9H1AdC3cdmNKJp9bswD0h+5wZDjrM+n5lDBusOv6WY/hi kOXc2Dv7Ib+xlrOtlPy+YFgRHoE940cNAjkiJcnGxMMh1S1yPeGeFB0uX7EaIA2+2G A+zgwfIs25Ly1gLqWFRgYZE0+wl2CPhHJzzTAI78= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Juri Lelli , Thomas Gleixner , Peter Zijlstra , John Kacur , Gabriele Monaco , "Steven Rostedt (Google)" Subject: [PATCH 6.6 197/273] rv: Reset per-task monitors also for idle tasks Date: Thu, 13 Feb 2025 15:29:29 +0100 Message-ID: <20250213142415.111604796@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250213142407.354217048@linuxfoundation.org> References: <20250213142407.354217048@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gabriele Monaco commit 8259cb14a70680553d5e82d65d1302fe589e9b39 upstream. RV per-task monitors are implemented through a monitor structure available for each task_struct. This structure is reset every time the monitor is (re-)started, to avoid inconsistencies if the monitor was activated previously. To do so, we reset the monitor on all threads using the macro for_each_process_thread. However, this macro excludes the idle tasks on each CPU. Idle tasks could be considered tasks on their own right and it should be up to the model whether to ignore them or not. Reset monitors also on the idle tasks for each present CPU whenever we reset all per-task monitors. Cc: stable@vger.kernel.org Cc: Juri Lelli Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: John Kacur Link: https://lore.kernel.org/20250115151547.605750-2-gmonaco@redhat.com Fixes: 792575348ff7 ("rv/include: Add deterministic automata monitor definition via C macros") Signed-off-by: Gabriele Monaco Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- include/rv/da_monitor.h | 4 ++++ 1 file changed, 4 insertions(+) --- a/include/rv/da_monitor.h +++ b/include/rv/da_monitor.h @@ -14,6 +14,7 @@ #include #include #include +#include #ifdef CONFIG_RV_REACTORS @@ -324,10 +325,13 @@ static inline struct da_monitor *da_get_ 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); \ } \ \