Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp516051pxa; Tue, 11 Aug 2020 08:29:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd/eov5xEK1lPiDtzXm6UJr0q7zOTtKCaH6m4CYzWBsT0fgmL5YhgDme6YM0DnUZ0XN8gi X-Received: by 2002:a17:906:4c97:: with SMTP id q23mr27951000eju.11.1597159771409; Tue, 11 Aug 2020 08:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597159771; cv=none; d=google.com; s=arc-20160816; b=kqcndiaS56ucYdPeSupXNZWqiQluTKriSZ+G+kz7d12isqroQqsgWYnMKigXQVnOP+ M1X96Uz5fJ4qbKqUH9JWwZLCwGo5WTdF0PWp6cjxcWioDJd9p071evlaezl7D9esBXuB OiUMUygcZayR3UKqCfZrQeNwcl7DW2fG8N7dSroZvWqzd0ygrklt83H0psyWiVQjCv8o TatUW37S5cAXzt+qoiirNM0/+B90XFlJJuRjENftjz/RGibPtPv1JTubvQ8ufY54/9C/ E42pO4vcwV6qz4IIl3byaKaimyyR0QkrxpdnYI+kk4MPbglkS2AJ/XnlwAYad7Y4Z38H 8Snw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=P5DK7hKP89Yv+2X8QG0NE/96d/hrmV26gffyen09JOQ=; b=NejOWDLAi7r+H55xJvsRDOKXlD9vrkVHtl8i9vgI+HyLxcnl5jBDA/BYbqHV5lTSCl X4oNWntMW9nsfl0iEi3LyPKoqJ7wf/g1mf7RuqeXXBuutf7RdJpOOQG3misQtU3k2Nh/ WXe8z6gVxVSyDGvB0FDFG/rYU8P5WrP1xrQ/U5zPFLQmq/+yCo/rkUntwpo8ZK98xKVw SQIsIDOm43JZSV4ZxChFu1pJzmJ3yDM2JASEFze0dxv1ri+v8B87VUHaW76zDxfTe2wk sq1r4aujvnpWdcd9mKoZv5Cc/1GSQhbiMdwxj3FzzLEwpecXoPZRHOgb1KdBfY48cv8X q9ag== ARC-Authentication-Results: i=1; mx.google.com; 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 i5si13036138edd.112.2020.08.11.08.29.07; Tue, 11 Aug 2020 08:29:31 -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; 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 S1728955AbgHKP0a (ORCPT + 99 others); Tue, 11 Aug 2020 11:26:30 -0400 Received: from shelob.surriel.com ([96.67.55.147]:51782 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728833AbgHKP03 (ORCPT ); Tue, 11 Aug 2020 11:26:29 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1k5WAP-0000L2-7E; Tue, 11 Aug 2020 11:26:21 -0400 Message-ID: Subject: Re: [PATCH for 5.9 v2 1/4] futex: introduce FUTEX_SWAP operation From: Rik van Riel To: peterz@infradead.org, Peter Oskolkov Cc: Linux Kernel Mailing List , Thomas Gleixner , Ingo Molnar , Ingo Molnar , Darren Hart , Vincent Guittot , Peter Oskolkov , Andrei Vagin , Paul Turner , Ben Segall , Aaron Lu Date: Tue, 11 Aug 2020 11:26:20 -0400 In-Reply-To: <20200804123147.GI2674@hirez.programming.kicks-ass.net> References: <20200803221510.170674-1-posk@posk.io> <20200803221510.170674-2-posk@posk.io> <20200804123147.GI2674@hirez.programming.kicks-ass.net> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-RJsqJcckj6wQC4gZIoGP" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-RJsqJcckj6wQC4gZIoGP Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2020-08-04 at 14:31 +0200, peterz@infradead.org wrote: > On Mon, Aug 03, 2020 at 03:15:07PM -0700, Peter Oskolkov wrote: > > A simplified/idealized use case: imagine a multi-user service > > application > > (e.g. a DBMS) that has to implement the following user CPU quota > > policy: >=20 > So the last posting made hackernews; and there a bunch expressed far > more interest in coroutines, which, if I'm not mistaken, can also be > implemented using all this. >=20 > Would that not make for a far simpler and more convincing use-case? Also just worker threads in general. Instead of waking up an idle worker thread every time a new request comes in, why not allow worker threads to indicate "I'm almost done", and the main/receiving thread to enqueue the new request, to be handled when the worker thread is done with the current request? > I really think we want to have block/resume detection sorted before > this > goes anywhere, I also strongly feel BPF should not be used for > functional interfaces like that. >=20 > That is, I want to see a complete interface before I want to commit > to > an ABI that we're stuck with. The work case above also needs to have that figured out, for the (slow path, but still common) case of the worker thread actually having gone to sleep while the work got enqueued, and then needing to be woken up anyway. Not sure that is a direction you are interested in, given the description, but it could make coroutines and worker threads more efficient :) --=20 All Rights Reversed. --=-RJsqJcckj6wQC4gZIoGP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl8yuJwACgkQznnekoTE 3oNbgggAwBO/BAmj8n+qEFRTCkdwzHNl90lkqKNMQXHJC+tVuATC/SkdIeYwwxLq df3aSMxGfNqO4dOg9qs3adNAHZL43ttZ01+SYppfyaIniebPHfOYU6ezYqdH7/Zt 6NTQHp237I890cfqcXhPJdJqt4OyR9m0hpKu7XCR9MbHtcNAiT1NYTIXEMrJuj/x lLVndwUcFTtg4gwFsb7PnAiUn5dJeTcYgXxwXf4TvGCkgFlXP0M6+rJV/kM3pjWD D5SLnzS8JNtVU5ASyFQlVxAzVev8Jxud36C7gqeQKA1WVXQktVAQqsTIeMXxeK1e 7bFNA8BEE5btQLrXUUfeufw6ofWz/g== =KAJv -----END PGP SIGNATURE----- --=-RJsqJcckj6wQC4gZIoGP--