From: Valentin Schneider <valentin.schneider@arm.com>
To: linux-kernel@vger.kernel.org
Cc: Frederic Weisbecker <frederic@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH] preempt: Allow CONFIG_DEBUG_PREEMPT for CONFIG_PREEMPT_VOLUNTARY
Date: Wed, 7 Jul 2021 20:23:06 +0100 [thread overview]
Message-ID: <20210707192306.2297497-1-valentin.schneider@arm.com> (raw)
While recently staring at some preempt_count dumpster fire for a
CONFIG_PREEMPT_VOLUNTARY kernel, I wished I could turn on
CONFIG_DEBUG_PREEMPT on top of CONFIG_DEBUG_ATOMIC_SLEEP to see *where*
preemption had been disabled. It didn't take much to get that, and although
it didn't help my particular case, I think it can still be useful.
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
---
kernel/sched/core.c | 3 +--
lib/Kconfig.debug | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 0c22cd026440..5673b85fa22d 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5109,8 +5109,7 @@ static inline void sched_tick_start(int cpu) { }
static inline void sched_tick_stop(int cpu) { }
#endif
-#if defined(CONFIG_PREEMPTION) && (defined(CONFIG_DEBUG_PREEMPT) || \
- defined(CONFIG_TRACE_PREEMPT_TOGGLE))
+#if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_TRACE_PREEMPT_TOGGLE)
/*
* If the value passed in is equal to the current preempt count
* then we just disabled preemption. Start timing the latency.
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 678c13967580..7fdd45eee343 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1204,7 +1204,7 @@ config DEBUG_TIMEKEEPING
config DEBUG_PREEMPT
bool "Debug preemptible kernel"
- depends on DEBUG_KERNEL && PREEMPTION && TRACE_IRQFLAGS_SUPPORT
+ depends on DEBUG_KERNEL && PREEMPT_COUNT && TRACE_IRQFLAGS_SUPPORT
default y
help
If you say Y here then the kernel will use a debug variant of the
--
2.25.1
next reply other threads:[~2021-07-07 19:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-07 19:23 Valentin Schneider [this message]
2021-07-08 11:37 ` Frederic Weisbecker
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=20210707192306.2297497-1-valentin.schneider@arm.com \
--to=valentin.schneider@arm.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®