public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Michal Hocko <mhocko@suse.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Frederic Weisbecker <fweisbecker@suse.de>,
	LKML <linux-kernel@vger.kernel.org>, Mel Gorman <mgorman@suse.de>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [RFC PATCH] kernel: allow to configure PREEMPT_NONE, PREEMPT_VOLUNTARY on kernel command line
Date: Fri, 9 Oct 2020 13:39:09 +0200	[thread overview]
Message-ID: <20201009113909.GL2628@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20201009104808.GK4967@dhcp22.suse.cz>

On Fri, Oct 09, 2020 at 12:48:08PM +0200, Michal Hocko wrote:
> On Fri 09-10-20 12:20:09, Peter Zijlstra wrote:
> > On Fri, Oct 09, 2020 at 12:14:05PM +0200, Michal Hocko wrote:
> > > On Fri 09-10-20 11:47:41, Peter Zijlstra wrote:
> > 
> > > > That is, work backwards (from PREEMPT back to VOLUNTARY) instead of the
> > > > other way around.
> > > 
> > > My original idea was that the config would only define the default
> > > preemption mode. preempt_none parameter would then just act as an
> > > override. That would mean that CONFIG_PREEMPTION would be effectively
> > > gone from the kernel. The reason being that any code outside of the
> > > scheduler shouldn't really care about the preemption mode. I suspect
> > > this will prevent from dubious hacks and provide a more robust code in
> > > the end.
> > 
> > Sure; but the way of arriving at that destination might be easier if
> > you work backwards from PREEMPT=y, because while there _should_ not be
> > dependencies outside of the scheduler, we both know there are.
> 
> Wouldn't we need to examine each of the CONFIG_PREEMPTION code anyway?
> And wouldn't that be even more tricky? The boot time option would result
> in a more restrictive preemption mode while the code is actually
> assuming a less restrictive one.

Sure, in the end we'll have to look at all of that.

> > This also makes your patches independent of the series that makes
> > CONFIG_PREEMPTION unconditional.
> >
> > It also gives Kconfig space to limit the dynamic thing to archs that
> > have sufficient support (we'll be relying on static_call/static_branch,
> > and not everybody has that implemented in a way that makes it the
> > dynamic change worth-while).
> 
> Hmm, this is actually a good argument. I can imagine that kernels
> without CONFIG_JUMP_LABEL might increase a runtime overhead for
> something that users of that kernel might be not really interested in.
> This would make CONFIG_PREEMPT_DYNAMIC be selected by CONFIG_JUMP_LABEL.
> 
> I will add the CONFIG_PREEMPT_DYNAMIC in the next version. I just have
> to think whether flipping the direction is really safe and easier in the
> end. For our particular usecase we are more interested in
> NONE<->VOLUNTARY at this moment and having full preemption in the mix
> later is just fine. If you insist on the other direction then we can
> work on that.

Ah, I was purely thinking of the FULL preempt case. For the
NONE/VOLATILE case you can probably keep it simpler.

  parent reply	other threads:[~2020-10-09 11:39 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07 12:04 [RFC PATCH] kernel: allow to configure PREEMPT_NONE, PREEMPT_VOLUNTARY on kernel command line Michal Hocko
2020-10-07 12:19 ` Peter Zijlstra
2020-10-07 12:29   ` Michal Hocko
2020-10-07 13:01     ` Mel Gorman
2020-10-07 12:21 ` Peter Zijlstra
2020-10-07 12:35   ` Michal Hocko
2020-10-09  9:47     ` Peter Zijlstra
2020-10-09 10:14       ` Michal Hocko
2020-10-09 10:20         ` Peter Zijlstra
2020-10-09 10:48           ` Michal Hocko
2020-10-09 11:17             ` Michal Hocko
2020-10-09 11:26               ` Michal Hocko
2020-10-09 11:39             ` Peter Zijlstra [this message]
2020-10-09  9:12 ` Michal Hocko
2020-10-09  9:42   ` Peter Zijlstra
2020-10-09 10:10     ` Michal Hocko
2020-10-09 10:14       ` Peter Zijlstra
2020-10-09 10:37         ` Michal Hocko
2020-10-09 11:42           ` Peter Zijlstra
2020-10-09 12:29 ` [RFC PATCH v2 0/5] allow overriding default preempt mode from " Michal Hocko
2020-10-09 12:29   ` [RFC PATCH v2 1/5] jump_label: split out declaration parts into its own headers Michal Hocko
2020-10-09 12:29   ` [RFC PATCH v2 2/5] kernel: allow to configure PREEMPT_NONE, PREEMPT_VOLUNTARY on kernel command line Michal Hocko
2020-10-09 12:29   ` [RFC PATCH v2 3/5] kernel: ARCH_NO_PREEMPT shouldn't exclude PREEMPT_VOLUNTARY Michal Hocko
2020-10-09 12:29   ` [RFC PATCH v2 4/5] kernel: introduce CONFIG_PREEMPT_DYNAMIC Michal Hocko
2020-10-09 12:29   ` [RFC PATCH v2 5/5] kernel: drop PREEMPT_NONE compile time option Michal Hocko
2020-10-09 12:50   ` [RFC PATCH v2 0/5] allow overriding default preempt mode from command line Peter Zijlstra
2020-10-09 13:03     ` Michal Hocko
2020-10-09 13:22       ` Peter Zijlstra
2020-10-09 17:45   ` Peter Zijlstra
2020-10-27 12:22     ` Frederic Weisbecker
2020-10-27 12:28       ` 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=20201009113909.GL2628@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=fweisbecker@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /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