From patchwork Thu Jan 13 23:39:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Oskolkov X-Patchwork-Id: 12713189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36C6DC433F5 for ; Thu, 13 Jan 2022 23:40:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5C87F6B0072; Thu, 13 Jan 2022 18:40:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 550816B0073; Thu, 13 Jan 2022 18:40:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C98C6B0074; Thu, 13 Jan 2022 18:40:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0187.hostedemail.com [216.40.44.187]) by kanga.kvack.org (Postfix) with ESMTP id 28F4C6B0072 for ; Thu, 13 Jan 2022 18:40:03 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id CFD368E2FF for ; Thu, 13 Jan 2022 23:40:02 +0000 (UTC) X-FDA: 79026884244.06.FC1B4C1 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf04.hostedemail.com (Postfix) with ESMTP id 8C7F940006 for ; Thu, 13 Jan 2022 23:40:02 +0000 (UTC) Received: by mail-yb1-f202.google.com with SMTP id w189-20020a2549c6000000b00611c8be224cso4870634yba.14 for ; Thu, 13 Jan 2022 15:40:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=L3L608G8dLCC2M7zwc9YsP4GPhXeQWfVU2hcffF/nIQ=; b=tOOMnMmr4EweDOpVrMetgQw/nTj7tdLM9/og1CME1sbHCa1RgGMrZItNHCVmzxO9JA oAQCNeizO7OM953sQhxt34uuWWkRupyiEA9o4dRBAIE/XNL6E/in4N1Nfv67kjDfErwU /+Bi6mP5vtQtHVsPjPlGUeg3x6+avIiKSyDHtHs1MgYNPlQMRyhtGit4nOsYapDMWv2v 3PKITVR6WCP5SQ8sxWF9LehDb6ke9/6EWNX2bK52ZGp/BAF3Bf4b2p1+3Pl1jqpYLmN5 jphiRLI+Tr3+S0ei7PvlutokPwDMhatv0ww+2g8esIMuVsWEPxY3rDNqtWQjdES/C6e4 /clg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=L3L608G8dLCC2M7zwc9YsP4GPhXeQWfVU2hcffF/nIQ=; b=twrTWN1kYXYrNupe4YoWPDfDJ/CAHDBOyclXHdYfz12f9NDHECtAyq+iUodXbaNdwQ LNqDYuQfTeb43dIa6Hef2kGIpD1H9dkAt64M2ybbqF/E9OzVYSs4oo1tDNqqyos3EkyM UZ3IGUDkJeFjRszRoMdmPlCiSsOhgtyZHSCKZItuhszSkLK+Csr2XoapM1ZHJLgYsNwx 5W7SnLHsrttw5RxS1+GZDwncS9JM4renrcgd1o2DVrRbUAPZbD0mSNscJToj23ZRec+D eEROUQnnxdrNEqI8u9s910mIdk8E4Hwu2KVN0VJbGOdCec2EdssZWrzmScO9qO6GSneR u6Pg== X-Gm-Message-State: AOAM531fzBPOT+JG1Yb5AQz/sctQL4KuCKyhUnlIZotUj0//O7W4+yTz LmD/0TQHELBK+ayCoiEnCecitvoF X-Google-Smtp-Source: ABdhPJwd13mNuiyAq/bOxfawkAKuzEBTlexflryVlvN15dLvMviu88qazdMu0oVcevG2zyvWfwkli6lA X-Received: from posk.svl.corp.google.com ([2620:15c:2cd:202:c548:e79f:8954:121f]) (user=posk job=sendgmr) by 2002:a05:6902:1504:: with SMTP id q4mr9994403ybu.375.1642117201723; Thu, 13 Jan 2022 15:40:01 -0800 (PST) Date: Thu, 13 Jan 2022 15:39:35 -0800 Message-Id: <20220113233940.3608440-1-posk@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.34.1.703.g22d0c6ccf7-goog Subject: [RFC PATCH v2 0/5] User Managed Concurrency Groups From: Peter Oskolkov To: Peter Zijlstra , mingo@redhat.com, tglx@linutronix.de, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, x86@kernel.org, pjt@google.com, posk@google.com, avagin@google.com, jannh@google.com, tdelisle@uwaterloo.ca, posk@posk.io Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=tOOMnMmr; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf04.hostedemail.com: domain of 3UbjgYQQKCFoHGKC8GG8D6.4GEDAFMP-EECN24C.GJ8@flex--posk.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3UbjgYQQKCFoHGKC8GG8D6.4GEDAFMP-EECN24C.GJ8@flex--posk.bounces.google.com X-Stat-Signature: ghffuiztgxfzxqbqtzquucuxk415up6m X-Rspamd-Queue-Id: 8C7F940006 X-Rspamd-Server: rspam12 X-HE-Tag: 1642117202-912368 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This adds two small patches on top of peterz@'s RFC from https://lore.kernel.org/lkml/20211214204445.665580974@infradead.org/ The new patches are not fully tested - I'm still working on it. I'll post another patch shortly that adds worker timeouts in sys_umcg_wait(). Sending this out just to break the silence and to assess if the approach I'm taking here is not strongly NACKed. Peter Oskolkov (3): sched/umcg: add WF_CURRENT_CPU and externise ttwu sched: UMCG: add a blocked worker list sched: UMCG: allow to sys_umcg_kick UMCG servers Peter Zijlstra (2): x86/uaccess: Implement unsafe_try_cmpxchg_user() sched: User Mode Concurency Groups arch/x86/Kconfig | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 3 + arch/x86/include/asm/thread_info.h | 2 + arch/x86/include/asm/uaccess.h | 57 ++ fs/exec.c | 1 + include/linux/entry-common.h | 6 + include/linux/sched.h | 86 +++ include/linux/syscalls.h | 4 + include/linux/thread_info.h | 2 + include/uapi/asm-generic/unistd.h | 9 +- include/uapi/linux/umcg.h | 161 +++++ init/Kconfig | 15 + kernel/entry/common.c | 18 +- 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 | 913 +++++++++++++++++++++++++ kernel/sys_ni.c | 5 + 20 files changed, 1305 insertions(+), 15 deletions(-) create mode 100644 include/uapi/linux/umcg.h create mode 100644 kernel/sched/umcg.c base-commit: 85538cc07d6b6dcffc1df64a22308fcb05ecddf4