All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] sched: Add default dynamic preempt mode Kconfig
Date: Wed, 9 Jun 2021 13:27:50 +0200	[thread overview]
Message-ID: <20210609112750.GC104634@lothringen> (raw)
In-Reply-To: <YL94/8cSr2R2wiTa@hirez.programming.kicks-ass.net>

On Tue, Jun 08, 2021 at 04:04:47PM +0200, Peter Zijlstra wrote:
> On Tue, Jun 08, 2021 at 03:55:09PM +0200, Peter Zijlstra wrote:
> > Urgh, would something like this work?
> > 
> > ---
> >  kernel/Kconfig.preempt | 64 ++++++++++++++++++++++++++++++++++++++++----------
> >  1 file changed, 51 insertions(+), 13 deletions(-)
> > 
> > diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt
> > index bd7c4147b9a8..43c68a806e4e 100644
> > --- a/kernel/Kconfig.preempt
> > +++ b/kernel/Kconfig.preempt
> > @@ -1,11 +1,25 @@
> >  # SPDX-License-Identifier: GPL-2.0-only
> >  
> > +config PREEMPT_COUNT
> > +       bool
> > +
> > +config PREEMPTION
> > +       bool
> > +       select PREEMPT_COUNT
> > +
> > +config PREEMPT_DYNAMIC_OPTION
> > +	bool
> > +	help
> > +	  Symbol that gates availablility of PREEMPT_DYNAMIC, selected
> > +	  by preemption models that can be dynamically selected.
> > +
> >  choice
> >  	prompt "Preemption Model"
> > +	default PREEMPT_TYPE_NONE
> >  
> > +config PREEMPT_TYPE_NONE
> >  	bool "No Forced Preemption (Server)"
> > +	select PREEMPT_DYNAMIC_OPTION if HAVE_PREEMPT_DYNAMIC
> >  	help
> >  	  This is the traditional Linux preemption model, geared towards
> >  	  throughput. It will still provide good latencies most of the
> > @@ -17,9 +31,10 @@ config PREEMPT_NONE
> >  	  raw processing power of the kernel, irrespective of scheduling
> >  	  latencies.
> >  
> > +config PREEMPT_TYPE_VOLUNTARY
> >  	bool "Voluntary Kernel Preemption (Desktop)"
> >  	depends on !ARCH_NO_PREEMPT
> > +	select PREEMPT_DYNAMIC_OPTION if HAVE_PREEMPT_DYNAMIC
> >  	help
> >  	  This option reduces the latency of the kernel by adding more
> >  	  "explicit preemption points" to the kernel code. These new
> > @@ -35,12 +50,10 @@ config PREEMPT_VOLUNTARY
> >  
> >  	  Select this if you are building a kernel for a desktop system.
> >  
> > -config PREEMPT
> > +config PREEMPT_TYPE_FULL
> >  	bool "Preemptible Kernel (Low-Latency Desktop)"
> >  	depends on !ARCH_NO_PREEMPT
> > +	select PREEMPT_DYNAMIC_OPTION if HAVE_PREEMPT_DYNAMIC
> >  	help
> >  	  This option reduces the latency of the kernel by making
> >  	  all kernel code (that is not executing in a critical section)
> > @@ -75,15 +88,24 @@ config PREEMPT_RT
> >  
> >  endchoice
> >  
> > +# default model for PREEMPT_DYNAMIC
> >  
> > +config PREEMPT_DYNAMIC_NONE
> > +	bool
> >  
> > +config PREEMPT_DYNAMIC_VOLUNTARY
> > +	bool
> > +
> > +config PREEMPT_DYNAMIC_FULL
> >  	bool
> > +
> > +config PREEMPT_DYNAMIC
> > +	bool "Dynamic Preemption Mode"
> > +	depends on PREEMPT_DYNAMIC_OPTION
> > +	select PREEMPT
> > +	select PREEMPT_DYNAMIC_NONE if PREEMPT_TYPE_NONE
> > +	select PREEMPT_DYNAMIC_VOLUNTARY if PREEMPT_TYPE_VOLUNTARY
> > +	select PREEMPT_DYNAMIC_FULL if PREEMPT_TYPE_FULL
> 
> Arguably PREEMPT_DYNAMIC_{NONE,VOLUNTARY,FULL} are superfluous and the
> default selection can use PREEMPT_TYPE_*.

Right, I'll try that.

Thanks.

  reply	other threads:[~2021-06-09 11:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 12:04 [PATCH 0/2] sched: Define default preempt dynamic boot mode on Kconfig Frederic Weisbecker
2021-06-08 12:04 ` [PATCH 1/2] sched: Add default dynamic preempt mode Kconfig Frederic Weisbecker
2021-06-08 13:55   ` Peter Zijlstra
2021-06-08 14:04     ` Peter Zijlstra
2021-06-09 11:27       ` Frederic Weisbecker [this message]
2021-06-09 11:13     ` Frederic Weisbecker
2021-06-08 13:55   ` Peter Zijlstra
2021-06-09 11:25     ` Frederic Weisbecker
2021-06-08 12:04 ` [PATCH 2/2] sched: Always print out preempt dynamic state Frederic Weisbecker
2021-06-08 13:56   ` Peter Zijlstra

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=20210609112750.GC104634@lothringen \
    --to=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.