Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1254499ybh; Thu, 23 Jul 2020 04:29:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiqz6K9l4jxQQLVz4xRhnL6g45jUfZDonrZ2dZOernuSnwQJQX9Jq6e7RJ7kVhxdvdbQnU X-Received: by 2002:a17:906:a1cc:: with SMTP id bx12mr3677856ejb.461.1595503798651; Thu, 23 Jul 2020 04:29:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595503798; cv=none; d=google.com; s=arc-20160816; b=jbDKQPCXCzXpY5sJdxBbjmyqp1/uY7AyWCkTCXgrh+76huCBmkJJpzGOEByTmVAekA RAvCfyiWjGiP1TWOKolT8DUQ+gnRGm50QgBkRMQ92Ra8eUzvUA5MJVP/G5J34u1cWrAg zOmKJ/imT0E1Qw30r5EsqMAIJk4VCzXYx0e8z5b+oUHaWWUGLY99Qnm4DKuDCY6Q83sW ha3ivMglMwD8ZQ96HPFUBT+DGAcsCdZ0iIUGuv+UGgpt76c62VDkJT9jOZw4bNzihAe/ 4xV80alY50rQdrBDCQotCk94oiG7UuLmQ8mrmQPPSN8UcZNZp828SpNiYi0SaeH30lFq Hd5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YgkYb9+mXjx9AMiNkQHw9z5f5bsoHW0FayfQqrx0gm0=; b=NzJlSZYSCU9QMJFdD7TmqhLs2/0l1cqD84YlKg63AbVH41OKN7dgrkjwrOmwhjc5VW BFeT1Bq9t/0qDi/i3Ef81XKjPvFqqe+Ga/dz3/ecSJlzeozq9Axd2pp8+p/r4/LtJBkJ ArBx1joYgr4NCWmFrZmI3Q++xLpyXdw4PLt9Io2AMKPcNDF9hzaK+5zywH6urgYTmL5Y 0p7+j/IjWD9tziut3BptjkiNGtZO2m5y1uHj+xXBTCi4MFxauMGpqx/7ZP7XQ2GMBI7I hUeFgxisqWqoIJ+lCkE4hNaGtBnbYwEawsplq8VLwL9aDoHdVx1okJpymlwZOwWl/i7Z fHsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=EUBfvEjY; 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 f15si1847130edt.552.2020.07.23.04.29.35; Thu, 23 Jul 2020 04:29:58 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=EUBfvEjY; 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 S1728647AbgGWL2L (ORCPT + 99 others); Thu, 23 Jul 2020 07:28:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728636AbgGWL2K (ORCPT ); Thu, 23 Jul 2020 07:28:10 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 722E8C0619DC for ; Thu, 23 Jul 2020 04:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YgkYb9+mXjx9AMiNkQHw9z5f5bsoHW0FayfQqrx0gm0=; b=EUBfvEjYINo6zYXuS9AtgTymxc sEF9uWBo6EyK2/TPvNKF85iyrdfBvpdqDIzEwuz4kuiewJP/ezm3Mf2KAl1UyNBCA7aXRv6dgiJ1L IHfr2HvF06zF20qFJWNjoeI6CSfKMDi4enYRs/uTES1Klo9qQa5tPfSWkPdI+MpRdJCQcESoVC4sJ CVet2ZxMAYHrQDUIadl07rmXJxx18/EeiFZzjKNgqBI1sVFqvidM3x00NVNm/2TbB3pSK+ZQChQ45 VV7GdFGp631uydfecF15dCkgst18fi5KZtepSH6EmHHsQag0JLzB0vJNFREoD3asWQZxLemIaZOWM VD7lExUA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyZOL-00013u-Sb; Thu, 23 Jul 2020 11:28:02 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 4E49B9821EE; Thu, 23 Jul 2020 13:27:57 +0200 (CEST) Date: Thu, 23 Jul 2020 13:27:57 +0200 From: Peter Zijlstra To: 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 Subject: Re: [PATCH for 5.9 1/3] futex: introduce FUTEX_SWAP operation Message-ID: <20200723112757.GN5523@worktop.programming.kicks-ass.net> References: <20200722234538.166697-1-posk@posk.io> <20200722234538.166697-2-posk@posk.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200722234538.166697-2-posk@posk.io> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 22, 2020 at 04:45:36PM -0700, Peter Oskolkov wrote: > This patchset is the first step to open-source this work. As explained > in the linked pdf and video, SwitchTo API has three core operations: wait, > resume, and swap (=switch). So this patchset adds a FUTEX_SWAP operation > that, in addition to FUTEX_WAIT and FUTEX_WAKE, will provide a foundation > on top of which user-space threading libraries can be built. The PDF and video can go pound sand; you get to fully explain things here. What worries me is how FUTEX_SWAP would interact with the future FUTEX_LOCK / FUTEX_UNLOCK. When we implement pthread_mutex with those, there's very few WAIT/WAKE left. Also, why would we commit to an ABI without ever having seen the rest? On another note: wake_up_process_prefer_current_cpu() is a horrific function name :/ That's half to a third of the line limit.