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.3 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 1AFFE1F8C6 for ; Fri, 13 Aug 2021 06:27:21 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5960F3889818 for ; Fri, 13 Aug 2021 06:27:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5960F3889818 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628836039; bh=84mdNpTP70Iw6hw9g4MSgYu9wyHWK8PlRM0xahYGo6E=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=LXJbYUbwC2zkinGvtfWCzeBlN6X4OzLO1Vj+hPE3w87HzdJOsC9IDdsGS1reL3yg2 YsWyo1+PTtuDqkT8oXlhWNPjJFd82imT+7ezfdACRMIMLlddvdp+UTIyhja1CqQAK3 v7ry3NB47aTZOdq3O8JL/GobinhmwbxHrb8I8G1A= Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by sourceware.org (Postfix) with ESMTPS id A147F3858C3B for ; Fri, 13 Aug 2021 06:26:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A147F3858C3B To: Adhemerval Zanella , libc-alpha@sourceware.org Subject: Re: [PATCH 2/4] nptl: Use FUTEX_LOCK_PI2 when available In-Reply-To: <3991be9a-2a41-c211-a4ce-f7efdad67cc5@linaro.org> References: <20210811200133.3869287-1-adhemerval.zanella@linaro.org> <20210811200133.3869287-3-adhemerval.zanella@linaro.org> <87im0b6u6e.fsf@kurt> <3991be9a-2a41-c211-a4ce-f7efdad67cc5@linaro.org> Date: Fri, 13 Aug 2021 08:26:46 +0200 Message-ID: <87czqhyi55.fsf@kurt> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: Kurt Kanzenbach via Libc-alpha Reply-To: Kurt Kanzenbach Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu Aug 12 2021, Adhemerval Zanella wrote: > On 12/08/2021 03:42, Kurt Kanzenbach wrote: >> Hi Adhemerval, >>=20 >> thanks for the respin of this series. Just some minor comments below. >>=20 >> On Wed Aug 11 2021, Adhemerval Zanella wrote: >>> This patch uses the new futex PI operation provided by Linux v5.14 >>> when it is required. >>> >>> The futex_lock_pi64() is moved to futex-internal.c (since it used on >>> two different places and its code size might be large depending of the >>> kernel configuration) and clockid is added as an argument. >>> >>> Co-authored-by: Kurt Kanzenbach >>> --- >>> nptl/futex-internal.c | 63 +++++++++++++++++++++++++++++++ >>> nptl/pthread_mutex_lock.c | 3 +- >>> nptl/pthread_mutex_timedlock.c | 3 +- >>> sysdeps/nptl/futex-internal.h | 54 +------------------------- >>> sysdeps/nptl/lowlevellock-futex.h | 1 + >>> 5 files changed, 70 insertions(+), 54 deletions(-) >>> >>> diff --git a/nptl/futex-internal.c b/nptl/futex-internal.c >>> index e74647a9d4..58605b2fca 100644 >>> --- a/nptl/futex-internal.c >>> +++ b/nptl/futex-internal.c >>> @@ -140,3 +140,66 @@ __futex_abstimed_wait_cancelable64 (unsigned int* = futex_word, >>> abstime, private, true); >>> } >>> libc_hidden_def (__futex_abstimed_wait_cancelable64) >>> + >>> +int >>> +__futex_lock_pi64 (int *futex_word, clockid_t clockid, >>> + const struct __timespec64 *abstime, int private) >>> +{ >>> + int err; >>=20 >> Is the clockid check not needed? >>=20 >> if (! lll_futex_supported_clockid (clockid)) >> return EINVAL; > > The ___pthread_mutex_clocklock64() already checks it (as other functions = that uses > a clockid_t). I also tested for invalid clocks on tst-mutexpi10.c. > > And I think that the check on __futex_abstimed_wait_common() is superfluo= us.. OK, I see. Thanks, Kurt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCgAxFiEEooWgvezyxHPhdEojeSpbgcuY8KYFAmEWEKYTHGt1cnRAbGlu dXRyb25peC5kZQAKCRB5KluBy5jwpv/fD/95zM7GOfMyFLc6u4U9b7bnQNQYZjhg lfl7SwDfwlBnzzmZnJNTTJSETcAepVhTInDaSgfb0gqrISkG7VPcqRzFpt8xwKEz KcTluPd/Ucl6tn34rFyFNOrcZ0vHFqnk4aAR6vrVjoGvffoNyjodxSz0NrokqAAB zxWJGWGN9/QTAqdMNwyQ+EgeCEYPAHxEagZrPyO8eUMjVCncuNjZy+TXgazMJGMn ruUkjUOTEXnmhXVHpBuK4ekYccDKiyG3bxAW2T0ciH7fuTbtPQtnR/vbhsHQrLTU lH1efyngWYASH04U2oLimIovnI13aUUtFscR+auhb900UuWiSDWmdE999DV5OzyF F5bhl1XRc09veeSU8vbrAasbE3TV85Cdt+pkHux/yyjrasS+4lRLmK/Pt/hEJ8Wl HkRCy6UXvuGTfbPc18429ZMeY4aUu5g7Phtz9HKA8V1fJjptDUa/0yXFI3E6JFES 1NNS2Lx34UopaQrG9xf5fBjewZJhbuavjYY0VZQS32bT2ioXD+yHtfhIPfNHE5aa roFW2K5g3eScFyUa+SfhcST2hIqFdZ7cCvWKBCfXQiUSj65SsPFe2WfQkKY1b5mZ +e+iwtZMrM336kr0NdsyEjxOSUDX7fuHMaTt+LLtsbIy1tzT5jMFEyCV11iUnoSo lbimYBasBK3trA== =WZGe -----END PGP SIGNATURE----- --=-=-=--