Skip to content

RFC Restartable sequences and CPU op vector

Mathieu Desnoyers linux-api linux-kselftest linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest21 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21uapi headers: Provide types_32_64.hinclude/uapi/linux/types_32_64.h+67 -00 replies
2/21rseq: Introduce restartable sequences system call (v12)MAINTAINERS arch/Kconfig fs/exec.c +11 more+717 -012 replies
3/21arm: Add restartable sequences supportarch/arm/Kconfig arch/arm/kernel/signal.c+8 -00 replies
4/21arm: Wire up restartable sequences system callarch/arm/tools/syscall.tbl+1 -00 replies
5/21x86: Add support for restartable sequencesarch/x86/Kconfig arch/x86/entry/common.c arch/x86/kernel/signal.c+8 -00 replies
6/21x86: Wire up restartable sequence system callarch/x86/entry/syscalls/syscall_32.tbl arch/x86/entry/syscalls/syscall_64.tbl+2 -00 replies
7/21powerpc: Add support for restartable sequencesarch/powerpc/Kconfig arch/powerpc/kernel/signal.c+4 -00 replies
8/21powerpc: Wire up restartable sequences system callarch/powerpc/include/asm/systbl.h arch/powerpc/include/asm/unistd.h arch/powerpc/include/uapi/asm/unistd.h+3 -10 replies
9/21sched: Implement push_task_to_cpukernel/sched/core.c kernel/sched/sched.h+46 -00 replies
10/21cpu_opv: Provide cpu_opv system call (v5)MAINTAINERS include/linux/syscalls.h include/uapi/linux/cpu_opv.h +4 more+1220 -01 reply
11/21x86: Wire up cpu_opv system callarch/x86/entry/syscalls/syscall_32.tbl arch/x86/entry/syscalls/syscall_64.tbl+2 -00 replies
12/21powerpc: Wire up cpu_opv system callarch/powerpc/include/asm/systbl.h arch/powerpc/include/asm/unistd.h arch/powerpc/include/uapi/asm/unistd.h+3 -10 replies
13/21arm: Wire up cpu_opv system callarch/arm/tools/syscall.tbl+1 -00 replies
14/21selftests: lib.mk: Introduce OVERRIDE_TARGETStools/testing/selftests/lib.mk+4 -00 replies
15/21cpu_opv: selftests: Implement selftests (v6)MAINTAINERS tools/testing/selftests/Makefile tools/testing/selftests/cpu-opv/.gitignore +4 more+1689 -00 replies
16/21rseq: selftests: Provide rseq library (v5)tools/testing/selftests/rseq/rseq-arm.h tools/testing/selftests/rseq/rseq-ppc.h tools/testing/selftests/rseq/rseq-skip.h +3 more+2931 -00 replies
17/21rseq: selftests: Provide percpu_op APItools/testing/selftests/rseq/percpu-op.h+163 -00 replies
18/21rseq: selftests: Provide basic testtools/testing/selftests/rseq/basic_test.c+55 -00 replies
19/21rseq: selftests: Provide basic percpu ops testtools/testing/selftests/rseq/basic_percpu_ops_test.c+296 -00 replies
20/21rseq: selftests: Provide parametrized teststools/testing/selftests/rseq/param_test.c+1163 -00 replies
21/21rseq: selftests: Provide Makefile, scripts, gitignoreMAINTAINERS tools/testing/selftests/Makefile tools/testing/selftests/rseq/.gitignore +2 more+176 -00 replies

Reviews trailers per patch

4 of 21 patches have a Reviewed-by or Acked-by.

PatchThomas GleixnerShuah Khan
1/21
2/21
3/21
4/21
5/21R-b
6/21R-b
7/21
8/21
9/21
10/21
11/21
12/21
13/21
14/21A-b
15/21A-b
16/21
17/21
18/21
19/21
20/21
21/21

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH for 4.16 00/21] Restartable sequences and CPU op vector

Hi,

Following changes based on the last round of review, I'm respinning this series for another RFC round. It is based on the v4.15-rc3 tag. I am now targeting the 4.16 merge window.

This series contains:

- Restartable sequences system call (x86 32/64, powerpc 32/64, arm 32),
- CPU operation vector system call (x86 32/64, powerpc 32/64, arm 32).

I have moved the membarrier patches to a different series.

The main changes introduced in this updated version are:

- Introducing a user-space "percpu-op.h" API, which wraps fast and slow paths into a single inline function,
- Changes to the cpu_opv page pinning, making it robust with respect to concurrent PTE changes,
- Fixed a rseq bug where the rseq_cs pointer was cleared too soon, causing hard-to-reproduce races triggered by NUMA page protection.
- Extended rseq selftests to add a "compare twice" approach validating invaritants, which catches races more quickly and closer to the race.

This updated series documents a major upside of the cpu_opv system call:
it allows performing operations on remote per-cpu data (e.g. migration of memory between per-cpu memory pools, task migration across per-cpu work queues, or summing up and clearning per-cpu statistics counters) by simply passing the CPU number on which the operation must be performed as argument to the system call.

Doing this without cpu_opv would require use of sched_setaffinity alongside with restartable sequences, which is not safe against CPU hot-unplug.

Feedback is welcome!

Thanks,

Mathieu

Boqun Feng (2):
powerpc: Add support for restartable sequences
powerpc: Wire up restartable sequences system call

