Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2042171pxb; Thu, 4 Nov 2021 13:00:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8LKxhHwMpBmCCXS5Tkcx5Cd30aHPgmbOuQbN+Atjgjbono1IW7Nzb3u3DsjZL9Rh2JYoc X-Received: by 2002:a17:907:6da9:: with SMTP id sb41mr867890ejc.88.1636056021812; Thu, 04 Nov 2021 13:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636056021; cv=none; d=google.com; s=arc-20160816; b=X+zKv4F/+6qQXBAjb7Seg6jPMJEuCmXajon88uWPvkwv90zbcxcmPPJ9+/PoENH2Ia CB6ABUPl3iKZQrvGkyuFMAA7dVZj0ddB68ELiivlpdocX13kCT0ByYpGlz0GL4o2QZya 2/tt9laWJr9NBmS1RSNMQxTO3GWOa2o78g2zB1NmGrUDtaxhDjWkqHudmwh6lD5FKeuZ dAuK7tV2QJJ2JmdxinYeisuXt+AR/UZpo1aWdSTT7U/gWdVB4OHnB7QfaEDIw7sqUeLv EBpAtVVwt3/609VZmSHq3ZU5Qp01j3GNnEgbGzeoBxO1gBjQp8hh1D0DDA64A6CYolLK xEXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vuCt9AADoX+KE8RwAMppULbU69yu+KMFmMlPzvldw0A=; b=RCIYbJcCQnx41UBTEsqI2TN23HfWs5PA5zZ0oLp/a3YJw6KZR7sMeL7Ftxr2sBCjmn AwMjhQMZ4U2XSQh7vYOTJU+0Uo9tlHekeVqY9znnJePQ8BRUSeN7ZOTEPT731aOs8THN p/2+WiYPaDkfSVYaafyVc2wGnVd9Y8TQSmZe07Mb5QZH5NHX2mzuPU8LMN9DjcSJGG0s bGSn2IIGzxjNZEM1QmcOFKDaEoth+57+Q8mo9jwFO5eS836VaEZ7IJ8fk+/GxwjIXH/J mGAZLpwp7BocaAo7B3AAocugAf2nJoB4aMQKeb8zuS20ldTe5bo+dFxCjs2dxH4eEyx/ Md1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posk.io header.s=google header.b=RtBgCuis; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si8614980edm.510.2021.11.04.12.59.54; Thu, 04 Nov 2021 13:00:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@posk.io header.s=google header.b=RtBgCuis; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231826AbhKDUAt (ORCPT + 99 others); Thu, 4 Nov 2021 16:00:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231804AbhKDUAs (ORCPT ); Thu, 4 Nov 2021 16:00:48 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FB36C061203 for ; Thu, 4 Nov 2021 12:58:10 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id l3so4924666pfu.13 for ; Thu, 04 Nov 2021 12:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posk.io; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vuCt9AADoX+KE8RwAMppULbU69yu+KMFmMlPzvldw0A=; b=RtBgCuisgtMAvqQuwqPxumatdbc6iy2ebCURPV+sx7JsapFwfEDpg2Crb6Pw/VRQ3d gz6OuCg0CPqG/GgGvwV5t0ZJkS7XHol/EK3tp1MDePVUg9iZYnYI2Wl3Dj4NY4VLNJYn Cp/40yEncJTi+aEetB93uwAUANHZja1+lhkkjUEg6+uGuJWn9Rm/ouGoPB83yH3k44ez jNpSq9iovOXLH2Yf9zU7+K5mFXw6WNG8ZokeULaPeg7Q/Y1MvQboI3kTRHJJUi7gfeZb AQ4jBcmpvLbOCaCQMRS0ZmgQK2tb/RwrUFSgRFUxwQNvPdSStFtezmG+EO8VOzLacmpr 2zHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vuCt9AADoX+KE8RwAMppULbU69yu+KMFmMlPzvldw0A=; b=Gw4ekpvNU+mjCo4Inn4stsPf942xaT+ep8ytkoU9Lh0EAVtrD0oqhfntmLE3GEvH3Q xyMBJuqqsLSyxPr1rNvoeNHuLm3fVD/WL4+Ik8nZeEPP3hpU1I4x1eNOQ4h6lk0UFhA2 3evgRgcluhSHix/MbuMFpPkRhr+Csik4UgwCtVHNeBMUlhSjqG/6Yt/wMB2X7hfb58lC 22jly/+n+33WUPJgC/hijYHuIko4zRV2dyb91NPwKNj0RLF5A6pmSKa89jryyIKDTtd7 ogHWaCfXbCWeF0QvyheqLZUsWv6Z4xSN32nzO+n0gvGpe5WHFa3+9UFOWHHpf8WwCfnA m+2A== X-Gm-Message-State: AOAM533BWd3B4l24QzQpnXl26SoYNOVbkFEVH0nEldVwoYoMdJrWPkHX 0HDPZY/Z/dHdfrUrB93q1t+ePA== X-Received: by 2002:a63:2c8:: with SMTP id 191mr39910180pgc.293.1636055889635; Thu, 04 Nov 2021 12:58:09 -0700 (PDT) Received: from posk-g1.lan (23-118-52-46.lightspeed.sntcca.sbcglobal.net. [23.118.52.46]) by smtp.gmail.com with ESMTPSA id w185sm5487853pfb.38.2021.11.04.12.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 12:58:09 -0700 (PDT) From: Peter Oskolkov X-Google-Original-From: Peter Oskolkov To: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Andrew Morton , Dave Hansen , Andy Lutomirski , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: Paul Turner , Ben Segall , Peter Oskolkov , Peter Oskolkov , Andrei Vagin , Jann Horn , Thierry Delisle Subject: [PATCH v0.8 0/6] sched,mm,x86/uaccess: implement User Managed Concurrency Groups Date: Thu, 4 Nov 2021 12:57:58 -0700 Message-Id: <20211104195804.83240-1-posk@google.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org User Managed Concurrency Groups (UMCG) is an M:N threading subsystem/toolkit that lets user space application developers implement in-process user space schedulers. Key changes from the previous patchset https://lore.kernel.org/all/20211012232522.714898-1-posk@google.com/: - added libumcg tools/lib/umcg; - worker "wakeup" is reworked so that it is now purely a userspace op, instead of waking the thread in order for it to block on return to the userspace immediately; - a couple of minor fixes and refactorings. These big things remain to be addressed (in no particular order): - support tracing/debugging - make context switches faster (see umcg_do_context_switch in umcg.c) - support other architectures - cleanup and post selftests in tools/testing/selftests/umcg/ - allow cross-mm wakeups (securely) Peter Oskolkov (6): sched/umcg: add WF_CURRENT_CPU and externise ttwu mm, x86/uaccess: add userspace atomic helpers sched/umcg: implement UMCG syscalls sched/umcg, lib/umcg: implement libumcg sched/umcg: add Documentation/userspace-api/umcg.txt sched/umcg, lib/umcg: add tools/lib/umcg/libumcg.txt Documentation/userspace-api/umcg.txt | 598 ++++++++++++ arch/x86/entry/syscalls/syscall_64.tbl | 2 + arch/x86/include/asm/uaccess_64.h | 93 ++ fs/exec.c | 1 + include/linux/sched.h | 71 ++ include/linux/syscalls.h | 3 + include/linux/uaccess.h | 46 + include/uapi/asm-generic/unistd.h | 6 +- include/uapi/linux/umcg.h | 137 +++ init/Kconfig | 10 + kernel/entry/common.c | 4 +- kernel/exit.c | 5 + kernel/sched/Makefile | 1 + kernel/sched/core.c | 12 +- kernel/sched/fair.c | 4 + kernel/sched/sched.h | 15 +- kernel/sched/umcg.c | 949 +++++++++++++++++++ kernel/sys_ni.c | 4 + mm/maccess.c | 264 ++++++ tools/lib/umcg/.gitignore | 4 + tools/lib/umcg/Makefile | 11 + tools/lib/umcg/libumcg.c | 1201 ++++++++++++++++++++++++ tools/lib/umcg/libumcg.h | 299 ++++++ tools/lib/umcg/libumcg.txt | 438 +++++++++ 24 files changed, 4166 insertions(+), 12 deletions(-) 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 tools/lib/umcg/.gitignore create mode 100644 tools/lib/umcg/Makefile create mode 100644 tools/lib/umcg/libumcg.c create mode 100644 tools/lib/umcg/libumcg.h create mode 100644 tools/lib/umcg/libumcg.txt base-commit: 8ea9183db4ad8afbcb7089a77c23eaf965b0cacd -- 2.25.1