linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch V3 00/12] rseq: Implement time slice extension mechanism
@ 2025-10-29 13:22 Thomas Gleixner
  2025-10-29 13:22 ` [patch V3 01/12] sched: Provide and use set_need_resched_current() Thomas Gleixner
                   ` (13 more replies)
  0 siblings, 14 replies; 63+ messages in thread
From: Thomas Gleixner @ 2025-10-29 13:22 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Mathieu Desnoyers, Paul E. McKenney, Boqun Feng,
	Jonathan Corbet, Prakash Sangappa, Madadi Vineeth Reddy,
	K Prateek Nayak, Steven Rostedt, Sebastian Andrzej Siewior,
	Arnd Bergmann, linux-arch

This is a follow up on the V2 version:

     https://lore.kernel.org/20251022110646.839870156@linutronix.de

V1 contains a detailed explanation:

     https://lore.kernel.org/20250908225709.144709889@linutronix.de

TLDR: Time slice extensions are an attempt to provide opportunistic
priority ceiling without the overhead of an actual priority ceiling
protocol, but also without the guarantees such a protocol provides.

The intent is to avoid situations where a user space thread is interrupted
in a critical section and scheduled out, while holding a resource on which
the preempting thread or other threads in the system might block on. That
obviously prevents those threads from making progress in the worst case for
at least a full time slice. Especially in the context of user space
spinlocks, which are a patently bad idea to begin with, but that's also
true for other mechanisms.

This series uses the existing RSEQ user memory to implement it.

Changes vs. V2:

   - Rebase on the newest RSEQ and uaccess changes

   - Document the command line parameter - Sebastian

   - Use ENOTSUPP in the stub inline to be consistent - Sebastian

   - Add sysctl documentation - Sebastian

   - Simplify timer cancelation - Sebastian

   - Restore the dropped 'From: Peter...' line in patch 1 - Sebastian

   - More documentation/comment fixes - Randy


The uaccess and RSEQ modifications on which this series is based can be
found here:

    https://lore.kernel.org/20251029123717.886619142@linutronix.de

and in git:

    git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git rseq/cid

For your convenience all of it is also available as a conglomerate from
git:

    git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git rseq/slice

Thanks,

	tglx

---
Peter Zijlstra (1):
      sched: Provide and use set_need_resched_current()

Thomas Gleixner (11):
      rseq: Add fields and constants for time slice extension
      rseq: Provide static branch for time slice extensions
      rseq: Add statistics for time slice extensions
      rseq: Add prctl() to enable time slice extensions
      rseq: Implement sys_rseq_slice_yield()
      rseq: Implement syscall entry work for time slice extensions
      rseq: Implement time slice extension enforcement timer
      rseq: Reset slice extension when scheduled
      rseq: Implement rseq_grant_slice_extension()
      entry: Hook up rseq time slice extension
      selftests/rseq: Implement time slice extension test

 Documentation/admin-guide/kernel-parameters.txt |    5 
 Documentation/admin-guide/sysctl/kernel.rst     |    6 
 Documentation/userspace-api/index.rst           |    1 
 Documentation/userspace-api/rseq.rst            |  118 +++++++++
 arch/alpha/kernel/syscalls/syscall.tbl          |    1 
 arch/arm/tools/syscall.tbl                      |    1 
 arch/arm64/tools/syscall_32.tbl                 |    1 
 arch/m68k/kernel/syscalls/syscall.tbl           |    1 
 arch/microblaze/kernel/syscalls/syscall.tbl     |    1 
 arch/mips/kernel/syscalls/syscall_n32.tbl       |    1 
 arch/mips/kernel/syscalls/syscall_n64.tbl       |    1 
 arch/mips/kernel/syscalls/syscall_o32.tbl       |    1 
 arch/parisc/kernel/syscalls/syscall.tbl         |    1 
 arch/powerpc/kernel/syscalls/syscall.tbl        |    1 
 arch/s390/kernel/syscalls/syscall.tbl           |    1 
 arch/s390/mm/pfault.c                           |    3 
 arch/sh/kernel/syscalls/syscall.tbl             |    1 
 arch/sparc/kernel/syscalls/syscall.tbl          |    1 
 arch/x86/entry/syscalls/syscall_32.tbl          |    1 
 arch/x86/entry/syscalls/syscall_64.tbl          |    1 
 arch/xtensa/kernel/syscalls/syscall.tbl         |    1 
 include/linux/entry-common.h                    |    2 
 include/linux/rseq.h                            |   11 
 include/linux/rseq_entry.h                      |  191 ++++++++++++++-
 include/linux/rseq_types.h                      |   30 ++
 include/linux/sched.h                           |    7 
 include/linux/syscalls.h                        |    1 
 include/linux/thread_info.h                     |   16 -
 include/uapi/asm-generic/unistd.h               |    5 
 include/uapi/linux/prctl.h                      |   10 
 include/uapi/linux/rseq.h                       |   38 +++
 init/Kconfig                                    |   12 
 kernel/entry/common.c                           |   14 -
 kernel/entry/syscall-common.c                   |   11 
 kernel/rcu/tiny.c                               |    8 
 kernel/rcu/tree.c                               |   14 -
 kernel/rcu/tree_exp.h                           |    3 
 kernel/rcu/tree_plugin.h                        |    9 
 kernel/rcu/tree_stall.h                         |    3 
 kernel/rseq.c                                   |  299 ++++++++++++++++++++++++
 kernel/sys.c                                    |    6 
 kernel/sys_ni.c                                 |    1 
 scripts/syscall.tbl                             |    1 
 tools/testing/selftests/rseq/.gitignore         |    1 
 tools/testing/selftests/rseq/Makefile           |    5 
 tools/testing/selftests/rseq/rseq-abi.h         |   27 ++
 tools/testing/selftests/rseq/slice_test.c       |  198 +++++++++++++++
 47 files changed, 1019 insertions(+), 53 deletions(-)


