From nobody Sun Feb 8 13:48:17 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 74F6420370A for ; Mon, 3 Feb 2025 14:16:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592208; cv=none; b=M1QoJEbwY0ffxQY1da8qIfdqtdPeq/BRovd6pzLsRAqD+Ewa/O4aiWIokfhHX2iEo2xTMAlKsvAS/Hb7O5X4Fte6wqAQ96pdkI/O4TSfr7Y5AzGcloUMoTLGdfscNFCc3DOZFaBr08DNSFuX0TqudgOSr88PF7iIH5YmfiJBq5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592208; c=relaxed/simple; bh=pSKy/qsT+iXKg2g0H2gT9GJLhdQXpBlufpbUOra+KvM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D5sp81kVaFPNQTXx5vNwTgJ9P2qydxNzV93pgh2eaAAn1tdD0aM/h4C0qLk575fAyUoBmzWyp/F6HH4g+UBU2oB7qcy63He6xoOzT3Frl/q8gbAjycgDpQld4LKB+AXCQvFWUNdfJAW8GKphJAudnWFCxALTjDo1ucVG+zOovFc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RXBO+YXS; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=N8m97Mwk; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RXBO+YXS"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="N8m97Mwk" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738592204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=znyJ87Rf5QSuIOA4QGRHzjQx5YRj+X4MdZFuK4VJ2mQ=; b=RXBO+YXS3oP2YLi8XhX18qVnwDPWqoVjKdgEu997meGXHrokZZEB7WWBuA8BXoPBdDkWU3 6XSpQtXOvlGv+aP2is/zpW9jcm8iqzFj+Lh4x2MPofOrRrElYRnv54R0hT+sXxGEby75XD g2dKVjrrnHY8kFEwq50y6tbCAFKDCJsywEjl5gi0BDmAE8si/IBxZ0qBdsLaTrsa9mUV5J P+9jGWSSWldS+6GTR2MgZsT8nsJwKlDFa9iwZ8OY8c/D89z26mDsHtaPrBjP8w6jysEGDG lNx0K+nLHDBwckUs7NCWXcbh+YJfTuu21DB/v7jj7r3Ohb4prDyK3pxf88r/0g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738592204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=znyJ87Rf5QSuIOA4QGRHzjQx5YRj+X4MdZFuK4VJ2mQ=; b=N8m97MwktOuJaoUQu2wweXa7n3kcktzGltKb/3W9x/GM9cUX9rv9/dPRmb1mAR7g/UVBfl ePENj9HNQOeY8ZCQ== To: linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Cc: Ben Segall , Catalin Marinas , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Shrikanth Hegde , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Will Deacon , Sebastian Andrzej Siewior Subject: [PATCH v2 1/9] sched: Add a generic function to return the preemption string. Date: Mon, 3 Feb 2025 15:16:24 +0100 Message-ID: <20250203141632.440554-2-bigeasy@linutronix.de> In-Reply-To: <20250203141632.440554-1-bigeasy@linutronix.de> References: <20250203141632.440554-1-bigeasy@linutronix.de> 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" The individual architectures often add the preemption model to the begin of the backtrace. This is the case on X86 or ARM64 for the "die" case but not for regular warning. With the addition of DYNAMIC_PREEMPT for PREEMPT_RT we end up with CONFIG_PREEMPT and CONFIG_PREEMPT_RT set simultaneously. That means that everyone who tried to add that piece of information gets it wrong for PREEMPT_RT because PREEMPT is checked first. Provide a generic function which returns the current scheduling model considering LAZY preempt and the current state of PREEMPT_DYNAMIC. [ The dynamic building of the string can lead to an empty string if the function is invoked simultaneously on two CPUs. ] Co-developed-by: Peter Zijlstra (Intel) Signed-off-by: Peter Zijlstra (Intel) Co-developed-by: Steven Rostedt (Google) Signed-off-by: Steven Rostedt (Google) Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Shrikanth Hegde --- include/linux/preempt.h | 2 ++ kernel/sched/core.c | 47 +++++++++++++++++++++++++++++++++++++++++ kernel/sched/debug.c | 10 +++++---- kernel/sched/sched.h | 1 + 4 files changed, 56 insertions(+), 4 deletions(-) diff --git a/include/linux/preempt.h b/include/linux/preempt.h index ca86235ac15c0..3e9808f2b5491 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -515,6 +515,8 @@ static inline bool preempt_model_rt(void) return IS_ENABLED(CONFIG_PREEMPT_RT); } =20 +extern const char *preempt_model_str(void); + /* * Does the preemption model allow non-cooperative preemption? * diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 165c90ba64ea9..bd2664755b09a 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7646,10 +7646,57 @@ PREEMPT_MODEL_ACCESSOR(lazy); =20 #else /* !CONFIG_PREEMPT_DYNAMIC: */ =20 +#define preempt_dynamic_mode -1 + static inline void preempt_dynamic_init(void) { } =20 #endif /* CONFIG_PREEMPT_DYNAMIC */ =20 +const char *preempt_modes[] =3D { + "none", "voluntary", "full", "lazy", NULL, +}; + +const char *preempt_model_str(void) +{ + bool brace =3D IS_ENABLED(CONFIG_PREEMPT_RT) && + (IS_ENABLED(CONFIG_PREEMPT_DYNAMIC) || + IS_ENABLED(CONFIG_PREEMPT_LAZY)); + static char buf[128]; + + if (IS_ENABLED(CONFIG_PREEMPT_BUILD)) { + struct seq_buf s; + + seq_buf_init(&s, buf, 128); + seq_buf_puts(&s, "PREEMPT"); + + if (IS_ENABLED(CONFIG_PREEMPT_RT)) + seq_buf_printf(&s, "%sRT%s", + brace ? "_{" : "_", + brace ? "," : ""); + + if (IS_ENABLED(CONFIG_PREEMPT_DYNAMIC)) { + seq_buf_printf(&s, "(%s)%s", + preempt_dynamic_mode > 0 ? + preempt_modes[preempt_dynamic_mode] : "undef", + brace ? "}" : ""); + return seq_buf_str(&s); + } + + if (IS_ENABLED(CONFIG_PREEMPT_LAZY)) { + seq_buf_printf(&s, "LAZY%s", + brace ? "}" : ""); + return seq_buf_str(&s); + } + + return seq_buf_str(&s); + } + + if (IS_ENABLED(CONFIG_PREEMPT_VOLUNTARY_BUILD)) + return "VOLUNTARY"; + + return "NONE"; +} + int io_schedule_prepare(void) { int old_iowait =3D current->in_iowait; diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index fd7e852207157..755232ac88de9 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -244,11 +244,13 @@ static ssize_t sched_dynamic_write(struct file *filp,= const char __user *ubuf, =20 static int sched_dynamic_show(struct seq_file *m, void *v) { - static const char * preempt_modes[] =3D { - "none", "voluntary", "full", "lazy", - }; - int j =3D ARRAY_SIZE(preempt_modes) - !IS_ENABLED(CONFIG_ARCH_HAS_PREEMPT= _LAZY); int i =3D IS_ENABLED(CONFIG_PREEMPT_RT) * 2; + int j; + + /* Count entries in NULL terminated preempt_modes */ + for (j =3D 0; preempt_modes[j]; j++) + ; + j -=3D !IS_ENABLED(CONFIG_ARCH_HAS_PREEMPT_LAZY); =20 for (; i < j; i++) { if (preempt_dynamic_mode =3D=3D i) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 38e0e323dda26..fb4486ceb978a 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -3619,6 +3619,7 @@ extern int preempt_dynamic_mode; extern int sched_dynamic_mode(const char *str); extern void sched_dynamic_update(int mode); #endif +extern const char *preempt_modes[]; =20 #ifdef CONFIG_SCHED_MM_CID =20 --=20 2.47.2 From nobody Sun Feb 8 13:48:17 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 E823F204595 for ; Mon, 3 Feb 2025 14:16:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592208; cv=none; b=UTXrJNaq5r3NlfP785GPK0Ii4l8mrZp+2z1eZO3y8vXSRhMNbdDkogpkbc0wguudNMmOpdLZSiDC2D+tLIaGSVE5DesnG5a+p8mqxgJ76CxURgL6Cu6QsL4C1/H5cu71hBRQ1dAnCCX3HjQAeIWNimlREsE8zzamGaLWpPdkD7U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592208; c=relaxed/simple; bh=ra2thAmU8ozH0ETw5KywNHj7GHiO9m0XjN0qzhTk/sk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K8uObDItJBLa8v9esbGrhWMvvLDRtOZYv6EE/QSfJbZDdWanCVYvpj3vfLWsfgO1US9qWNxT6dtZ4izgPbSR7w2Xx4QWOP6J66VcRxWk77axi25Of4iLkoJVbInESIFlWecEVg7mK4ApQVnwWFejS6Wbz6X88eoRzJNhD6Ep2Ws= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LF3l01ac; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=iC4/nQxu; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LF3l01ac"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="iC4/nQxu" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738592205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V13yIzrzFM11r3zZVa4A30yIhnkQb3enn/TKqKVG4ak=; b=LF3l01ac2jy7YDc+QsiD+O8T3fpumEfH79CHIM+tyyWq9Jqn8mUe9Y4kj75D9oCluP0FOv Ev6FVaNoKLMvAFIUppvBNjeo5b1gQjM0LM/w8DRVA5SXvoiCXZxExO7tEoJygFDHT0VOVk tHC/TUcEctVcNISjcQdYGUdr58NoG4aT2y/yqLl4tCHKmSf7OY7TKePuGhvx3a0/02VVjt zQNiDBMCeJApX+VCI34Zg+66/ab1/kRQ3g2YE1LvcPgJz1yIupONAMAh8Q/ZtJi5tR2Www ou+O4drjAGczJVpvCI5WI9s62+WuIf/2YW13tGHXXvF+S0aZe268A34RUNQcFQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738592205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V13yIzrzFM11r3zZVa4A30yIhnkQb3enn/TKqKVG4ak=; b=iC4/nQxuXkp6ffIi9ljHP8b1U4bQvbWxiMmAGkIUNMxGIyb4IJUaOhfDdR0Z0qYHXsA0k1 dB4ofBg7whIYbdBQ== To: linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Cc: Ben Segall , Catalin Marinas , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Shrikanth Hegde , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Will Deacon , Sebastian Andrzej Siewior , Andrew Morton Subject: [PATCH v2 2/9] lib/dump_stack: Use preempt_model_str(). Date: Mon, 3 Feb 2025 15:16:25 +0100 Message-ID: <20250203141632.440554-3-bigeasy@linutronix.de> In-Reply-To: <20250203141632.440554-1-bigeasy@linutronix.de> References: <20250203141632.440554-1-bigeasy@linutronix.de> 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" Use preempt_model_str() to print the current preemption model. Use pr_warn() instead of printk() to pass a loglevel. This makes it part of generic WARN/ BUG traces. Cc: Andrew Morton Signed-off-by: Sebastian Andrzej Siewior --- lib/dump_stack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dump_stack.c b/lib/dump_stack.c index 388da1aea14a5..425556f3fd018 100644 --- a/lib/dump_stack.c +++ b/lib/dump_stack.c @@ -54,7 +54,7 @@ void __init dump_stack_set_arch_desc(const char *fmt, ...) */ void dump_stack_print_info(const char *log_lvl) { - printk("%sCPU: %d UID: %u PID: %d Comm: %.20s %s%s %s %.*s" BUILD_ID_FMT = "\n", + pr_warn("%sCPU: %d UID: %u PID: %d Comm: %.20s %s%s %s %.*s %s " BUILD_ID= _FMT "\n", log_lvl, raw_smp_processor_id(), __kuid_val(current_real_cred()->euid), current->pid, current->comm, @@ -62,7 +62,7 @@ void dump_stack_print_info(const char *log_lvl) print_tainted(), init_utsname()->release, (int)strcspn(init_utsname()->version, " "), - init_utsname()->version, BUILD_ID_VAL); + init_utsname()->version, preempt_model_str(), BUILD_ID_VAL); =20 if (get_taint()) printk("%s%s\n", log_lvl, print_tainted_verbose()); --=20 2.47.2 From nobody Sun Feb 8 13:48:17 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 643602046A2 for ; Mon, 3 Feb 2025 14:16:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592208; cv=none; b=YqNqUzGtdD5hEpW26qrBn39se4mxcRLNBcfHTcZb9hY4Yenf6xTaAd9k1w8u1hoIuhJpnzUBDtClUcG89mBDN6vGPp0dxjXGAa5RWv/V7z6cw6BcM84QcJGdqig6eiGTBaMqdtKXsTnrXyzbhFRWm0g+OdgibrQmPE6fB1NnnWY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592208; c=relaxed/simple; bh=s6LR4cD4L+E9V3LOC+CayprvaMN8VoutnxDA+SpvIeQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ck2d4H+UFdnRp804f/1pnff0yknSzN8PYbBiusnjVI6hPqcVAnnOFuL/9tAa77UiV5aWSVaPexv4LNz9Qc4ORFuJpcCg4znqUrbWyEyoZE4ej6gnPrls40s/IXeU8ClwzoZfwFCamr1hGIxv65ZTO+ELSl6t7rI/r+pIIzu7c3I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qolkE9Wo; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=XCGcyddB; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qolkE9Wo"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="XCGcyddB" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738592205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+4ulFTvDAefqAdJc6TUbpR3GW4CR8A3NjhobBVG3Dsg=; b=qolkE9Wo1YEPfFcnO64QkD+SJyUvuAh/21nheTEdSJz1Aqc1+H7HDJ1/LwAbmD6R3kT0fz NSuJbmEnfOYwxmy2MOga9jbOkPg39EBpryO5d7HZCnTx6KJteeY2Kw2LowkhkQ6MqkiSTP zAYkVC1JQGc+E7kFBIZ5Y6m6ZV12pK85U84MyvsSy9tbf4+HIJGmaVqfeFIAgroW9iLDdT ffDETyunDXAHTDDyeqxVsYv5WBFNntOuzId4ftexMqb6O8cOXLuskiEqpUm3d1t/lOuWzB PdgAFi1PTvF1xEi7HHC4Z+DIHL8ze/fRiv6bKwQMac6LpdJM0xVZZM9xhwhYsQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738592205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+4ulFTvDAefqAdJc6TUbpR3GW4CR8A3NjhobBVG3Dsg=; b=XCGcyddBg5I1tIU9Y/XRDUleszWy0XkjidrAz2iNusl1veVDgUwbxRAj5j58BW479NuOAZ lqraoF4mk2MWsSCg== To: linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Cc: Ben Segall , Catalin Marinas , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Shrikanth Hegde , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Will Deacon , Sebastian Andrzej Siewior , Russell King , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/9] arm: Rely on generic printing of preemption model. Date: Mon, 3 Feb 2025 15:16:26 +0100 Message-ID: <20250203141632.440554-4-bigeasy@linutronix.de> In-Reply-To: <20250203141632.440554-1-bigeasy@linutronix.de> References: <20250203141632.440554-1-bigeasy@linutronix.de> 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" __die() invokes later __show_regs() -> show_regs_print_info() which prints the current preemption model. Remove it from the initial line. Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Russell King (Oracle) --- arch/arm/kernel/traps.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 6ea645939573f..afbd2ebe5c39d 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -258,13 +258,6 @@ void show_stack(struct task_struct *tsk, unsigned long= *sp, const char *loglvl) barrier(); } =20 -#ifdef CONFIG_PREEMPT -#define S_PREEMPT " PREEMPT" -#elif defined(CONFIG_PREEMPT_RT) -#define S_PREEMPT " PREEMPT_RT" -#else -#define S_PREEMPT "" -#endif #ifdef CONFIG_SMP #define S_SMP " SMP" #else @@ -282,8 +275,8 @@ static int __die(const char *str, int err, struct pt_re= gs *regs) static int die_counter; int ret; =20 - pr_emerg("Internal error: %s: %x [#%d]" S_PREEMPT S_SMP S_ISA "\n", - str, err, ++die_counter); + pr_emerg("Internal error: %s: %x [#%d]" S_SMP S_ISA "\n", + str, err, ++die_counter); =20 /* trap and error numbers are mostly meaningless on ARM */ ret =3D notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV= ); --=20 2.47.2 From nobody Sun Feb 8 13:48:17 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 BA960205E06 for ; Mon, 3 Feb 2025 14:16:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592209; cv=none; b=Xh/QwpoUebZomR/YhbivNJ5l1uxhS1Z9imTXpzon9vNFoQGehuWje/KEyNIOGHQmUn73JjTUZa3Ap7EbhkXZ5Nm0CO1xJEnsvCDO2aG3bdIk+t4XXB2zBCvolwTPUX/enr3Nfy4086w9+z3sWAwuq3daRAeYw7JQg0x5O/QsOuI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592209; c=relaxed/simple; bh=aPpGpeN3KUlxNzmqdawwj6IhMjaxo0gfAhNIUX/rqqo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JIdeGjfrhu0WtNWIVGYkCIxSaFPP0eheNqqVYP6/fCeJgx3i2uiPyzbnfhUcvuvzG7Z7SevnHcBlyZA6BvCyjiD3BhmK0+OXYgN1fSvGyXk6ZNJGS6B2WLFXbDfyv5NnGYjwnvLoK294/zPsZxGOR6TG3cwEPFqUTRu/oXR7csU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=OAAvsyVf; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qQjoimea; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="OAAvsyVf"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qQjoimea" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738592206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JVykWfPj6hH80UBabvF2jVot4ICLdWiycKbgvtjRQrc=; b=OAAvsyVfJIXCTDV0jlmbfBRVNnFAHe2s/axWez929gL0/1SFj9CCtWFrIBDxrHVhLSdYt6 fehMewweBdKqQrNTtqxuFAxGTa/EkHsWHrhIrsdfPP45R7Pgar0l2Tbx55CpVGtff4IjeY W55Ri92Fzj9mYUxW0WisFiJFO5anm/O6fakD3WdKbKg7EpuRWnr2W2zWp6YAxQT4Wzl5NI a8V5LZIFkVcvX+24mPhx0Xgo9r85e8rCmmu9gkDiGL2kjPRA0+IMX+h1tLJ38tTSu/FRBl 3GFzrE+teMc8I/5iXnPIHH0BGy1aTzTw0V3+qAooJDXuDepXwDmlUZUXRQMQ9A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738592206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JVykWfPj6hH80UBabvF2jVot4ICLdWiycKbgvtjRQrc=; b=qQjoimeaG99ho0DbphIIPeIOyoN5S4z/BmH9EKPnuytCz1jWmC+iyLEcDyhSKbNEWQwAuB 4pOonPeDJP1YFxAQ== To: linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Cc: Ben Segall , Catalin Marinas , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Shrikanth Hegde , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Will Deacon , Sebastian Andrzej Siewior , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 4/9] arm64: Rely on generic printing of preemption model. Date: Mon, 3 Feb 2025 15:16:27 +0100 Message-ID: <20250203141632.440554-5-bigeasy@linutronix.de> In-Reply-To: <20250203141632.440554-1-bigeasy@linutronix.de> References: <20250203141632.440554-1-bigeasy@linutronix.de> 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" __die() invokes later show_regs() -> show_regs_print_info() which prints the current preemption model. Remove it from the initial line. Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Sebastian Andrzej Siewior Acked-by: Will Deacon --- arch/arm64/kernel/traps.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 4e26bd356a482..529cff825531c 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -172,14 +172,6 @@ static void dump_kernel_instr(const char *lvl, struct = pt_regs *regs) printk("%sCode: %s\n", lvl, str); } =20 -#ifdef CONFIG_PREEMPT -#define S_PREEMPT " PREEMPT" -#elif defined(CONFIG_PREEMPT_RT) -#define S_PREEMPT " PREEMPT_RT" -#else -#define S_PREEMPT "" -#endif - #define S_SMP " SMP" =20 static int __die(const char *str, long err, struct pt_regs *regs) @@ -187,7 +179,7 @@ static int __die(const char *str, long err, struct pt_r= egs *regs) static int die_counter; int ret; =20 - pr_emerg("Internal error: %s: %016lx [#%d]" S_PREEMPT S_SMP "\n", + pr_emerg("Internal error: %s: %016lx [#%d] " S_SMP "\n", str, err, ++die_counter); =20 /* trap and error numbers are mostly meaningless on ARM */ --=20 2.47.2 From nobody Sun Feb 8 13:48:17 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 0C7192063D4 for ; Mon, 3 Feb 2025 14:16:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592210; cv=none; b=mkaflc/2tw4G9IF5DTBcowlNToDSnbbs2VW6QV8u4HJlEDggni0gf0jS7WWeaA7y85lNsN40aOxaIrCL7PEa8jYMyIHZxJatrEJhI8z58Ly7ctrUNw0KP+U+Cqdc5aeBMJCI3Dda9bagxKzI65vs/1txjCjef5XidSGzJJH4NIA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592210; c=relaxed/simple; bh=PWKlchBpJd+N+9kqbMPU2hjG360lbQg1ywkcW+Pb9vo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EXpG839Z/cG4gna9r9CuvfL2kYrZchMMrUt+7pb3GDir0ucKqtNPUWAuqvNeLRDCtCTOdyDNTFc+3Vc3duKaWhWcCCGnHWYRUhZ6HGaQ+DQieZaak/vWnF8gbpA9ZBSGOhSm9isSnRRNwfSR7g3G3OJPrwo0/hmCZQa6uo4HnIM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=YqqVGci0; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WXIsAuM9; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YqqVGci0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WXIsAuM9" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738592206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VbMY7jhAkRshWc9tky24ybr6eQCno2dqBNRHKZaouzc=; b=YqqVGci0vNuMDu6dryL1TFq2lf6DnnkuJpqGzKYrMSQ5amO/4iEeohSKC2vVER14hKJfuZ XTqxGHdPWTeo5Q0oRyPwZGdK+kA9R7P8Mbfajh1vZ2tfNQrrftyuOFDYVbhtQjLvfYNpnM 0oGSfeqx/QWXjKufXvXOMl/c2/vUfV7rRUQQxJTzYnguz9lnTGUV1VaQU+N430o11YAz82 ltanqOdynmh+l8MjZtKSrgWqjYggVYwcgL6JDYmzjxd7pD5/zpA4ZXPA3zDFJp0Lu9aj+r nYe50d3btYwB0jzZUU9M+agqLh9hIKeDCAnu0MQEce/DpgKVwCmRhbU76OV8rQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738592206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VbMY7jhAkRshWc9tky24ybr6eQCno2dqBNRHKZaouzc=; b=WXIsAuM9UBBOBK8XE8F/E+Of6tdfOZdRK0oMxBxhwbhH9JVP2wEr0ek72jL5VC5ufclzd5 2OPzuhrMQGTgPuCg== To: linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Cc: Ben Segall , Catalin Marinas , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Shrikanth Hegde , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Will Deacon , Sebastian Andrzej Siewior , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 5/9] powerpc: Use preempt_model_str(). Date: Mon, 3 Feb 2025 15:16:28 +0100 Message-ID: <20250203141632.440554-6-bigeasy@linutronix.de> In-Reply-To: <20250203141632.440554-1-bigeasy@linutronix.de> References: <20250203141632.440554-1-bigeasy@linutronix.de> 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" Use preempt_model_str() instead of manually conducting the preemption model. Use pr_emerg() instead of printk() to pass a loglevel. Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Naveen N Rao Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Sebastian Andrzej Siewior --- arch/powerpc/kernel/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index edf5cabe5dfdb..9eb383189cfb2 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -263,10 +263,10 @@ static int __die(const char *str, struct pt_regs *reg= s, long err) { printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); =20 - printk("%s PAGE_SIZE=3D%luK%s%s%s%s%s%s %s\n", + pr_emerg("%s PAGE_SIZE=3D%luK%s %s %s%s%s%s %s\n", IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE", PAGE_SIZE / 1024, get_mmu_str(), - IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "", + preempt_model_str(), IS_ENABLED(CONFIG_SMP) ? " SMP" : "", IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=3D" __stringify(NR_CPUS)) : "", debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", --=20 2.47.2 From nobody Sun Feb 8 13:48:17 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 52E5D2063E3; Mon, 3 Feb 2025 14:16:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592211; cv=none; b=gHErJIoPgSxC1UUNOrlMGAQqANKMxJuuFy96YBV6mnDmuQycLx2tO7mYDIixvMOsZxN/0htGBaBOPuYn203pPgzvYU57COQ7g+9oylInGuaLDOxW6EnV+z4PyzmGoIfzvLgdQXS7zIRi/uN7Mbe295UCzHHqomhJtogtrVRt3io= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592211; c=relaxed/simple; bh=b+loM8yJYh32YROeOAXd4ziR4AXAC0u8e7nMQUX/Fd4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AaodEnr1p2ihM3K4mosNaOl+DtWo0zJKASLdpnVLbsA41JuT2T1M6bmQSNlozL+x3Btir+Y9D71O1MQbvNWEjtjSlfjJ+Rtf5N86ICoC677VK4WjB2b62ZOQpqgdlKjEl/XYF2uw+9UYKmCVfTqpmUFRkOa2YfBR8+3MOqLzDvY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qOev1tAx; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qG3s3WLZ; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qOev1tAx"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qG3s3WLZ" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738592207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dnAjnbiDbkQdywZgkGEyBzcKooPnQROG9QRQ+L6wVm8=; b=qOev1tAx6C+RVzlqSZ2392Zeb8cCE8l6POFionzfZ6fW6gtBNxpKrojsUE8B7CaI9cN+6D ALQBEeTLui66ft0Drd+QLBMiKK23mggetjX0WGsvZ4ZZbTUtkgKBlwYz62MNGmtrAuVijI 0Q141lDvEqEOGsGZkCLsTblL+n2Zc8VNrjOouw3lYSbAMB4/bu2ODZ3xFrnGlSDQFMAR5K gBi9BrniY/J/7Up5B8cOILyx/+XkJbwXoAoOo/iMpEyvsWooQe+flexorRRjSBfhOMmczR DOw9tkG9vVcZVpBEaEURlSISzXH1xPXW8ZQcnweQI9Q/BUEmhvAyfPNHx35h/g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738592207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dnAjnbiDbkQdywZgkGEyBzcKooPnQROG9QRQ+L6wVm8=; b=qG3s3WLZLVT4B3Ujl/+r8XbEWGulo88EnNLgXl9RKfbO11H9d2fr/1FwL05YOSvdCtybsY La2RfI5ZPrb7EbBw== To: linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Cc: Ben Segall , Catalin Marinas , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Shrikanth Hegde , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Will Deacon , Sebastian Andrzej Siewior , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , linux-s390@vger.kernel.org Subject: [PATCH v2 6/9] s390: Rely on generic printing of preemption model. Date: Mon, 3 Feb 2025 15:16:29 +0100 Message-ID: <20250203141632.440554-7-bigeasy@linutronix.de> In-Reply-To: <20250203141632.440554-1-bigeasy@linutronix.de> References: <20250203141632.440554-1-bigeasy@linutronix.de> 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" die() invokes later show_regs() -> show_regs_print_info() which prints the current preemption model. Remove it from the initial line. Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: linux-s390@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Acked-by: Heiko Carstens --- arch/s390/kernel/dumpstack.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/s390/kernel/dumpstack.c b/arch/s390/kernel/dumpstack.c index 1ecd0580561f6..542098678189e 100644 --- a/arch/s390/kernel/dumpstack.c +++ b/arch/s390/kernel/dumpstack.c @@ -198,13 +198,8 @@ void __noreturn die(struct pt_regs *regs, const char *= str) console_verbose(); spin_lock_irq(&die_lock); bust_spinlocks(1); - printk("%s: %04x ilc:%d [#%d] ", str, regs->int_code & 0xffff, - regs->int_code >> 17, ++die_counter); -#ifdef CONFIG_PREEMPT - pr_cont("PREEMPT "); -#elif defined(CONFIG_PREEMPT_RT) - pr_cont("PREEMPT_RT "); -#endif + pr_emerg("%s: %04x ilc:%d [#%d]", str, regs->int_code & 0xffff, + regs->int_code >> 17, ++die_counter); pr_cont("SMP "); if (debug_pagealloc_enabled()) pr_cont("DEBUG_PAGEALLOC"); --=20 2.47.2 From nobody Sun Feb 8 13:48:17 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 AECE12063F6 for ; Mon, 3 Feb 2025 14:16:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592212; cv=none; b=OWBR78+TKKX0C4r53aZ+zbuGKg2uBEfOH7qu3YOJ3vdClLuW3wDxrCckVuuptTttPR/iaVLhUymzV3oXBZtBnNbbsoMBHelja5c6QdKVEXYS93dPwifKseslsJb1oB1dRpukH3vZIRUn9hwaf1ytdb9iV8TqtLv+s+dq078Gopk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592212; c=relaxed/simple; bh=hK1A6zIsrNJAovrrv0VlTMANs2MhQLrSeZf+N+Ilra4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p6A9JNhjUE2XhLwrygaezL78LsNcjaI7bWb4YGLcebS4ycL7lg9tOsUZj+Wq1e1+nWYP/Jr7AaiFMy2b272w5b+gHXYhm7GTQMgGT+uLtsFYpC8K9rJUR3lr56WkQ1Wvq8l6/+v5Qz9p832puBQgm2PAepD9diGsxBJhcgrVJs8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=iUUGvDyB; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=DCJLKVB0; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="iUUGvDyB"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="DCJLKVB0" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738592207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/1nmWywTWzJzDcPVwkzbvEHu1zvcPiY8k6qmYTOWby8=; b=iUUGvDyBJrA7c57inT21YOu8ZGBfhpvN2ZPc1wUQ0LZ7j1MwniZpFBN897AY4tBwcAKxp4 lpcdrzhQhjp4MUj4IK4PLHPVysC9yb465Cb1FET+G6AYqVAoFfT+1M8o+JvoLeKNLIQfkD wjZDn/A0rA1rEwLs4PZI/i4DP7MsfwwY6NkDQcGUrHX4RWkUYuO8pbmrOMDU0uT4iplxlf 1A1NbwajnOE9NN0vXctsatvQowPETzmaUj4tVlqNlhPalfBNBJz0tXFKAtUsefjzJiD3EJ Lx+JTiTYdikNn34kOZLspQLmhY/oFoH63eKQuSyHAXctrpVDt4MN+eaMwAzDNA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738592207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/1nmWywTWzJzDcPVwkzbvEHu1zvcPiY8k6qmYTOWby8=; b=DCJLKVB0wS/pJHnxQ7GqNHr4u3FHrpkpY1Dd5QrouEPyu6obnl3lePm4ISH+pJTsoJisem cZrzw0HN+s4qktCQ== To: linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Cc: Ben Segall , Catalin Marinas , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Shrikanth Hegde , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Will Deacon , Sebastian Andrzej Siewior , Josh Poimboeuf , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Subject: [PATCH v2 7/9] x86: Rely on generic printing of preemption model. Date: Mon, 3 Feb 2025 15:16:30 +0100 Message-ID: <20250203141632.440554-8-bigeasy@linutronix.de> In-Reply-To: <20250203141632.440554-1-bigeasy@linutronix.de> References: <20250203141632.440554-1-bigeasy@linutronix.de> 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" After __die_header(), __die_body() is always invoked. There we have show_regs() -> show_regs_print_info() which prints the current preemption model. Remove it from the initial line. Cc: Josh Poimboeuf Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/kernel/dumpstack.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index a7d562697e50e..91639d1e4ec2c 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c @@ -395,18 +395,13 @@ NOKPROBE_SYMBOL(oops_end); =20 static void __die_header(const char *str, struct pt_regs *regs, long err) { - const char *pr =3D ""; - /* Save the regs of the first oops for the executive summary later. */ if (!die_counter) exec_summary_regs =3D *regs; =20 - if (IS_ENABLED(CONFIG_PREEMPTION)) - pr =3D IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT"; - printk(KERN_DEFAULT - "Oops: %s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, - ++die_counter, pr, + "Oops: %s: %04lx [#%d]%s%s%s%s\n", str, err & 0xffff, + ++die_counter, IS_ENABLED(CONFIG_SMP) ? " SMP" : "", debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", IS_ENABLED(CONFIG_KASAN) ? " KASAN" : "", --=20 2.47.2 From nobody Sun Feb 8 13:48:17 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 CDB8F2063FC for ; Mon, 3 Feb 2025 14:16:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592211; cv=none; b=Vn94y+jExD7liCRtTiKvN438stXWXfOaKZgwG/s3IjhHNBpoR5Ch9pMoykHarPKf2Uvn1A+YM76TJ5WgZ1mguRJ7q2SjWA2Z2YSLjiRpvbK7D2BoaeU2E+uboyquZ8MMAgP+aL/5GC5S3GOra+yc1Lla2Z9UBJdYJOQpDCSy6ok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592211; c=relaxed/simple; bh=mR6vPOjdkBTEdRSlAl2s/rFalP/2IlJiRUYhKvRs1Wk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pL5xIhkTWx8ZeqLiYLGqKgV+2c4W+PFv/pmI0XXfnR/P09LP6uH9fBtMmRW1n2zh0V8lWMiPIFilyYVMKQdIiasLgIsvZ6D1kc1IDR+ItIDSvUqA1JSEytv48ANEX/k4giGiPDuDxio/gqqTiRPJjYPcGfLda2oxv1vNbeqZG3k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=fa2pGKEz; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2ggrNndh; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="fa2pGKEz"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2ggrNndh" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738592208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m0V5ulaONnLToG07tiQ1kzrRUASrctk1BlR8nwnpSIU=; b=fa2pGKEzmwGixw0PPg9eEw1rs7GM/afNRYkoYQMeft0a4FBTh8ofpR751iqqQBlV8EJSDL FMhnnHlF5Utbdv3j+OYsl4pWxENAGL06nsg0SpnEhoYiI84T7hEkMP3AdPVadU3NCvK/vA lCf2FbWI+RbyRR9lgk8VpgnvVgo2sC7HTKZh7VyGzD3PUF+YzSNBZXAdxdVIKwKdZC4l2U DCFrlXlxWfzYcCqneUCloNdXLW+UmhPJ1kbYJBC/+aliOykZL4EGARtsibtfpFGJB6kFFG tZLe94y1THHStfqoptnOCTtzqY0/KagL0OvAysrMEIph8CCMGdnTl2bAKFKWuA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738592208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m0V5ulaONnLToG07tiQ1kzrRUASrctk1BlR8nwnpSIU=; b=2ggrNndhlZgjqGyOaTjuqRZKvC5AXFzUlrEvERzBH0iQrlO8Ag2yQhE9FDQysMJLYhAQfx o7YQcDjrkYlr8hBw== To: linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Cc: Ben Segall , Catalin Marinas , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Shrikanth Hegde , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Will Deacon , Sebastian Andrzej Siewior , Chris Zankel , Max Filippov Subject: [PATCH v2 8/9] xtensa: Use preempt_model_str(). Date: Mon, 3 Feb 2025 15:16:31 +0100 Message-ID: <20250203141632.440554-9-bigeasy@linutronix.de> In-Reply-To: <20250203141632.440554-1-bigeasy@linutronix.de> References: <20250203141632.440554-1-bigeasy@linutronix.de> 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" Use preempt_model_str() instead of manually conducting the preemption model. Cc: Chris Zankel Cc: Max Filippov Signed-off-by: Sebastian Andrzej Siewior Acked-by: Max Filippov --- arch/xtensa/kernel/traps.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index 38092d21acf8e..a7b1e4ad112e8 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c @@ -629,15 +629,11 @@ DEFINE_SPINLOCK(die_lock); void __noreturn die(const char * str, struct pt_regs * regs, long err) { static int die_counter; - const char *pr =3D ""; - - if (IS_ENABLED(CONFIG_PREEMPTION)) - pr =3D IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT"; =20 console_verbose(); spin_lock_irq(&die_lock); =20 - pr_info("%s: sig: %ld [#%d]%s\n", str, err, ++die_counter, pr); + pr_info("%s: sig: %ld [#%d] %s\n", str, err, ++die_counter, preempt_model= _str()); show_regs(regs); if (!user_mode(regs)) show_stack(NULL, (unsigned long *)regs->areg[1], KERN_INFO); --=20 2.47.2 From nobody Sun Feb 8 13:48:17 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 4034E1EEF9; Mon, 3 Feb 2025 14:16:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592211; cv=none; b=kOlOw+Qz0CqVXXemR+N/qQJRk8st82gxizFoLy6YFH0RQaJQtmZzzBTHnvVQG+rQLSVtTiZYac/DpBqL2B8q4muWMtqE03vICvZuDRXnGRqwUcyDx64Xd7KTJf4AyE23x3fgrdFe6r97az0O0vCwLct905v/Z4TMA4NOxAIngUk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738592211; c=relaxed/simple; bh=25O/yp6UnkbO77kBkc7PxJ4KzqrbhWQScdgzucAMvtE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QtvjNnmbjdIVpvsgHjMtpQiWtzj+GCcohW0pFhbZ8JA/E2g38GpgvNpR9Z/0AFvOq6rknlaCXBccBqFpXcKEZFcZyVcySQqBMrgks0ieD8sZzEAtHq/Z1Mh6ED8Eh5dxH3iTxiQZVAStfIk2UH5Zv90YmLj+zFPI+aJOpCurSaI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=hTRuqSGF; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=SwmMtGXX; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hTRuqSGF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="SwmMtGXX" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738592208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BK05d/1mfk1oZVQnNoGYNIpEo3eku4M94weqeHOTRAw=; b=hTRuqSGFY1vnL4Ofc1Mw/T6rl8rOe6nK/S/z02ouwF18ep2BVBP9bcNCCOm5UiSu6Kfd9O Mh2w2PeSsoYZrn9UyHzK7+L8fZNkBS3VlK4Yh87u2FIgi6hN74J5CDaOP5FJ8vgpcV0BTw fTTBmgAwXIxPm8y8u7SYg1hzxRXIVSO/pC65sKddSCgtIEPaC1UOAZZiUqOhVTE1CKgoEm 6oUYcpnecUZFbL+nAknWQidqmmg/FanSsFYbDzNMTxBw9UmJtvK1bbHpthkqqi4nU9wewD jVUgFoz+MV/OiJuPatsYn1sMyKnOZtOXG5S/GVRelRQOtNfklNTJ1tRosQsabA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738592208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BK05d/1mfk1oZVQnNoGYNIpEo3eku4M94weqeHOTRAw=; b=SwmMtGXXF7NHVNDd/yYy+H+f3JpafdNAYmrniD0Lx+pv1X4U73IYtocFPD3B4qJG7lpIXw e9fIrsF+WhDOXGAw== To: linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Cc: Ben Segall , Catalin Marinas , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Shrikanth Hegde , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Will Deacon , Sebastian Andrzej Siewior , Masami Hiramatsu , Mathieu Desnoyers , linux-trace-kernel@vger.kernel.org Subject: [PATCH v2 9/9] tracing: Use preempt_model_str(). Date: Mon, 3 Feb 2025 15:16:32 +0100 Message-ID: <20250203141632.440554-10-bigeasy@linutronix.de> In-Reply-To: <20250203141632.440554-1-bigeasy@linutronix.de> References: <20250203141632.440554-1-bigeasy@linutronix.de> 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" Use preempt_model_str() instead of manually conducting the preemption model. Cc: Steven Rostedt Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: linux-trace-kernel@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Acked-by: Steven Rostedt (Google) --- kernel/trace/trace.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 1496a5ac33ae1..77271faab20e9 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -4100,12 +4100,7 @@ print_trace_header(struct seq_file *m, struct trace_= iterator *iter) entries, total, buf->cpu, - preempt_model_none() ? "server" : - preempt_model_voluntary() ? "desktop" : - preempt_model_full() ? "preempt" : - preempt_model_lazy() ? "lazy" : - preempt_model_rt() ? "preempt_rt" : - "unknown", + preempt_model_str(), /* These are reserved for later use */ 0, 0, 0, 0); #ifdef CONFIG_SMP --=20 2.47.2