Re: [RFC PATCH] kernel: allow to configure PREEMPT_NONE, PREEMPT_VOLUNTARY on kernel command line

From: Michal Hocko
Date: Fri Oct 09 2020 - 05:12:25 EST


On Wed 07-10-20 14:04:01, Michal Hocko wrote:
> From: Michal Hocko <mhocko@xxxxxxxx>
>
> Many people are still relying on pre built distribution kernels and so
> distributions have to provide mutliple kernel flavors to offer different
> preemption models. Most of them are providing PREEMPT_NONE for typical
> server deployments and PREEMPT_VOLUNTARY for desktop users.
>
> Having two different kernel binaries differing only by the preemption
> mode seems rather wasteful and inflexible. Especially when the difference
> between PREEMPT_NONE and PREEMPT_VOLUNTARY is really minimal. Both only
> allow explicit scheduling points while running in the kernel and it is
> only might_sleep which adds additional preemption points for
> PREEMPT_VOLUNTARY.
>
> Add a kernel command line parameter preempt_mode=[none, voluntary] which
> allows to override the default compile time preemption mode
> (CONFIG_PREEMPT_NONE resp. CONFIG_PREEMPT_VOLUTARY). Voluntary preempt
> mode is guarded by a jump label to prevent any potential runtime overhead.
>
> Signed-off-by: Michal Hocko <mhocko@xxxxxxxx>
> ---
>
> Hi all,
> this is sent as an RFC because it still needs some work. E.g. move jump
> label changes into their own patch. They are needed mostly to get rid of
> header files dependencies (seen for CONFIG_JUMP_LABEL=n via atomic.h ->
> bug.h).
>
> I wanted to make sure that the idea is sound for maintainers first. The
> next step would be extending the command line to support full preemption
> as well but there is much more work in that area. Frederic has promissed
> to look into that.
>
> Thoughts?

Is there any additional feedback? Should I split up the patch and repost
for inclusion?
--
Michal Hocko
SUSE Labs