From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout08.his.huawei.com (canpmsgout08.his.huawei.com [113.46.200.223]) (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 1D20A3BADB1 for ; Fri, 7 Aug 2026 02:00:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.223 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786068057; cv=none; b=ucapzX2av6xxegSgwsjQ8fbPKmFwHxm+ebDta6DD/BpkVbacThXOLuub9CITC1DsAQkw213XqbKPOIjXgWpXL6zhydejjp+Y0TRPq/5WIPST2X2gRlIxyzGEIBk/E1D61kV3ms7aYotNZKPhnkjKVBENAVkRtw8cIj7lAm6cz1M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786068057; c=relaxed/simple; bh=s0P5LcZVKbEmM9Mo6Uiq/ENBC6EWO8ariHjGs5u0OYY=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=hCjfE9bopZhzaGWvlq5y7A/2p3iYdO9UDbUZClMYHg/Je8nQU9pAWwdJbjeYAtwTw9uWv7LdkHgjuUe+74P3TKP8el74seA1U8zn1ZQR+r1LkF2w2AiC8J+qFApjG3VdOrqBFTeW+wib5AFmaMCucf+k71oz++71RPN9q1WKcBg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=uueC+une; arc=none smtp.client-ip=113.46.200.223 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="uueC+une" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=IsjHdpKbPGK90LUVdiRSF7vlHIDTOh55XFMT7hNosz8=; b=uueC+une/fnkOBYoo4rOiHxwBki+71aFJqkBOc0+e0rLnbthcuhWUYFWHHyBLv+67DBtS4Xad ZZM1ejPS6EMOpklYuHGh6yLIJNfvTWIK3sEBtMoWSmzXnjRL8gRuNznDP/CZvBhhjAxPLYb4ti6 WSVz49Jy9MAy8CPS5SOz6iw= Received: from mail.maildlp.com (unknown [172.19.163.200]) by canpmsgout08.his.huawei.com (SkyGuard) with ESMTPS id 4hGRtD328fzmV8f; Fri, 7 Aug 2026 09:50:12 +0800 (CST) Received: from dggpemf500011.china.huawei.com (unknown [7.185.36.131]) by mail.maildlp.com (Postfix) with ESMTPS id 3325D40563; Fri, 7 Aug 2026 10:00:46 +0800 (CST) Received: from [10.67.109.254] (10.67.109.254) by dggpemf500011.china.huawei.com (7.185.36.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 7 Aug 2026 10:00:45 +0800 Message-ID: Date: Fri, 7 Aug 2026 10:00:44 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 6/6] sched: dynamic: Simplify preempt model accessors To: Mark Rutland , CC: , , , , , , , , , References: <20260803191731.3244294-1-mark.rutland@arm.com> <20260803191731.3244294-7-mark.rutland@arm.com> From: Jinjie Ruan In-Reply-To: <20260803191731.3244294-7-mark.rutland@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To dggpemf500011.china.huawei.com (7.185.36.131) 在 2026/8/4 3:17, Mark Rutland 写道: > 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 Signed-off-by: Mark Rutland > 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 > [...] > + > 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, Hi Mark, Should the annotations for NONE and VOLUNTARY be removed simultaneously? --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7788,12 +7788,6 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); # endif /* - * NONE: - * (unselectable) - * - * VOLUNTARY: - * (unselectable) - * * FULL: * dynamic_preempt_lazy <- false * Otherwise, LGTM Reviewed-by: Jinjie Ruan > }; > @@ -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); >