From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout06.his.huawei.com (canpmsgout06.his.huawei.com [113.46.200.221]) (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 0B35A155A5D for ; Fri, 7 Aug 2026 03:33:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.221 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786073594; cv=none; b=AM1FxZYrIehf7jhZ2E9V2Rp+Dclpm/jOiMeCRGr/JmOiRtZFzkAofKXBdhCCgBbr0gcYbVREbB5pZ5dvfTEIFrcfu4TRFC/VRUU9SjlGe8mbUUF6Ki6ZYj4zJW2WaD5KDx+z51V3YC+G1DltnuLEakj1HfWlrxZJdRe96xnARGQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786073594; c=relaxed/simple; bh=G9Z1imR4NSTE6TnIcNauJFJFyQeFLqU5dHoPO7mAdCs=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=k7qsPjxo77b/7mQTYGgIVwZk/bzrvYGR4nz8rbW1wmAIP21ozE8Kd5RukFkbzBk5wZuokvQUWFLh+XFgiDHyU0I71ZRAZcBL3wbbO+tqGUZdFBFxUqqoLRhxd5xV4X4q52m+k+uvm983HdmzxmDQlrMC7q4G77j9GjgDdmdxYbA= 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=ULh2c2fO; arc=none smtp.client-ip=113.46.200.221 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="ULh2c2fO" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=txGM8Wxlyn1j8sauKKPaDOI5pkSt+HJQ7FpgCJeI0KM=; b=ULh2c2fO4KtFC0TmUKuDro4/h7dyz+b0Vam8PGyI9GLQM9O+7FmXFiECruO2rSN9FMLsDAZkK Q51qZOOdp+CCrU+KVoZCnsiQuzDPrEaG3Qw7nd2zLFbIREzdz2+Ob3kNLW1h4PBN7QfVrj3k4HD 7BimD9LOQO1FiPF1EHh4UNk= Received: from mail.maildlp.com (unknown [172.19.163.0]) by canpmsgout06.his.huawei.com (SkyGuard) with ESMTPS id 4hGTwp6XnVzRhQt; Fri, 7 Aug 2026 11:22:34 +0800 (CST) Received: from dggpemf500011.china.huawei.com (unknown [7.185.36.131]) by mail.maildlp.com (Postfix) with ESMTPS id 0B04C40561; Fri, 7 Aug 2026 11:33:07 +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 11:33:06 +0800 Message-ID: <3f3191c6-d41f-4c4c-82df-7ed2cb8cbd84@huawei.com> Date: Fri, 7 Aug 2026 11:33:05 +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 0/6] sched: dynamic: Simplify PREEMPT_DYNAMIC To: Mark Rutland , CC: , , , , , , , , , References: <20260803191731.3244294-1-mark.rutland@arm.com> From: Jinjie Ruan In-Reply-To: <20260803191731.3244294-1-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 写道: > All architectures which currently suppoort PREEMPT_DYNAMIC select > ARCH_HAS_PREEMPT_LAZY. On architectures which select > ARCH_HAS_PREEMPT_LAZY, it has not been possible to select the NONE and > VOLUNTARY preemption models since v7.0 due to commit: > > 7dadeaa6e851 ("sched: Further restrict the preemption modes") > > Hence in practice PREEMPT_DYNAMIC no longer supports the NONE or > VOLUNTARY preemption models. > > This series makes the de-facto situation official by making > PREEMPT_DYNAMIC depend on ARCH_HAS_PREEMPT_LAZY, and removing redundant > code. > > Since v1, I've had to rebase atop v7.2-rc4 to avoid a conflict with > commit: > > a2c02aa0c6ca ("powerpc: Remove dead non-preemption code") > > Given this is now late in the cycle, and given the tip:sched/core branch > is based on v7.2-rc1, I suspect tip folk might not want to queue this > now. Please let me know what you'd prefer; I'm happy to rebase and > resend after v7.3-rc1. > > Since v1: > * Rebase to v7.2-rc4 > * Apply Revied-by tags. > * Fix typos in commit messages. > * Add patch to cleanup accessors (per Shrikanth's comment) Hi Mark, I did a test on v7.2-rc6 for arm64. # ls -la Image_base Image_patch -rw-r--r-- 1 root root 63158784 Aug 7 10:37 Image_base -rw-r--r-- 1 root root 63093248 Aug 7 10:31 Image_patch # ls -la vmlinux_base vmlinux_patch -rwxr-xr-x 1 root root 206396648 Aug 7 10:37 vmlinux_base -rwxr-xr-x 1 root root 206266232 Aug 7 10:31 vmlinux_patch So the overall vmlinux file size reduced by ~127 KB and the Image size reduced by ~64 KB. Boot tested successfully with preempt=lazy and preempt=full on Qemu and Kunpeng HIP09 server. Boot with preempt=none and preempt=voluntary on Qemu. Dynamic Preempt: unsupported mode: none Dynamic Preempt: unsupported mode: voluntary But runtime switching via /sys/kernel/debug/sched/preempt works not right as below. # echo full > preempt # cat preempt full lazy # echo lazy > preempt # cat preempt full lazy We should also update the "preempt_modes" array, after the below fix, it shows ok; # echo lazy > preempt [ 37.407616] Dynamic Preempt: lazy # cat preempt full (lazy) # echo full > preempt [ 52.067001] Dynamic Preempt: full # cat preempt (full) lazy --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7899,7 +7899,7 @@ static inline void preempt_dynamic_init(void) { } #endif /* CONFIG_PREEMPT_DYNAMIC */ const char *preempt_modes[] = { - "none", "voluntary", "full", "lazy", NULL, + "full", "lazy", NULL, }; Otherwise Tested-by: Jinjie Ruan > > Mark. > > Mark Rutland (6): > sched: dynamic: Make PREEMPT_DYNAMIC depend on ARCH_HAS_PREEMPT_LAZY > sched: dynamic: Simplify {cond,might}_resched() > sched: dynamic: Simplify preempt_schedule{,_notrace}() > sched: dynamic: Simplify irqentry_exit_cond_resched() > sched: dynamic: Remove HAVE_PREEMPT_DYNAMIC_{CALL,KEY} > sched: dynamic: Simplify preempt model accessors > > arch/Kconfig | 38 ------- > arch/arm64/Kconfig | 1 - > arch/arm64/include/asm/preempt.h | 10 -- > arch/loongarch/Kconfig | 1 - > arch/powerpc/Kconfig | 1 - > arch/riscv/Kconfig | 1 - > arch/s390/Kconfig | 1 - > arch/s390/include/asm/preempt.h | 11 -- > arch/x86/Kconfig | 1 - > arch/x86/include/asm/preempt.h | 28 ----- > include/asm-generic/preempt.h | 10 -- > include/linux/irq-entry-common.h | 17 +-- > include/linux/kernel.h | 20 ---- > include/linux/preempt.h | 20 ++-- > include/linux/sched.h | 31 +----- > kernel/Kconfig.preempt | 9 +- > kernel/entry/common.c | 17 +-- > kernel/sched/core.c | 180 +------------------------------ > 18 files changed, 23 insertions(+), 374 deletions(-) >