mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Mark Rutland <mark.rutland@arm.com>, <linux-kernel@vger.kernel.org>
Cc: <frederic@kernel.org>, <jstultz@google.com>,
	<juri.lelli@redhat.com>, <meted@linux.ibm.com>,
	<mingo@redhat.com>, <peterz@infradead.org>,
	<sshegde@linux.ibm.com>, <tglx@linutronix.de>,
	<vincent.guittot@linaro.org>, <vschneid@redhat.com>
Subject: Re: [PATCH v2 0/6] sched: dynamic: Simplify PREEMPT_DYNAMIC
Date: Fri, 7 Aug 2026 11:33:05 +0800	[thread overview]
Message-ID: <3f3191c6-d41f-4c4c-82df-7ed2cb8cbd84@huawei.com> (raw)
In-Reply-To: <20260803191731.3244294-1-mark.rutland@arm.com>



在 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 <ruanjinjie@huawei.com>

> 
> 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(-)
> 


      parent reply	other threads:[~2026-08-07  3:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 19:17 Mark Rutland
2026-08-03 19:17 ` [PATCH v2 1/6] sched: dynamic: Make PREEMPT_DYNAMIC depend on ARCH_HAS_PREEMPT_LAZY Mark Rutland
2026-08-03 19:17 ` [PATCH v2 2/6] sched: dynamic: Simplify {cond,might}_resched() Mark Rutland
2026-08-05 10:08   ` Jinjie Ruan
2026-08-03 19:17 ` [PATCH v2 3/6] sched: dynamic: Simplify preempt_schedule{,_notrace}() Mark Rutland
2026-08-06 13:23   ` Jinjie Ruan
2026-08-03 19:17 ` [PATCH v2 4/6] sched: dynamic: Simplify irqentry_exit_cond_resched() Mark Rutland
2026-08-07  1:35   ` Jinjie Ruan
2026-08-03 19:17 ` [PATCH v2 5/6] sched: dynamic: Remove HAVE_PREEMPT_DYNAMIC_{CALL,KEY} Mark Rutland
2026-08-07  1:54   ` Jinjie Ruan
2026-08-03 19:17 ` [PATCH v2 6/6] sched: dynamic: Simplify preempt model accessors Mark Rutland
2026-08-07  2:00   ` Jinjie Ruan
2026-08-05  9:52 ` [PATCH v2 0/6] sched: dynamic: Simplify PREEMPT_DYNAMIC Mete Durlu
2026-08-06 12:15 ` Shrikanth Hegde
2026-08-07  3:11 ` Jinjie Ruan
2026-08-07  3:33 ` Jinjie Ruan [this message]

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=3f3191c6-d41f-4c4c-82df-7ed2cb8cbd84@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=frederic@kernel.org \
    --cc=jstultz@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=meted@linux.ibm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sshegde@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /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®