Re: [PATCH] perf/x86: Add cond_resched() when allocate/release DS buffers
From: Namhyung Kim
Date: Tue Oct 28 2025 - 15:03:00 EST
Hi Peter,
On Tue, Oct 28, 2025 at 04:27:47PM +0100, Peter Zijlstra wrote:
> On Tue, Oct 28, 2025 at 03:15:18PM +0100, Peter Zijlstra wrote:
> > On Mon, Oct 27, 2025 at 02:27:24PM -0700, Namhyung Kim wrote:
> > > On large systems, it's possible to trigger sched latency warning during
> > > the DS buffer allocation or release. Add cond_resched() to avoid it.
> >
> > We're >.< close to deleting cond_resched(), it makes absolutely no sense
> > adding more.
>
> Specifically, IIRC the plan was to do something like the below after the
> next LTS release, and then continue to remove VOLUNTARY in subsequent
> releases, leaving NONE the only option for the legacy architectures that
> do not support preemption.
Thanks for your review!
I haven't followed the work in this area so was not aware of the
PREEMPT_LAZY. Looks great! I hope it'll work well on server platforms
with many batch jobs and interactive tasks.
I will drop my patch then.
Thanks,
Namhyung
>
>
> diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt
> index da326800c1c9..db4ae53c1d49 100644
> --- a/kernel/Kconfig.preempt
> +++ b/kernel/Kconfig.preempt
> @@ -16,11 +16,12 @@ config ARCH_HAS_PREEMPT_LAZY
>
> choice
> prompt "Preemption Model"
> - default PREEMPT_NONE
> + default PREEMPT_LAZY
>
> config PREEMPT_NONE
> bool "No Forced Preemption (Server)"
> depends on !PREEMPT_RT
> + depends on ARCH_NO_PREEMPT
> select PREEMPT_NONE_BUILD if !PREEMPT_DYNAMIC
> help
> This is the traditional Linux preemption model, geared towards
> @@ -35,8 +36,8 @@ config PREEMPT_NONE
>
> config PREEMPT_VOLUNTARY
> bool "Voluntary Kernel Preemption (Desktop)"
> - depends on !ARCH_NO_PREEMPT
> depends on !PREEMPT_RT
> + depends on ARCH_NO_PREEMPT
> select PREEMPT_VOLUNTARY_BUILD if !PREEMPT_DYNAMIC
> help
> This option reduces the latency of the kernel by adding more