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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F159C0015E for ; Fri, 14 Jul 2023 14:48:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235995AbjGNOsL (ORCPT ); Fri, 14 Jul 2023 10:48:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234562AbjGNOsK (ORCPT ); Fri, 14 Jul 2023 10:48:10 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D541D2690; Fri, 14 Jul 2023 07:48:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=njTLHLFMh16HuHE6NvqX3Yjrmk8yNTzTQKCOyHUveJs=; b=WZYk4jxaFlnChcvddb0bl2o/as xkSs+mNy8/ZsEWQhsbL0TVjICEaLcZIVyHbJOqK4v9MskwnDo/Mzay+QctqXTWBD1JqUmBM1TYEas B8kItNsA2ZcQ+/ThLZqrtLu4b1Kw37BQo50qAh2QDK0KMODZ6xWrRJ/nYSMuNqhvA0oKdXDm5k7wv F7VAGnV9cuJub90tZH8EXoE7I/MZ+Ei7W+djkMs4XEhT6bsd0/hSrcYTlfXNDVH5pKaSFFwVNEzrs QhCfu3gEXGnjOCfmXegxdbtMbLPEp/4SLHPuXl3PTfsnckUSMJKfd2lPDA0+LNFf7wmVY808dcM8p CmySDnkA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qKK5G-006J0O-1m; Fri, 14 Jul 2023 14:47:50 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 542A53001E7; Fri, 14 Jul 2023 16:47:49 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3AEB8213728A5; Fri, 14 Jul 2023 16:47:49 +0200 (CEST) Date: Fri, 14 Jul 2023 16:47:49 +0200 From: Peter Zijlstra To: Arnd Bergmann Cc: Thomas Gleixner , Jens Axboe , linux-kernel@vger.kernel.org, Ingo Molnar , Darren Hart , dave@stgolabs.net, andrealmeid@igalia.com, Andrew Morton , urezki@gmail.com, Christoph Hellwig , Lorenzo Stoakes , linux-api@vger.kernel.org, linux-mm@kvack.org, Linux-Arch , malteskarupke@web.de Subject: Re: [RFC][PATCH 04/10] futex: Add sys_futex_wake() Message-ID: <20230714144749.GA3261758@hirez.programming.kicks-ass.net> References: <20230714133859.305719029@infradead.org> <20230714141218.879715585@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Fri, Jul 14, 2023 at 04:26:45PM +0200, Arnd Bergmann wrote: > On Fri, Jul 14, 2023, at 15:39, Peter Zijlstra wrote: > > > > +++ b/include/linux/syscalls.h > > @@ -563,6 +563,9 @@ asmlinkage long sys_set_robust_list(stru > > asmlinkage long sys_futex_waitv(struct futex_waitv *waiters, > > unsigned int nr_futexes, unsigned int flags, > > struct __kernel_timespec __user *timeout, clockid_t clockid); > > + > > +asmlinkage long sys_futex_wake(void __user *uaddr, int nr, unsigned > > int flags, u64 mask); > > + > > You can't really use 'u64' arguments in portable syscalls, it causes > a couple of problems, both with defining the user space wrappers, > and with compat mode. > > Variants that would work include: > > - using 'unsigned long' instead of 'u64' > - passing 'mask' by reference, as in splice() > - passing the mask in two u32-bit arguments like in llseek() > > Not sure if any of the above work for you. Durr, I was hoping they'd use register pairs, but yeah I can see how that would be very hard to do in generic code. Hurmph.. using 2 u32s is unfortunate on 64bit, while unsigned long would limit 64bit futexes to 64bit machines (perhaps not too bad). Using unsigned long would help with the futex_wait() thing as well. I'll ponder things a bit. Obviously I only did build x86_64 ;-)