^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2025-11-26 22:03 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 13:22 [patch V3 00/12] rseq: Implement time slice extension mechanism Thomas Gleixner
2025-10-29 13:22 ` [patch V3 01/12] sched: Provide and use set_need_resched_current() Thomas Gleixner
2025-10-29 13:22 ` [patch V3 02/12] rseq: Add fields and constants for time slice extension Thomas Gleixner
2025-10-30 22:01   ` Prakash Sangappa
2025-10-31 14:32     ` Thomas Gleixner
2025-10-31 19:31   ` Mathieu Desnoyers
2025-10-31 20:58     ` Thomas Gleixner
2025-11-01 22:53       ` Thomas Gleixner
2025-11-03 17:00       ` Mathieu Desnoyers
2025-11-03 19:19         ` Florian Weimer
2025-11-04  0:20   ` Steven Rostedt
2025-10-29 13:22 ` [patch V3 03/12] rseq: Provide static branch for time slice extensions Thomas Gleixner
2025-10-29 17:23   ` Randy Dunlap
2025-10-29 21:12     ` Thomas Gleixner
2025-10-31 19:34   ` Mathieu Desnoyers
2025-10-29 13:22 ` [patch V3 04/12] rseq: Add statistics " Thomas Gleixner
2025-10-31 19:36   ` Mathieu Desnoyers
2025-10-29 13:22 ` [patch V3 05/12] rseq: Add prctl() to enable " Thomas Gleixner
2025-10-31 19:43   ` Mathieu Desnoyers
2025-10-31 21:05     ` Thomas Gleixner
2025-10-29 13:22 ` [patch V3 06/12] rseq: Implement sys_rseq_slice_yield() Thomas Gleixner
2025-10-31 19:46   ` Mathieu Desnoyers
2025-10-31 21:07     ` Thomas Gleixner
2025-11-03 17:07       ` Mathieu Desnoyers
2025-10-29 13:22 ` [patch V3 07/12] rseq: Implement syscall entry work for time slice extensions Thomas Gleixner
2025-10-31 19:53   ` Mathieu Desnoyers
2025-11-19  0:20   ` Prakash Sangappa
2025-11-19 15:25     ` Thomas Gleixner
2025-11-20  7:37       ` Prakash Sangappa
2025-11-20 11:31         ` Thomas Gleixner
2025-11-21  0:12           ` Prakash Sangappa
2025-11-26 22:02             ` Prakash Sangappa
2025-11-21  9:28           ` david laight
2025-10-29 13:22 ` [patch V3 08/12] rseq: Implement time slice extension enforcement timer Thomas Gleixner
2025-10-29 18:45   ` Steven Rostedt
2025-10-29 21:37     ` Thomas Gleixner
2025-10-29 23:53       ` Steven Rostedt
2025-10-31 19:59   ` Mathieu Desnoyers
2025-10-29 13:22 ` [patch V3 09/12] rseq: Reset slice extension when scheduled Thomas Gleixner
2025-10-31 20:03   ` Mathieu Desnoyers
2025-10-29 13:22 ` [patch V3 10/12] rseq: Implement rseq_grant_slice_extension() Thomas Gleixner
2025-10-29 20:08   ` Steven Rostedt
2025-10-29 21:46     ` Thomas Gleixner
2025-10-29 22:04       ` Steven Rostedt
2025-10-31 14:33         ` Thomas Gleixner
2025-10-29 13:22 ` [patch V3 11/12] entry: Hook up rseq time slice extension Thomas Gleixner
2025-10-29 13:22 ` [patch V3 12/12] selftests/rseq: Implement time slice extension test Thomas Gleixner
2025-10-29 15:10 ` [patch V3 00/12] rseq: Implement time slice extension mechanism Sebastian Andrzej Siewior
2025-10-29 15:40   ` Steven Rostedt
2025-10-29 21:49     ` Thomas Gleixner
2025-11-06 17:28 ` Prakash Sangappa
2025-11-10 14:23   ` Mathieu Desnoyers
2025-11-10 17:05     ` Mathieu Desnoyers
2025-11-11 16:42     ` Mathieu Desnoyers
2025-11-12  6:30       ` Prakash Sangappa
2025-11-12 20:40         ` Mathieu Desnoyers
2025-11-12 21:57         ` Thomas Gleixner
2025-11-12 23:17           ` Prakash Sangappa
2025-11-13  2:34             ` Prakash Sangappa
2025-11-13 14:38               ` Thomas Gleixner
2025-11-12 20:31       ` Thomas Gleixner
2025-11-12 20:46         ` Mathieu Desnoyers
2025-11-12 21:54           ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).