Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2911859pxb; Tue, 12 Oct 2021 16:27:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7spL1mCw2hnGldkNHSFrUd6jzNMCy6mPsDv/GlXG6jyPSQANUxPrXtujNDdQg8LF4mAIC X-Received: by 2002:a05:6402:40d0:: with SMTP id z16mr4252529edb.220.1634081257554; Tue, 12 Oct 2021 16:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634081257; cv=none; d=google.com; s=arc-20160816; b=VwZ2Y5VqgePmrwHnGbLzt8EO33pSQcUYHQ4HSaa4Ep+NOl+XwsuccGM/UDM2uvIs0Z Nxz0vFw/IzwIowyMPHBUrm85DAmTx5mdKbsDkqRvP1csLKJnazQ4b15TSEwKeV0VtxzF AmjusM6rn9YqxPQ2Qm6Sh7DJzoP0fmzHO+RMc+OJ370OP/yhN56hJj9kULkdo8IDK48e EJbnBeQf4P6yZZBHYPG8nv+aR3E2YcvDXlcSpXVS7iCNP6WR0AGKpfEkWn3d8Pq4XJoi ICQZChlozYDQJNR1Z2m7PXCM4XSERlocfa3abTTO2elDUUQvzvPOq01d5r2O2WUnld20 Wh7w== 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=+MCbUR+9Em0iYarChlkTpQ1HVke2G/DGf/+kVt506hA=; b=pc9uXUKsRC0/diQlfNSWIS7yto1BbeYt/tPkia7MoND5/k6ZqT3c8R1eX6IeNoSLke eNy/S9Gt20VDQmwu4sa7b7Yfp7BYg2WG2RDgn39l9ATnk9Ne8GeFT4QIED833E5PUu0G 4NMS+vYs9bEpXG/vBRUi3goI2cb0yu5eIf0rmYalFQtSqrk8ZjGXISbMeVv9eY5JseW1 jQC6tN84jLEFuw3rUHAr/L47eyiDfzNNfPSwPnDvmoW4ussCmQMiZ6Z0Hh0V0qTvLfnZ 4Z96UfNbElkJIK6gHJFdLM65/ZyHQNIMSNxC9xAWmoeS92hG69pRgn2aVE78vIg8DkgP 9hpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posk.io header.s=google header.b=K9rtvqDA; 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 by5si2421909edb.399.2021.10.12.16.27.14; Tue, 12 Oct 2021 16:27:37 -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=K9rtvqDA; 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 S229588AbhJLX1d (ORCPT + 99 others); Tue, 12 Oct 2021 19:27:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233180AbhJLX1d (ORCPT ); Tue, 12 Oct 2021 19:27:33 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2555C061745 for ; Tue, 12 Oct 2021 16:25:30 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id oa4so799266pjb.2 for ; Tue, 12 Oct 2021 16:25:30 -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=+MCbUR+9Em0iYarChlkTpQ1HVke2G/DGf/+kVt506hA=; b=K9rtvqDADOFi/pV5Xt1D0nPncFQCJGbmTgJ6Gh9DcnS3GNIm588XShQ24y6u8kIcAB GmbYJg3UT98mpFJfsSaNTUzmRplRn67F3kZuwMvDNrZq+PENH7D9XR1Wl0+y91tTRCnD bCd4A2n2YUHcESbQsCNiVMQCg0SDCPV1gMYMeg1xO8RwEYoWoCvPqK2AsKDAxuIOzNAv z1BeJuotoWsSKzPV6HyMGPBbdxkbLLSMS0lwPoaLj/FWv/vMZzBzoFNAHRAJqP6t5So6 Ay5NNU+Wu84lNQ08vuDl9qk97LMNxXBm9PREA9ck+9zarZYhb4SNrlHrlnwW7aHv+/zq Ws9g== 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=+MCbUR+9Em0iYarChlkTpQ1HVke2G/DGf/+kVt506hA=; b=lvUlA4m7uu/uSAns2FKi+ROQ7k71Fl4NrliYTYmnqi9MGvv174vCvG0tZKrrDU9Yhl 6YTpEp7F/+uUMtLqd/5B09b/INALF478jfSZIPcV0ZFG8bVBIRL0Bh5gQCYSgFjwoBw1 /VhuJ/4Mfiw3XinErqarjyqJpR3vSGKW4qtZLmzSea8orlTbf/FAfBNTiSaVj0H7HO0D Nc58OSlBlaDPoA4VhHqKeV5CD90jMFHjyjZ2GoAzY7ad/jMN6GsOaQdykofKzKIml05K +auIyj9QORq8xegxQE7g+JQipMA/5tf1p6iHDxS+RYFVuWtCczzPnVRJ2lCZLMxsmr37 0mzA== X-Gm-Message-State: AOAM532181+lR4vQw78AFq4HD2KsT8xvLaBWS6IzRAZNUP9R9M+/nLTe w0cgMGjY1KEww+TADLjV5uxS9A== X-Received: by 2002:a17:902:db01:b0:13e:d9ac:b8ff with SMTP id m1-20020a170902db0100b0013ed9acb8ffmr33135606plx.46.1634081130322; Tue, 12 Oct 2021 16:25:30 -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 v20sm12675026pgc.38.2021.10.12.16.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:25:29 -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.7 0/5] sched,mm,x86/uaccess: implement User Managed Concurrency Groups Date: Tue, 12 Oct 2021 16:25:17 -0700 Message-Id: <20211012232522.714898-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/20210917180323.278250-1-posk@google.com/ : - userspace atomic helpers moved into mm/ - UMCG task states are now tagged with timestamps - cross-mm interactions (wakeups) are not permitted - several smaller 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 userspace support in tools/lib/umcg/ - cleanup and post selftests in tools/testing/selftests/umcg/ - allow cross-mm wakeups (securely) I'm working on finalizing libumcg and kselftests. Signed-off-by: Peter Oskolkov Peter Oskolkov (5): sched/umcg: add WF_CURRENT_CPU and externise ttwu mm, x86/uaccess: add userspace atomic helpers sched/umcg: implement UMCG syscalls sched/umcg: add Documentation/userspace-api/umcg.rst sched/umcg: add Documentation/userspace-api/umcg.txt Documentation/userspace-api/umcg.rst | 611 ++++++++++++++++ Documentation/userspace-api/umcg.txt | 594 ++++++++++++++++ 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 | 926 +++++++++++++++++++++++++ kernel/sys_ni.c | 4 + mm/maccess.c | 264 +++++++ 20 files changed, 2797 insertions(+), 12 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 -- 2.25.1