Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3979327pxv; Mon, 19 Jul 2021 13:29:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSWoC/JpjxTTh7JK/q0gJAqTkLDI2QTX9RLy4WTVVS3L8hpuGzBLZh5n1njvpeDeUlV+No X-Received: by 2002:a17:906:7302:: with SMTP id di2mr28748288ejc.409.1626726570552; Mon, 19 Jul 2021 13:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626726570; cv=none; d=google.com; s=arc-20160816; b=kqdybt9mTbpUqJPv1adXwYatXyjkJXJLuwbb7qhinjiytlYLzkdv6qfcQ5L+4OvDMC fG/OeIcK32RJcVj66nwwiG0ugyfq088iFixiLqsUsptkPE5B4ecwEaLDRfCBSwRNNWRZ W/niIPMgdjP0jo0j8EJi8B2Cr1QIcGexhEhQfi3+gnMEaVRFHkxlOFpen47/ani/XP9a TMr6G1lAj4RFRZNL7Lt3KF77HYuv+YbPguZJi6Ry6MqO1Pw2S7xPuth2/Mb/rBjxpFPC LmCPGcBodwj0SIvKjUQ+lEQej1hX8/jCY7wwF99tA/5kT7a+dXmCssm7CiRbc1MDcH2A imDQ== 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=4pU0r9hs1kSSmt7CkjgwyTiy4kbef4H0m4sD9VOE0lo=; b=bhQiSOKQs2Fnf3C2g5/9cxeZTYKnHuQcKZxKZltPxkLhMFSs6HIkSyqOmhlYSKDfkZ 7sBgrSF6eV/WC399Y8DzdBb/hpY+vGDmlD5gIpgwLcyBgQUfpM0KeXw6nVz6p0JcR7TL Jci7sqZYFaCVca1z+rt079/Cu2NcjDXL9SRa2CCjpcWshV7ZfD/xjdOXI+ZbNYSS0XUG gjqYGl/KmvyYlyh98xNexO8ikeLZ0aCC8bNqIj3C+MVMN3bETOlImBvFx7ABgdVqLmEb F/n69rtF8ba2jHVky0eLfXIsFiZ4ICY0s8qFkXsoojgUguI9wTyyzfUrQw23VHKkjz0V IBZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posk.io header.s=google header.b=Zw6wW8nx; 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 t1si20988374edq.503.2021.07.19.13.29.07; Mon, 19 Jul 2021 13:29:30 -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=Zw6wW8nx; 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 S1386721AbhGSThb (ORCPT + 99 others); Mon, 19 Jul 2021 15:37:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385721AbhGSTH6 (ORCPT ); Mon, 19 Jul 2021 15:07:58 -0400 Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C44AC0617A6 for ; Mon, 19 Jul 2021 12:39:08 -0700 (PDT) Received: by mail-ua1-x934.google.com with SMTP id 109so7243988uar.10 for ; Mon, 19 Jul 2021 12:46:21 -0700 (PDT) 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=4pU0r9hs1kSSmt7CkjgwyTiy4kbef4H0m4sD9VOE0lo=; b=Zw6wW8nxfTH3oPBuzjCMM6QBD3EdkiqPi2mbT24EnTuEmWFHKbFCrGK7tDiAtZ5PhG QZ9zw6G+u4F3IvKJ5PEIcpHHwrBklvy3fkXpOJpVRyJdq2wHM+5AFv+caKizuckLdBj1 c4FojA6liKva3VOa3kT6SgTn0TLi2aiqBJWyNtCZMPKdRP4qj6nAd6mcMnE88OXcS10L Ly1s6JfOznAi0b9FrqGHP0/DkFHjWqEKctXwWiENZbEL8w1PPfkgA2U65oSJO5m/C13x ZDwdeaS0XP5NLEfKVlanbGdfAj6HPy4n2p5asPtynoLdphyqW3V3PV+hJ1RJVAiYVZF6 k6aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4pU0r9hs1kSSmt7CkjgwyTiy4kbef4H0m4sD9VOE0lo=; b=AXokp5u/sCCKis+jjdGrZ8Mb/36mjDsi3H7G2z7D7jvYe4xPfqDZYlzJ7EQ2W8OtEF y8jcvNkBFpmBo0CSlXYeSxjls6MjAIoUwJGtj81nIyF3j7sqBvXUsH9Mz9B50Sy63S9v kn4UDQpiLFEsqlDyecCn0QOMKUTFAs3pA49tXBURnv0HvvylzlEwSgeP20MKCsSwyn1Z igZn+sYSjkpMJxp/12537ZjEMC8b6hMhkql/pauGAkcFOcGkCjvkiiUcZ+Y/d/JbEMM0 8suaRWqEmhe+Nb1p5GV/UbPdt6orR88eqX5JVHtygyZGWUywCk+iLwnhOdYTdtoJDg1w mLjg== X-Gm-Message-State: AOAM533gpkwgHG9uxhcjWum2KjRSAzYHOl0Eq2Su3yu9KmOppbIdrnuv PazwTnp2UED8skhzxXYP9tOjCQmOhMQwYEiKWVWx2g== X-Received: by 2002:ab0:6797:: with SMTP id v23mr27731456uar.71.1626723980418; Mon, 19 Jul 2021 12:46:20 -0700 (PDT) MIME-Version: 1.0 References: <20210716184719.269033-5-posk@google.com> <2c971806-b8f6-50b9-491f-e1ede4a33579@uwaterloo.ca> In-Reply-To: From: Peter Oskolkov Date: Mon, 19 Jul 2021 12:46:09 -0700 Message-ID: Subject: Re: [RFC PATCH 4/4 v0.3] sched/umcg: RFC: implement UMCG syscalls To: Thierry Delisle Cc: Peter Oskolkov , Andrei Vagin , Ben Segall , Jann Horn , Jim Newsome , Joel Fernandes , linux-api@vger.kernel.org, Linux Kernel Mailing List , Ingo Molnar , Peter Zijlstra , Paul Turner , Thomas Gleixner , Peter Buhr Content-Type: multipart/mixed; boundary="00000000000000512205c77f31f3" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000000512205c77f31f3 Content-Type: text/plain; charset="UTF-8" On Mon, Jul 19, 2021 at 11:13 AM Thierry Delisle wrote: > > > Latency/efficiency: on worker wakeup an idle server can be picked from > > the list and context-switched into synchronously, on the same CPU. > > Using FDs and select/poll/epoll will add extra layers of abstractions; > > synchronous context-switches (not yet fully implemented in UMCG) will > > most likely be impossible. This patchset seems much more efficient and > > lightweight than whatever can be built on top of FDs. > > I can believe that. > > Are you planning to support separate scheduling instances within a > single user > space? That is having multiple sets of server threads and workers can > only run > within a specific set. Yes, this is naturally supported in the current patchset on the kernel side, and is supported in libumcg (to be posted, later when the kernel side is settled); internally at Google, some applications use different "groups" of workers/servers per NUMA node. > > I believe the problem with the idle_servers_ptr as specified is that it > is not > possible to reclaim used nodes safely. I don't see any indication of which > nodes the kernel can concurrently access and on which some memory > reclamation > scheme could be based. Please see the attached atomic_stack.h file - I use it in my tests, things seem to be working. Specifically, atomic_stack_gc does the cleanup. For the kernel side of things, see the third patch in this patchset. > > What is the benefit of having users maintain themselves a list of idle > servers > rather than each servers marking themselves as 'out of work' and having the > kernel maintain the list? To keep the kernel side light and simple. To also protect the kernel from spinning if userspace misbehaves. Basically, the overall approach is to delegate most of the work to the userspace, and keep the bare minimum in the kernel. --00000000000000512205c77f31f3 Content-Type: text/x-chdr; charset="US-ASCII"; name="atomic_stack.h" Content-Disposition: attachment; filename="atomic_stack.h" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_krb1avrq0 LyogU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEdQTC0yLjAgKi8KCiNpZm5kZWYgX19BVE9NSUNf U1RBQ0tfSAojZGVmaW5lIF9fQVRPTUlDX1NUQUNLX0gKCiNpbmNsdWRlIDxhc3NlcnQuaD4KI2lu Y2x1ZGUgPHN0ZGF0b21pYy5oPgojaW5jbHVkZSA8c3RkYm9vbC5oPgojaW5jbHVkZSA8c3RkZGVm Lmg+CiNpbmNsdWRlIDxzdGRpbnQuaD4KCiNpbmNsdWRlIDxzdGRpby5oPgojaW5jbHVkZSA8c3Rk bGliLmg+CgovKgogKiBBdG9taWMgU3RhY2s6IGEgc2lnbGUtbGlua2VkIHN0YWNrIHRoYXQgYWxs b3dzIGZ1bGx5IGNvbmN1cnJlbnQKICogcHVzaC9wb3Agb3BlcmF0aW9ucy4KICoKICogVGhlIHN0 YWNrIGlzIHNpbXBsZTogaGVhZC0+bm9kZS0+bm9kZS0+TlVMTC4KICoKICoKICogU2FtcGxlIHVz YWdlOgogKgogKglzdHJ1Y3QgbXlfc3RhY2tfbm9kZSB7CiAqCQl0eXBlMSB2YWwxOwogKgkJdHlw ZTIgdmFsMjsKICoJCXVpbnQ2NF90IG5leHQ7CiAqCX0gX19hdHRyaWJ1dGVfXygoYWxpZ25lZCg4 KSkpOwogKgogKgl1aW50NjRfdCBoZWFkID0gMFVMOwogKglzdHJ1Y3QgbXlfc3RhY2tfbm9kZSAq bm9kZTsKICoKICoJbm9kZSA9IG1hbGxvYyhzaXplb2Yoc3RydWN0IG15X3N0YWNrX25vZGUpKTsK ICoJbm9kZS0+dmFsMSA9IHh4eDsKICoJbm9kZS0+dmFsMiA9IHl5eTsKICoJYXRvbWljX3N0YWNr X3B1c2goJmhlYWQsICZub2RlLT5uZXh0KTsKICoKICoJYXNzZXJ0KG5vZGUgPT0gY29udGFpbm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