Many thanks to Jann Horn for a detailed review of v0.5: https://lore.kernel.org/lkml/20210908184905.163787-1-posk@xxxxxxxxxx/ The main change in this patchet vs v0.5 is pinning of pages containing struct umcg_task of RUNNING workers and their servers. This allows uaccess operations from sched_submit_work (preempt-disabled). The pages are pinned only for RUNNING workers, i.e. at most NR_CPUS pages are pinned by UMCG at any one time, across the whole machine. A smaller change is the move of worker wakeup processing from sched_update_worker() to exit_to_user_mode_loop(), to ensure that no kernel locks are held if the worker is descheduled there. Commit messages in patches 2 and 3 list more changes. Peter Oskolkov (5): sched/umcg: add WF_CURRENT_CPU and externise ttwu sched/umcg: RFC: add userspace atomic helpers sched/umcg: RFC: implement UMCG syscalls sched/umcg: add Documentation/userspace-api/umcg.rst sched/umcg: add Documentation/userspace-api/umcg.txt Documentation/userspace-api/umcg.rst | 550 ++++++++++++++++++ Documentation/userspace-api/umcg.txt | 537 ++++++++++++++++++ arch/x86/entry/syscalls/syscall_64.tbl | 2 + fs/exec.c | 1 + include/linux/sched.h | 56 ++ include/linux/syscalls.h | 4 + include/uapi/asm-generic/unistd.h | 8 +- include/uapi/linux/umcg.h | 117 ++++ init/Kconfig | 10 + kernel/entry/common.c | 1 + kernel/exit.c | 2 + kernel/sched/Makefile | 1 + kernel/sched/core.c | 18 +- kernel/sched/fair.c | 4 + kernel/sched/sched.h | 15 +- kernel/sched/umcg.c | 745 +++++++++++++++++++++++++ kernel/sched/umcg_uaccess.h | 344 ++++++++++++ kernel/sys_ni.c | 4 + 18 files changed, 2408 insertions(+), 11 deletions(-) create mode 100644 Documentation/userspace-api/umcg.rst create mode 100644 Documentation/userspace-api/umcg.txt create mode 100644 include/uapi/linux/umcg.h create mode 100644 kernel/sched/umcg.c create mode 100644 kernel/sched/umcg_uaccess.h -- 2.25.1