From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F43743553A for ; Mon, 3 Aug 2026 19:18:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784685; cv=none; b=TV1DyWVqn9JDbdKJkgyPGxVXQjiHGyWJ+umJnZW5NEQqcPHkPmwtKAO5gGCB4vF452kW9Tf/xEpnQcDjZGjehiJ8tsFg1CM9rFwfUlT2tRzT5C3h77nU8lddNITpbKMaZKJ2/xPELBaSHtjPFMXuEw/XIgEcrBqM+3YHLQ2i1G4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784685; c=relaxed/simple; bh=kepVc1+bEjeJXn/nFaWnz09wtUqciqLEa8HMXqOoxIg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NKrhHSkLVKQLTDwISVZBNI9fcL9vqx2hba73wCmeb9emTvhRYyxFZ0tw+lpz57Npn3vMddUlSNtKAMXcZQb8+Wi+03i9XhWko1C/Oc2VfyZOoOtu/Xn5VqJ3+s+eyPdG1OQsA7KpNvw0yfJuVrHkPX2TW3wAmXgqLhmKjq6uX2g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=g0IJxame; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="g0IJxame" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A5678143D; Mon, 3 Aug 2026 12:17:58 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CA0AB3F632; Mon, 3 Aug 2026 12:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785784682; bh=kepVc1+bEjeJXn/nFaWnz09wtUqciqLEa8HMXqOoxIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g0IJxamex71RJhV8SrcqyHB0SdfJ8SqIhFz4PSTzLiYSROuVjQlkZ1LdOkKdiHar3 SkTF6LC6fJWDl098DOwDkGQoKuK7kesWrAXnTgQf6nK1FaUtJ37JI9HNp4/cpvubew idbrBbirQL1Vn+FZ5GDIwtReGNujtJR3EGrUD5No= From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: frederic@kernel.org, jstultz@google.com, juri.lelli@redhat.com, mark.rutland@arm.com, meted@linux.ibm.com, mingo@redhat.com, peterz@infradead.org, ruanjinjie@huawei.com, sshegde@linux.ibm.com, tglx@linutronix.de, vincent.guittot@linaro.org, vschneid@redhat.com Subject: [PATCH v2 6/6] sched: dynamic: Simplify preempt model accessors Date: Mon, 3 Aug 2026 20:17:31 +0100 Message-Id: <20260803191731.3244294-7-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20260803191731.3244294-1-mark.rutland@arm.com> References: <20260803191731.3244294-1-mark.rutland@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit PREEMPT_DYNAMIC is now limited to the FULL and LAZY preemption models. When CONFIG_PREEMPT_DYNAMIC=y, the NONE and VOLUNTARY models cannot be used, and neither CONFIG_PREEMPT_NONE nor CONFIG_PREEMPT_VOLUNTARY can be selected. Simplify the preempt model accessors accordingly: remove the out-of-line implementations of preempt_model_none() and preempt_model_voluntary(), and remove the preempt_dynamic_{none,voluntary} values. There are no current users of preempt_model_voluntary(), but I've kept it around for consistency, with every scheduler model having its own preempt_model_*() accessor. Suggested-by: Shrikanth Hegde Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: John Stultz Cc: Juri Lelli Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Thomas Gleixner Cc: Valentin Schneider Cc: Vincent Guittot --- include/linux/preempt.h | 20 ++++++++++---------- kernel/sched/core.c | 4 ---- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/linux/preempt.h b/include/linux/preempt.h index d964f965c8ffc..7e2ec8e29c83f 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -470,21 +470,11 @@ DEFINE_LOCK_GUARD_0(preempt_notrace, preempt_disable_notrace(), preempt_enable_n #ifdef CONFIG_PREEMPT_DYNAMIC -extern bool preempt_model_none(void); -extern bool preempt_model_voluntary(void); extern bool preempt_model_full(void); extern bool preempt_model_lazy(void); #else -static inline bool preempt_model_none(void) -{ - return IS_ENABLED(CONFIG_PREEMPT_NONE); -} -static inline bool preempt_model_voluntary(void) -{ - return IS_ENABLED(CONFIG_PREEMPT_VOLUNTARY); -} static inline bool preempt_model_full(void) { return IS_ENABLED(CONFIG_PREEMPT); @@ -497,6 +487,16 @@ static inline bool preempt_model_lazy(void) #endif +static inline bool preempt_model_none(void) +{ + return IS_ENABLED(CONFIG_PREEMPT_NONE); +} + +static inline bool preempt_model_voluntary(void) +{ + return IS_ENABLED(CONFIG_PREEMPT_VOLUNTARY); +} + static inline bool preempt_model_rt(void) { return IS_ENABLED(CONFIG_PREEMPT_RT); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 7b815d8ce67d3..4026f2399edf3 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7803,8 +7803,6 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); enum { preempt_dynamic_undefined = -1, - preempt_dynamic_none, - preempt_dynamic_voluntary, preempt_dynamic_full, preempt_dynamic_lazy, }; @@ -7889,8 +7887,6 @@ static void __init preempt_dynamic_init(void) } \ EXPORT_SYMBOL_GPL(preempt_model_##mode) -PREEMPT_MODEL_ACCESSOR(none); -PREEMPT_MODEL_ACCESSOR(voluntary); PREEMPT_MODEL_ACCESSOR(full); PREEMPT_MODEL_ACCESSOR(lazy); -- 2.30.2