News: 0001606078

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Linux 7.0 To Focus Just On Full & Lazy Preemption Models For Up-To-Date CPU Archs

([Linux Kernel] 14 January 09:27 AM EST Preemption Model Changes)


A Linux scheduler patch queued up into a TIP branch this past week further restrict is the preemption modes that will be advertised. With it hitting the "sched/core" branch, it will likely be submitted for the upcoming Linux 7.0 (or alternatively, what could be known as Linux 6.20 instead).

Longtime Intel Linux engineer Peter Zijlstra authored the patch to further restrict the preemption modes of the Linux kernel in balancing between throughput and latency of the system. Peter explained with [1]the patch :

"The introduction of PREEMPT_LAZY was for multiple reasons:

- PREEMPT_RT suffered from over-scheduling, hurting performance compared to !PREEMPT_RT.

- the introduction of (more) features that rely on preemption; like folio_zero_user() which can do large memset() without preemption checks. (Xen already had a horrible hack to deal with long running hypercalls)

- the endless and uncontrolled sprinkling of cond_resched() -- mostly cargo cult or in response to poor to replicate workloads.

By moving to a model that is fundamentally preemptable these things become managable and avoid needing to introduce more horrible hacks.

Since this is a requirement; limit PREEMPT_NONE to architectures that do not support preemption at all. Further limit PREEMPT_VOLUNTARY to those architectures that do not yet have PREEMPT_LAZY support (with the eventual goal to make this the empty set and completely remove voluntary preemption and cond_resched() -- notably VOLUNTARY is already limited to !ARCH_NO_PREEMPT.)

This leaves up-to-date architectures (arm64, loongarch, powerpc, riscv, s390, x86) with only two preemption models: full and lazy.

While Lazy has been the recommended setting for a while, not all distributions have managed to make the switch yet. Force things along. Keep the patch minimal in case of hard to address regressions that might pop up."

Basically blocking out the none and voluntary preemption models from modern CPU architectures. x86/x86_64, s390, RISC-V, POWER, LoongArch, and ARM64 will be focused on the full and lazy preemption models.

Barring any issues from coming up or stakeholder objections, this patch in tip/tip.git's sched/core branch will then likely be merged for the upcoming Linux 6.20~7.0 cycle.



[1] https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=sched/core&id=7dadeaa6e851e7d67733f3e24fc53ee107781d0f



Inadmissible: Not competent to be considered. Said of certain kinds of
testimony which juries are supposed to be unfit to be entrusted with,
and which judges, therefore, rule out, even of proceedings before themselves
alone. Hearsay evidence is inadmissible because the person quoted was
unsworn and is not before the court for examination; yet most momentous
actions, military, political, commercial and of every other kind, are
daily undertaken on hearsay evidence. There is no religion in the world
that has any other basis than hearsay evidence. Revelation is hearsay
evidence; that the Scriptures are the word of God we have only the
testimony of men long dead whose identity is not clearly established and
who are not known to have been sworn in any sense. Under the rules of
evidence as they now exist in this country, no single assertion in the
Bible has in its support any evidence admissible in a court of law...

But as records of courts of justice are admissible, it can easily be proved
that powerful and malevolent magicians once existed and were a scourge to
mankind. The evidence (including confession) upon which certain women
were convicted of witchcraft and executed was without a flaw; it is still
unimpeachable. The judges' decisions based on it were sound in logic and
in law. Nothing in any existing court was ever more thoroughly proved than
the charges of witchcraft and sorcery for which so many suffered death.
If there were no witches, human testimony and human reason are alike
destitute of value. --Ambrose Bierce