sched/fair: Implement delayed dequeue
Peter Zijlstra authored
Extend / fix 86bfbb7c

 ("sched/fair: Add lag based placement") by
noting that lag is fundamentally a temporal measure. It should not be
carried around indefinitely.

OTOH it should also not be instantly discarded, doing so will allow a
task to game the system by purposefully (micro) sleeping at the end of
its time quantum.

Since lag is intimately tied to the virtual time base, a wall-time
based decay is also insufficient, notably competition is required for
any of this to make sense.

Instead, delay the dequeue and keep the 'tasks' on the runqueue,
competing until they are eligible.

Strictly speaking, we only care about keeping them until the 0-lag
point, but that is a difficult proposition, instead carry them around
until they get picked again, and dequeue them at that point.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarValentin Schneider <vschneid@redhat.com>
Tested-by: default avatarValentin Schneider <vschneid@redhat.com>
Link: https://lkml.kernel.org/r/20240727105030.226163742@infradead.org
152e11f6
Name Last commit Last update
Documentation Merge tag 'cxl-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl
LICENSES LICENSES: Add the copyleft-next-0.3.1 license
arch minmax: add a few more MIN_T/MAX_T users
block block: fix deadlock between sd_remove & sd_release
certs kbuild: use $(src) instead of $(srctree)/$(src) for source directory
crypto crypto: testmgr - generate power-of-2 lengths more often
drivers minmax: add a few more MIN_T/MAX_T users
fs sched/rt: Rename realtime_{prio, task}() to rt_or_dl_{prio, task}()
include sched,freezer: Mark TASK_FROZEN special
init Merge tag 'rust-6.11' of https://github.com/Rust-for-Linux/linux
io_uring io_uring/napi: pass ktime to io_napi_adjust_timeout
ipc sysctl: treewide: constify the ctl_table argument of proc_handlers
kernel sched/fair: Implement delayed dequeue
lib Merge tag 'rust-6.11' of https://github.com/Rust-for-Linux/linux
mm sched/rt: Rename realtime_{prio, task}() to rt_or_dl_{prio, task}()
net minmax: add a few more MIN_T/MAX_T users
rust Merge tag 'rust-6.11' of https://github.com/Rust-for-Linux/linux
samples Merge tag 'driver-core-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
scripts Merge tag 'kbuild-fixes-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
security Merge tag 'apparmor-pr-2024-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor
sound Merge tag 'devicetree-fixes-for-6.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
tools Merge tag 'v6.11-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
usr initramfs: shorten cmd_initfs in usr/Makefile
virt Merge tag 'kvm-x86-generic-6.11' of https://github.com/kvm-x86/linux into HEAD
.clang-format Docs: Move clang-format from process/ to dev-tools/
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.