Mathieu Desnoyers (19):
uapi headers: Provide types_32_64.h
rseq: Introduce restartable sequences system call (v12)
arm: Add restartable sequences support
arm: Wire up restartable sequences system call
x86: Add support for restartable sequences
x86: Wire up restartable sequence system call
sched: Implement push_task_to_cpu
cpu_opv: Provide cpu_opv system call (v5)
x86: Wire up cpu_opv system call
powerpc: Wire up cpu_opv system call
arm: Wire up cpu_opv system call
selftests: lib.mk: Introduce OVERRIDE_TARGETS
cpu_opv: selftests: Implement selftests (v6)
rseq: selftests: Provide rseq library (v5)
rseq: selftests: Provide percpu_op API
rseq: selftests: Provide basic test
rseq: selftests: Provide basic percpu ops test
rseq: selftests: Provide parametrized tests
rseq: selftests: Provide Makefile, scripts, gitignore

 MAINTAINERS                                        |   20 +
 arch/Kconfig                                       |    7 +
 arch/arm/Kconfig                                   |    1 +
 arch/arm/kernel/signal.c                           |    7 +
 arch/arm/tools/syscall.tbl                         |    2 +
 arch/powerpc/Kconfig                               |    1 +
 arch/powerpc/include/asm/systbl.h                  |    2 +
 arch/powerpc/include/asm/unistd.h                  |    2 +-
 arch/powerpc/include/uapi/asm/unistd.h             |    2 +
 arch/powerpc/kernel/signal.c                       |    3 +
 arch/x86/Kconfig                                   |    1 +
 arch/x86/entry/common.c                            |    1 +
 arch/x86/entry/syscalls/syscall_32.tbl             |    2 +
 arch/x86/entry/syscalls/syscall_64.tbl             |    2 +
 arch/x86/kernel/signal.c                           |    6 +
 fs/exec.c                                          |    1 +
 include/linux/sched.h                              |  109 ++
 include/linux/syscalls.h                           |    6 +
 include/trace/events/rseq.h                        |   56 +
 include/uapi/linux/cpu_opv.h                       |  114 ++
 include/uapi/linux/rseq.h                          |  150 +++
 include/uapi/linux/types_32_64.h                   |   67 ++
 init/Kconfig                                       |   30 +
 kernel/Makefile                                    |    2 +
 kernel/cpu_opv.c                                   | 1078 +++++++++++++++++
 kernel/fork.c                                      |    2 +
 kernel/rseq.c                                      |  358 ++++++
 kernel/sched/core.c                                |   38 +
 kernel/sched/sched.h                               |   10 +
 kernel/sys_ni.c                                    |    4 +
 tools/testing/selftests/Makefile                   |    2 +
 tools/testing/selftests/cpu-opv/.gitignore         |    1 +
 tools/testing/selftests/cpu-opv/Makefile           |   17 +
 .../testing/selftests/cpu-opv/basic_cpu_opv_test.c | 1258 ++++++++++++++++++++
 tools/testing/selftests/cpu-opv/cpu-op.c           |  352 ++++++
 tools/testing/selftests/cpu-opv/cpu-op.h           |   59 +
 tools/testing/selftests/lib.mk                     |    4 +
 tools/testing/selftests/rseq/.gitignore            |    7 +
 tools/testing/selftests/rseq/Makefile              |   37 +
 .../testing/selftests/rseq/basic_percpu_ops_test.c |  296 +++++
 tools/testing/selftests/rseq/basic_test.c          |   55 +
 tools/testing/selftests/rseq/param_test.c          | 1163 ++++++++++++++++++
 tools/testing/selftests/rseq/percpu-op.h           |  163 +++
 tools/testing/selftests/rseq/rseq-arm.h            |  732 ++++++++++++
 tools/testing/selftests/rseq/rseq-ppc.h            |  688 +++++++++++
 tools/testing/selftests/rseq/rseq-skip.h           |   82 ++
 tools/testing/selftests/rseq/rseq-x86.h            | 1149 ++++++++++++++++++
 tools/testing/selftests/rseq/rseq.c                |  116 ++
 tools/testing/selftests/rseq/rseq.h                |  164 +++
 tools/testing/selftests/rseq/run_param_test.sh     |  130 ++
 50 files changed, 8558 insertions(+), 1 deletion(-)
 create mode 100644 include/trace/events/rseq.h
 create mode 100644 include/uapi/linux/cpu_opv.h
 create mode 100644 include/uapi/linux/rseq.h
 create mode 100644 include/uapi/linux/types_32_64.h
 create mode 100644 kernel/cpu_opv.c
 create mode 100644 kernel/rseq.c
 create mode 100644 tools/testing/selftests/cpu-opv/.gitignore
 create mode 100644 tools/testing/selftests/cpu-opv/Makefile
 create mode 100644 tools/testing/selftests/cpu-opv/basic_cpu_opv_test.c
 create mode 100644 tools/testing/selftests/cpu-opv/cpu-op.c
 create mode 100644 tools/testing/selftests/cpu-opv/cpu-op.h
 create mode 100644 tools/testing/selftests/rseq/.gitignore
 create mode 100644 tools/testing/selftests/rseq/Makefile
 create mode 100644 tools/testing/selftests/rseq/basic_percpu_ops_test.c
 create mode 100644 tools/testing/selftests/rseq/basic_test.c
 create mode 100644 tools/testing/selftests/rseq/param_test.c
 create mode 100644 tools/testing/selftests/rseq/percpu-op.h
 create mode 100644 tools/testing/selftests/rseq/rseq-arm.h
 create mode 100644 tools/testing/selftests/rseq/rseq-ppc.h
 create mode 100644 tools/testing/selftests/rseq/rseq-skip.h
 create mode 100644 tools/testing/selftests/rseq/rseq-x86.h
 create mode 100644 tools/testing/selftests/rseq/rseq.c
 create mode 100644 tools/testing/selftests/rseq/rseq.h
 create mode 100755 tools/testing/selftests/rseq/run_param_test.sh
Signature · 1 line
2.11.0