Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2793559rdb; Fri, 22 Sep 2023 08:31:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGDUGgI1aQSLZoRajQVkFAZLwArUcvI9SttPFLauVK1N0ugoxuohlgEe1ClMHf2ya3T/jR X-Received: by 2002:a05:6358:4319:b0:13f:7e5:b397 with SMTP id r25-20020a056358431900b0013f07e5b397mr7339614rwc.7.1695396694835; Fri, 22 Sep 2023 08:31:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695396694; cv=none; d=google.com; s=arc-20160816; b=qwNsrFWDDIVZbtwCXqgpDEyNcFblt7yi7BmxUkrmJ/Y3OnMHNhcKVONtnFVEcdHG1g HXrK7HrT/3jigfoBIezpf0koF85zKQlOWzGdr5tKCRTyMPU5prgHRHDND/19zrh5jp/a 7THNDbqeKSlelbck8VNrVmVVY9F91mrONaTSIeR0vU16N4IMGKeDRFXC1VGfSZ2/gXld kwYP1y2snKBBUah8ECjIVaxULmiWRmoqLeN44SsJyOzSStOiipDXpqyWn8hTPyyMKtmi 4n7CI35lQGgwGvvnMNnzQ3EqhbN7BfU7IaPzmwYWrHXlIdWV6aPPUjAY9R0XGbhSdHjr +7Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UeywqmhCNAjqs52nmB6hEaX6k+k7gNhbsRsLtBV8z90=; fh=qJyz7lr5p8SlaLQwqHEVHmCEdu2GwbsNOvRu9irpq3A=; b=i9BbCMrKNQgMGhJ5dskRvAUuYYv8tVExRb7MZlJSAicZyFANXLbfXh3lJFGbJiiflV xv7i/LoA3fgEyyaG9e5jZA8RkioB2bzZSaIK8b9diYseQbnHKXLmYK7IRaeNQLS0yg/W shwflCQlih4TiWhbIO2sN+ATh/Pg5M4DxM0t7aQLoMU/NwjQwuY3jj/9R35VFdBd4gkd /9cGrQVHz1wvPEqAgSgjSHvDhTrEbuR0kC1r9RLb9Ikgo5Vz7cIm5giQlUA0YrsnxC3W ri7dlWTTFQHeDXFkZ1qvs2CLhvSvijg7A2EMyFYcNjNaD81hdZLo11XsD2OacWjy35HN 19JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=hCJ516bu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id k124-20020a636f82000000b0056b0b30d05csi3783401pgc.245.2023.09.22.08.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 08:31:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=hCJ516bu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3C55A80598BE; Fri, 22 Sep 2023 04:04:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233479AbjIVLEQ (ORCPT + 99 others); Fri, 22 Sep 2023 07:04:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229564AbjIVLEN (ORCPT ); Fri, 22 Sep 2023 07:04:13 -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 43BB7AC; Fri, 22 Sep 2023 04:04:06 -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=UeywqmhCNAjqs52nmB6hEaX6k+k7gNhbsRsLtBV8z90=; b=hCJ516bu07G2X0l5xL9adb9g6E IxQiOaVwZTkY0yDCJ9DvQXtyUchbVKae6U/uB9YY+ZbbNYrXjBkpSeI+XwhZ/efTrDqsUzvKsnyVU t3fRNF7HAjQbz+zAshIhfQM1S12/lAg9pmgeA5VLaBYQBfq8oCM8PE7d4j3ycr8WuZ/H3iX72HJQq QX7mlIPGj3UgO0WT0CSdy+g/UciSaSVYErDSvRME7Nds6CGDKZDQCflKPQiQoW7MCH7AXxa+y3kfk qDl3Q+krwQHTceGJcJbgNV9veRsfFK8Hz3ecySXMEZtJuo9TbDHRtnzyORGwdWrAqYUDJSuNGsTyQ 6Tjy9ZBA==; 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 1qjdwc-00GEJm-0p; Fri, 22 Sep 2023 11:03:35 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 5A95B30042E; Fri, 22 Sep 2023 13:03:35 +0200 (CEST) Date: Fri, 22 Sep 2023 13:03:35 +0200 From: Peter Zijlstra To: Ingo Molnar Cc: tglx@linutronix.de, axboe@kernel.dk, linux-kernel@vger.kernel.org, mingo@redhat.com, dvhart@infradead.org, dave@stgolabs.net, andrealmeid@igalia.com, Andrew Morton , urezki@gmail.com, hch@infradead.org, lstoakes@gmail.com, Arnd Bergmann , linux-api@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, malteskarupke@web.de, Geert Uytterhoeven Subject: Re: [PATCH v3 10/15] futex: Add sys_futex_requeue() Message-ID: <20230922110335.GC7080@noisy.programming.kicks-ass.net> References: <20230921104505.717750284@noisy.programming.kicks-ass.net> <20230921105248.511860556@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 22 Sep 2023 04:04:20 -0700 (PDT) On Fri, Sep 22, 2023 at 11:35:03AM +0200, Ingo Molnar wrote: > > * peterz@infradead.org wrote: > > > --- linux-2.6.orig/kernel/futex/syscalls.c > > +++ linux-2.6/kernel/futex/syscalls.c > > @@ -396,6 +396,44 @@ SYSCALL_DEFINE6(futex_wait, > > return ret; > > } > > > > +/* > > + * sys_futex_requeue - Requeue a waiter from one futex to another > > + * @waiters: array describing the source and destination futex > > + * @flags: unused > > + * @nr_wake: number of futexes to wake > > + * @nr_requeue: number of futexes to requeue > > + * > > + * Identical to the traditional FUTEX_CMP_REQUEUE op, except it is part of the > > + * futex2 family of calls. > > + */ > > + > > +SYSCALL_DEFINE4(futex_requeue, > > + struct futex_waitv __user *, waiters, > > + unsigned int, flags, > > + int, nr_wake, > > + int, nr_requeue) > > +{ > > + struct futex_vector futexes[2]; > > + u32 cmpval; > > + int ret; > > + > > + if (flags) > > + return -EINVAL; > > Small detail, but isn't -ENOSYS the canonical error code for functionality > not yet implemented - which the unused 'flags' ABI is arguably? > > -EINVAL is for recognized but incorrect parameters, such as: IIUC 'unknown flag' falls into the -EINVAL return category. Here we happen to have no known flags, but that should not matter.