From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 3461F1F8C6 for ; Wed, 18 Aug 2021 19:45:50 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2D2E73986422 for ; Wed, 18 Aug 2021 19:45:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D2E73986422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629315947; bh=ugd5yMYYslAQneDH7qKf8oseYTGEw+5qM8tsVxHTGIo=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=YMdBkdQMyUsNkXOVIuQKVShx1Gf7uRJDMCHWnpDBPmd3ez6Bk4AT++dVzR86FS6wF pha37cZce4J/5cYIi264ybfxwUAvEc9tYiQXkewUoreF/AZeWE1Zvr+ESdYXbYt+dp dAev721dRT0ROJxoToebRhB0tJwShxPjK14swrfU= Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by sourceware.org (Postfix) with ESMTPS id 0CB81385043B for ; Wed, 18 Aug 2021 19:45:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0CB81385043B To: Peter Zijlstra Subject: Re: [PATCH 2/4] futex2: Implement vectorized wait In-Reply-To: <20210818162034.GA26408@worktop.programming.kicks-ass.net> References: <20210805190405.59110-1-andrealmeid@collabora.com> <20210805190405.59110-3-andrealmeid@collabora.com> <87v94310gm.ffs@tglx> <20210818162034.GA26408@worktop.programming.kicks-ass.net> Date: Wed, 18 Aug 2021 21:45:15 +0200 Message-ID: <87k0ki1qr8.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Thomas Gleixner via Libc-alpha Reply-To: Thomas Gleixner Cc: Davidlohr Bueso , libc-alpha@sourceware.org, linux-api@vger.kernel.org, Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Steven Rostedt , Ingo Molnar , mtk.manpages@gmail.com, =?utf-8?Q?Andr=C3=A9?= Almeida , Darren Hart , kernel@collabora.com, krisman@collabora.com Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Wed, Aug 18 2021 at 18:20, Peter Zijlstra wrote: > On Wed, Aug 18, 2021 at 01:00:57PM +0200, Thomas Gleixner wrote: >> > +/** >> > + * struct futex_waitv - A waiter for vectorized wait >> > + * @val: Expected value at uaddr >> > + * @uaddr: User address to wait on >> > + * @flags: Flags for this waiter >> > + */ >> > +struct futex_waitv { >> > + __u64 val; >> >> Again. Why u64? > > So I think the idea was that if we're going to do new syscalls, we > should cater for future extentions, one of which was 64bit futexes (for > 64bit archs) (along with u{8,16,32}) > > The previous set of patches implemented a more complete replacement ABI > -- which I rather liked, however the implementation was completely > disjoint from the existing futexes, which was a non-starter for me. > > Anyway, yes, current futexes are u32, but if we want to ever do u64 > futexes, we should either do this syscall with a u64, or already plan to > retire the whole syscall. > > Obiously this would've made good Changelog material, but alas it wasn't > there. Fair enough, but OTOH 64bit futexes for 64bit architectures: What's exactly the point? Just because 64bit architectures can implement it is not really a good reason. Where is the use case and the benefit and what's the workaround for 32bit user space / architectures? I'm not opposed against variable sized futexes in principle, but they come with limitations and we end up with tons of sanity checks and exclusions all over the place. The 32bit futexes have a charm as they just work for all architectures and the interaction with PI and robust list is trivial and well established. I serioulsy doubt that 8 and 16 bit futexes can be actually used for locking in a meaningful way. If they are purely wait/wake then the question is whether they actually fit into futex in the first place or just happen to be implementable via futexes. Thanks, tglx