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 X-Spam-Level: X-Spam-Status: No, score=-6.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74502C4707D for ; Fri, 21 May 2021 19:32:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51D1560FE7 for ; Fri, 21 May 2021 19:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239089AbhEUTdo (ORCPT ); Fri, 21 May 2021 15:33:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:41036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236901AbhEUTdn (ORCPT ); Fri, 21 May 2021 15:33:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1C52B613DB for ; Fri, 21 May 2021 19:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621625540; bh=jOeW49R3D0Xy2MYiigIe+4z2oWaYZOxfJxbogqAUeQg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=c4BD7AloCgBm56PmefVxQyf6soTh2DAU9qMfGz868gWnF23EP949zWfAt+Ew0BPHT u+Q2kWlyzJzd4aNbZ8du2ydCEiEf2rnY0+KlhGr7D35l+6mu0AunSThHZy99ysTIvF 4mTPdmPZqhYii2P9ZUMp+wIyxk+qTpZG3my61++UCIiZ8u5xi76m5UUS8M5zOn+h0m 3/8zDdUP28Xt954AM3ykTM9Q6glnGF1ZV92noMzq3GXkBn0mJACYRA5Dyj3Z8rWw8R E4GoarrvP1tSnuDElnKALoIRlfJSg4xbbvmFM7DVxDXAU/EOnKyDDNMXvwXYzPFeXY sMjbOf1fl7gFg== Received: by mail-ed1-f44.google.com with SMTP id r11so24468983edt.13 for ; Fri, 21 May 2021 12:32:20 -0700 (PDT) X-Gm-Message-State: AOAM5330yClBFinGKOyLqAwuJzJf1LzanYL6GA54jD1+ewBbd/1SSp5R 7EFjHlHehm+9Aq3eUKYLmU+GQh6Hsb+BFpL/SWn/iA== X-Google-Smtp-Source: ABdhPJymY0D4EZweyfuHuPn+GXWKUbV4mm81DjwQWS/Fppjj/RBVIj5orTVVxZwikuPCXSbDsXn6I/3H3h0L+EV3D7M= X-Received: by 2002:a05:6402:4313:: with SMTP id m19mr12643717edc.263.1621625538643; Fri, 21 May 2021 12:32:18 -0700 (PDT) MIME-Version: 1.0 References: <20210520183614.1227046-1-posk@google.com> <20210520183614.1227046-5-posk@google.com> In-Reply-To: <20210520183614.1227046-5-posk@google.com> From: Andy Lutomirski Date: Fri, 21 May 2021 12:32:07 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v0.1 4/9] sched/umcg: implement core UMCG API To: Peter Oskolkov Cc: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , LKML , Linux API , Paul Turner , Ben Segall , Peter Oskolkov , Joel Fernandes , Andrew Morton , Andrei Vagin , Jim Newsome Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 20, 2021 at 11:36 AM Peter Oskolkov wrote: > > Implement version 1 of core UMCG API (wait/wake/swap). > > As has been outlined in > https://lore.kernel.org/lkml/20200722234538.166697-1-posk@posk.io/, > efficient and synchronous on-CPU context switching is key > to enabling two broad use cases: in-process M:N userspace scheduling > and fast X-process RPCs for security wrappers. > > High-level design considerations/approaches used: > - wait & wake can race with each other; > - offload as much work as possible to libumcg in tools/lib/umcg, > specifically: > - most state changes, e.g. RUNNABLE <=> RUNNING, are done in > the userspace (libumcg); > - retries are offloaded to the userspace. Do you have some perf numbers as to how long a UMCG context switch takes compared to a normal one? --Andy