Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp231487pxh; Tue, 9 Nov 2021 09:49:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxt/8Dp+th1I7SU9D9gYA5eBbaP3JtTy7sXNeg21sQ7DeKB5RaGKOZz/huL9Gz+LBdyBhVa X-Received: by 2002:a50:e041:: with SMTP id g1mr12554326edl.4.1636480140566; Tue, 09 Nov 2021 09:49:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636480140; cv=none; d=google.com; s=arc-20160816; b=N+GhDlXtVA4/88Q78XJ1CNDlaWdMINdxXqb00fT2onszXh1NCLuMgUfeBrYlAav6gm DTcs62nuj8W3/AmyTbCQ3ammylikWJ96aRN2OFq6nwMIlOx4pcZ0jcPMKIsfjscTnfMj gtTjbvOKUAHNIC2y7wodCwj3yca+xp5WGMUNtV0TFDwXyrE0LqEkkPJ0pv8Wy7mTpQ7p iuDHqjlYKnnHGt8UqA49y+dA+k7JTbD3yZZPtPag+oPex0/NwU+gAfvzGLTUn9EUMFpf tUQopukRtzhyIHHCILPYurTI4nxLS8kcJiVHcx6+oRlsKG/wCpfCai0ZCSqJ5vSU06wQ Ns0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YF0nJGr2F3cAY4yWpx0AziwiF6WyFVyJ2P8U7ZMBQ2k=; b=dEfv0TbcBoTVvXUqt8GSeIaizbRgxzM+AfsFlRq3mX10xj9OVDb0dmyrxnyq4KOA6I NeOJmCRZeZkea9FZMKfZMshCwdK5dyZFE5XO5cBbKnJslHU37nlidGNjQSf4JR1gsjJz 4vxRiJ7Iazh7FHbGnW6IOEXWucHgcbKi8zDcTCA4EzTJYJs4qapxGF5Aw4/POrJ9eg6Q cpNMXRT27AFAZ6EEvwiJNZwL/+VIXVMYZEH8RWc/3qewZSz/BMOSvdPwYayTRqwzTcyZ sbENXrc8itvDlMvXjqR2sGARAZGALNxTL61nTjUdZEfwHjI0UEMKE7IPIyq8Cb+9o5zC zHTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Rd9tJkCs; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v6si40882860edc.621.2021.11.09.09.48.35; Tue, 09 Nov 2021 09:49:00 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=Rd9tJkCs; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239360AbhKII6p (ORCPT + 99 others); Tue, 9 Nov 2021 03:58:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236483AbhKII6o (ORCPT ); Tue, 9 Nov 2021 03:58:44 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75A95C061764; Tue, 9 Nov 2021 00:55:58 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id ee33so74086486edb.8; Tue, 09 Nov 2021 00:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YF0nJGr2F3cAY4yWpx0AziwiF6WyFVyJ2P8U7ZMBQ2k=; b=Rd9tJkCsqFqsA1uFdxPhnYdcOJssqFpCCo9AOZ2RpFr6zA3rc+Lr+XL6yoYY0J+x/l 10K/j3jaHl4yd4Fi9YsIdkVK5lKvicLxe4z2YsnzWkIu4u375S0qlOvqb9m36w1gq9PT c4T6dZFiGrGyrsl4Ttx2SVax4CIbUEK8otiLMZnAFVCLYJy7wDduhp9egcd/VK5qEFqm XbJwq5hhMRkZdF4kfabHK+a4q+CGVh8pXVOgXH6pzPRKoBJZtjMWLQDmtoE9eWn/zoui 52UYC9rOIQqaWVchhIbtvjSyxAddEiacXS8hX7cSLMrXbqQmR8N+2oZBy8qotC7pBIJb J2tA== 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=YF0nJGr2F3cAY4yWpx0AziwiF6WyFVyJ2P8U7ZMBQ2k=; b=VG912Y+pR3rfgyTJvUwPZdWMv0ly7BPK0NOLBHfbgvQvOPnhJqVEL2m9bctkodvbU3 fxzzaETPPyYn1TK+T7zqR07FUK0m+1wL0i6iF3EeI2ess5G1vaVVlnmm/pJmSGrkrBUb jOyauIRXbHD/k6sZPMfX/1u2xEhnQkzmao/krZJPiPvMezdSYsBMJHP46Y5Aal8QD+Vq uOUW/n/woxDnNNN/38uw/r/IlyoKIhO6Ctm8+B4GSu31zXhFp0EfdOFKW3uRn8BZ6R6f gVdElxMzbNb7f/+pnzgVdiCGWERdFwaNSWtVFYzZDsGtjDduDbms3tOhILeo3KWSxHYt T0Ig== X-Gm-Message-State: AOAM533vztPyZ3czkQvczESNtWS738trQUhv7kapMD6+cOZuaVIBJHwV 8Ht6AYgepS/gE8Pkkaf7504JD3v7HV1jZPBEZi0= X-Received: by 2002:a17:907:6e0b:: with SMTP id sd11mr7258908ejc.134.1636448157072; Tue, 09 Nov 2021 00:55:57 -0800 (PST) MIME-Version: 1.0 References: <20211104195804.83240-1-posk@google.com> In-Reply-To: <20211104195804.83240-1-posk@google.com> From: Barry Song <21cnbao@gmail.com> Date: Tue, 9 Nov 2021 21:55:45 +1300 Message-ID: Subject: Re: [PATCH v0.8 0/6] sched,mm,x86/uaccess: implement User Managed Concurrency Groups To: posk@posk.io Cc: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Andrew Morton , Dave Hansen , Andy Lutomirski , Linux-MM , LKML , linux-api@vger.kernel.org, Paul Turner , Ben Segall , Peter Oskolkov , Andrei Vagin , Jann Horn , Thierry Delisle Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 5, 2021 at 8:58 AM 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. > > 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 Hi Peter, Do you have a real workload or an example application using UMCG? > > 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 > Thanks Barry