Go to file
Felix Moessbauer 774a12b737 hrtimer: Use and report correct timerslack values for realtime tasks
commit ed4fb6d7ef upstream.

The timerslack_ns setting is used to specify how much the hardware
timers should be delayed, to potentially dispatch multiple timers in a
single interrupt. This is a performance optimization. Timers of
realtime tasks (having a realtime scheduling policy) should not be
delayed.

This logic was inconsitently applied to the hrtimers, leading to delays
of realtime tasks which used timed waits for events (e.g. condition
variables). Due to the downstream override of the slack for rt tasks,
the procfs reported incorrect (non-zero) timerslack_ns values.

This is changed by setting the timer_slack_ns task attribute to 0 for
all tasks with a rt policy. By that, downstream users do not need to
specially handle rt tasks (w.r.t. the slack), and the procfs entry
shows the correct value of "0". Setting non-zero slack values (either
via procfs or PR_SET_TIMERSLACK) on tasks with a rt policy is ignored,
as stated in "man 2 PR_SET_TIMERSLACK":

  Timer slack is not applied to threads that are scheduled under a
  real-time scheduling policy (see sched_setscheduler(2)).

The special handling of timerslack on rt tasks in downstream users
is removed as well.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240814121032.368444-2-felix.moessbauer@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 472173544e74709590b3827a9a32e7ce0387624f)
2025-03-23 19:26:40 +08:00
.github/workflows CI: config: add usb share config to generic_config_whitelist 2025-03-14 15:59:14 +08:00
Documentation sched/isolation: Prevent boot crash when the boot CPU is nohz_full 2025-03-23 19:26:40 +08:00
LICENSES LICENSES: add 0BSD license text 2025-01-18 13:07:45 +08:00
arch clockevents/drivers/i8253: Fix stop sequence for timer 0 2025-03-23 19:26:40 +08:00
block block: fix conversion of GPT partition name to 7-bit 2025-03-18 15:20:51 +08:00
certs certs: Reference revocation list for all keyrings 2023-08-17 20:12:41 +00:00
crypto crypto: ecc - Prevent ecc_digits_from_bytes from reading too many bytes 2025-01-13 11:06:44 +08:00
deepin deepin: OWNERS: Add winnscode to reviewers 2024-12-10 20:42:15 +08:00
drivers zram: fix NULL pointer in comp_algorithm_show() 2025-03-23 19:26:40 +08:00
fs hrtimer: Use and report correct timerslack values for realtime tasks 2025-03-23 19:26:40 +08:00
include clockevents/drivers/i8253: Fix stop sequence for timer 0 2025-03-23 19:26:40 +08:00
init xz: adjust arch-specific options for better kernel compression 2025-01-18 13:07:45 +08:00
io_uring io_uring/net: save msg_control for compat 2025-03-17 20:08:50 +08:00
ipc Export symbols needed by binder 2024-12-31 11:42:52 +08:00
kernel hrtimer: Use and report correct timerslack values for realtime tasks 2025-03-23 19:26:40 +08:00
lib rcuref: Plug slowpath race in rcuref_put() 2025-03-17 20:08:50 +08:00
mm mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear() 2025-03-18 15:26:16 +08:00
net pfifo_tail_enqueue: Drop new packet when sch->limit == 0 2025-03-18 15:26:16 +08:00
rust rust: init: use explicit ABI to clean warning in future compilers 2025-02-18 11:53:09 +08:00
samples samples/landlock: Fix possible NULL dereference in parse_path() 2025-02-10 01:59:56 +08:00
scripts scripts/gdb: fix aarch64 userspace detection in get_current_task 2025-02-18 11:53:09 +08:00
security ima: Reset IMA_NONACTION_RULE_FLAGS after post_setattr 2025-03-18 15:26:16 +08:00
sound ALSA: hda: realtek: fix incorrect IS_REACHABLE() usage 2025-03-18 15:26:16 +08:00
tools rseq/selftests: Fix riscv rseq_offset_deref_addv inline asm 2025-03-17 20:08:50 +08:00
usr kbuild: hdrcheck: fix cross build with clang 2025-03-18 15:26:16 +08:00
virt KVM: Use dedicated mutex to protect kvm_usage_count to avoid deadlock 2024-12-10 20:42:04 +08:00
.clang-format iommu: Add for_each_group_device() 2023-05-23 08:15:51 +02:00
.cocciconfig
.get_maintainer.ignore get_maintainer: add Alan to .get_maintainer.ignore 2022-08-20 15:17:44 -07:00
.gitattributes .gitattributes: set diff driver for Rust source code files 2023-05-31 17:48:25 +02:00
.gitignore Remove *.orig pattern from .gitignore 2024-12-10 20:42:03 +08:00
.mailmap 20 hotfixes. 12 are cc:stable and the remainder address post-6.5 issues 2023-10-24 09:52:16 -10:00
.rustfmt.toml rust: add `.rustfmt.toml` 2022-09-28 09:02:20 +02:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS fs: Remove NTFS classic 2024-12-10 20:39:15 +08:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS LoongArch: Add loongson SE SDF support 2025-02-25 17:25:19 +08:00
Makefile kbuild: userprogs: use correct lld when linking through clang 2025-03-18 15:26:16 +08:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

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 Restructured Text 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.