From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by sourceware.org (Postfix) with ESMTPS id C87743951835 for ; Tue, 8 Jun 2021 12:35:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C87743951835 Received: by mail.kernel.org (Postfix) with ESMTPSA id 76D8661287; Tue, 8 Jun 2021 12:35:16 +0000 (UTC) Date: Tue, 8 Jun 2021 14:35:14 +0200 From: Greg KH To: Andrey Semashev Cc: Nicholas Piggin , =?iso-8859-1?Q?Andr=E9?= Almeida , acme@kernel.org, Sebastian Andrzej Siewior , corbet@lwn.net, Davidlohr Bueso , Darren Hart , fweimer@redhat.com, joel@joelfernandes.org, kernel@collabora.com, krisman@collabora.com, libc-alpha@sourceware.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, malteskarupke@fastmail.fm, Ingo Molnar , Peter Zijlstra , pgriffais@valvesoftware.com, Peter Oskolkov , Steven Rostedt , shuah@kernel.org, Thomas Gleixner , z.figura12@gmail.com Subject: Re: [PATCH v4 00/15] Add futex2 syscalls Message-ID: References: <1622799088.hsuspipe84.astroid@bobo.none> <1622853816.mokf23xgnt.astroid@bobo.none> <6d8e3bb4-0cef-b991-9a16-1f03d10f131d@gmail.com> <1622980258.cfsuodze38.astroid@bobo.none> <1623114630.pc8fq7r5y9.astroid@bobo.none> <8fa8b7fd-58ae-9467-138d-4ff4f32f68f7@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8fa8b7fd-58ae-9467-138d-4ff4f32f68f7@gmail.com> X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 08 Jun 2021 12:35:21 -0000 On Tue, Jun 08, 2021 at 03:06:48PM +0300, Andrey Semashev wrote: > On 6/8/21 2:13 PM, Greg KH wrote: > > On Tue, Jun 08, 2021 at 02:03:50PM +0300, Andrey Semashev wrote: > > > On 6/8/21 4:25 AM, Nicholas Piggin wrote: > > > > > > > > Are shared pthread mutexes using existing pthread APIs that are today > > > > implemented okay with futex1 system call a good reason to constrain > > > > futex2 I wonder? Or do we have an opportunity to make a bigger change > > > > to the API so it suffers less from non deterministic latency (for > > > > example)? > > > > > > If futex2 is not able to cover futex1 use cases then it cannot be viewed as > > > a replacement. In the long term this means futex1 cannot be deprecated and > > > has to be maintained. My impression was that futex1 was basically > > > unmaintainable(*) and futex2 was an evolution of futex1 so that users of > > > futex1 could migrate relatively easily and futex1 eventually removed. Maybe > > > my impression was wrong, but I would like to see futex2 as a replacement and > > > extension of futex1, so the latter can be deprecated at some point. > > > > You can never delete a kernel system call, so even if you "deprecate" > > it, it still needs to be supported for forever. > > If I'm not mistaken, some syscalls were dropped from kernel in the past, > after it was established they are no longer used. So it is not impossible, > though might be more difficult specifically with futex. > > > Best of all would be if internally your "futex2" code would replace the > > "futex1" code so that there is no two different code bases. That would > > be the only sane way forward, having 2 code bases to work with is just > > insane. > > Yes, implementing futex1 in terms of futex2 internally is a possible way > forward. Though I'm not sure it is reasonable to require that to be done in > the initial futex2 submission. This requires all of the futex1 functionality > to implemented in futex2 from the start, which I think is too much to ask. > Even with some futex1 features missing, futex2 would be already very much > useful to users, and it is easier to implement the missing bits > incrementally over time. Then do it the other way around, as Peter points out. > > So what's keeping the futex2 code from doing all that futex1 does so > > that the futex1 code can be deleted internally? > > I think, André will answer this, but my guess is, as stated above, this is a > lot of work and time while the intermediate version is already useful. useful to who? I still do not understand what users will be needing this. All I can tell is a single userspace program wants to use it, and that is a fork from the real project it was based on and that the maintainers have no plan to merge it back. So who does need/want this? thanks, greg k-h