From mboxrd@z Thu Jan 1 00:00:00 1970 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 16356C433F5 for ; Wed, 24 Nov 2021 16:29:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C5036B0075; Wed, 24 Nov 2021 11:29:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 773956B0078; Wed, 24 Nov 2021 11:29:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 613B96B007B; Wed, 24 Nov 2021 11:29:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0157.hostedemail.com [216.40.44.157]) by kanga.kvack.org (Postfix) with ESMTP id 4D9536B0075 for ; Wed, 24 Nov 2021 11:29:05 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 024518D6D9 for ; Wed, 24 Nov 2021 16:28:55 +0000 (UTC) X-FDA: 78844357746.17.9244686 Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) by imf27.hostedemail.com (Postfix) with ESMTP id 4F95D70000BD for ; Wed, 24 Nov 2021 16:28:53 +0000 (UTC) Received: by mail-ua1-f45.google.com with SMTP id o1so6293252uap.4 for ; Wed, 24 Nov 2021 08:28:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posk.io; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0yN6Nmt9ug88Fg5aU4VU/Ivh+jZZugsPIfs+d6Xfs88=; b=EayTDztFxh4IJrHx8ZTsUNpB2t76+XRcpJ+eZ79qHHu2VYAaYmINaxyFWi5TAuKmfr zWLA2FQa0AU2MjDGeXZ1tkNMPsFTUsLe0tDKl1LjBNoZNa98l4niwDPyQ+DubuUbiqmZ k7Hzf9Wm5zCuIiWyUzBw1rHl3FbizNHt0p42jq+XHl4To2a+mg/rixpCf4dllHJ0Ybr5 C3D4sx8sMCV67YOoMw1v4xMjT5RShJmZTO4QjyJlmK0DZsk+poGGA+2GppsqIYGrDpQX lQhBMAwXNEYiWKM59R/0GfmGRBekvYUyRZZWmkgbSPOUrD6p0dI+MHrt0pn0edI77fU7 BQlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0yN6Nmt9ug88Fg5aU4VU/Ivh+jZZugsPIfs+d6Xfs88=; b=RDB4gzQVTrCVUlkU8iofM/NPpJpe/iSwXcFrwnj/W7hmvmaCMdNk/zm0fPJH8sRB/9 LhooBySsdeFiPln0C3LGE6bKCvN8pfCmucL4YRUaCOdxeyadR1Pfi9D4Ae/zNpgAAVnF h85RXwOGHPmzSs07k0/Tb/5C3IRx5j0dfpK53vDaOlwi4e9+A6oQtuMu8Vf1wfO8RCqW 5nEUdW7J3ZVzAXlvfByCdHqoMA8cpN+pyHJrpjPqcSkOPMNKeMGVgCknm3fVgPZ1YWmQ EhJKuoDx+X0kO0bnU5vBfBmu+6IpnzZuXd/TTBC2WZxSzD/++XAfPfIsD7xCLJ5Hd/b4 EbOg== X-Gm-Message-State: AOAM530SCr1eil/5LJrNKcH0CCm1x1LXsyHPVbwPb5pQn2IXUk3W2ue8 5aHlzBo2OCdB49Jppus4mThryLyjuS2dTrVCtbcnQg== X-Google-Smtp-Source: ABdhPJxZZQgEDWCNTylmZHsM0ICOHv3PAjc+H6pgfOuNvz+aCpOvcr1mwhE1Q3TeVLPXP0qYqOvxn7gLBVAICpNHPN8= X-Received: by 2002:a9f:2431:: with SMTP id 46mr12240607uaq.114.1637771333863; Wed, 24 Nov 2021 08:28:53 -0800 (PST) MIME-Version: 1.0 References: <20211122211327.5931-1-posk@google.com> In-Reply-To: From: Peter Oskolkov Date: Wed, 24 Nov 2021 08:28:43 -0800 Message-ID: Subject: Re: [PATCH v0.9.1 0/6] sched,mm,x86/uaccess: implement User Managed Concurrency Groups To: Peter Zijlstra Cc: Ingo Molnar , Thomas Gleixner , Andrew Morton , Dave Hansen , Andy Lutomirski , Linux Memory Management List , Linux Kernel Mailing List , linux-api@vger.kernel.org, Paul Turner , Ben Segall , Peter Oskolkov , Andrei Vagin , Jann Horn , Thierry Delisle Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 4F95D70000BD X-Stat-Signature: 8badtwcup8ydnn8635hbx3kfhjtnerbj Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=posk.io header.s=google header.b=EayTDztF; dmarc=none; spf=pass (imf27.hostedemail.com: domain of posk@posk.io designates 209.85.222.45 as permitted sender) smtp.mailfrom=posk@posk.io X-HE-Tag: 1637771333-2297 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: On Wed, Nov 24, 2021 at 6:06 AM Peter Zijlstra wrote: > > On Mon, Nov 22, 2021 at 01:13:21PM -0800, Peter Oskolkov wrote: > > User Managed Concurrency Groups (UMCG) is an M:N threading > > subsystem/toolkit that lets user space application developers implement > > in-process user space schedulers. > > > > This v0.9.1 patchset is the same as v0.9, where u32/u64 in > > uapi/linux/umcg.h are replaced with __u32/__u64, as test robot/lkp > > does not recognize u32/u64 for some reason. > > > > v0.9 is v0.8 rebased on top of the current tip/sched/core, > > with a fix in umcg_update_state of an issue reported by Tao Zhou. > > > > Key changes from patchset v0.7: > > 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) > > *groan*... so these patches do *NOT* support the very thing this all > started with, namely block + wakeup notifications. I'm really not sure > how that happened, as that was the sole purpose of the exercise. I'm not sure why you say this - in-process block/wakeup is very much supported - please see the third patch. Cross-process (cross-mm) wakeups are not supported at the moment, as the security story has to be fleshed out. > > Aside of that, the whole uaccess stuff is horrific :-( I'll reply to > that email separately, but the alternative is also included in the > random hackery below. Thanks - I'll try to make uaccess more to your liking, unless you say the whole thing is a no-go. > > I'm still trying to make sense of it all, but I'm really not seeing how > any of this satisfies the initial goals, also it is once again 100% new > code :/ I believe the initial goals of in-process block/wakeup detection, on-cpu context switching, etc. are all achieved here. Re: new code: the code in the third patch evolved into what it is today based on feedback/discussions in this list. [...]