From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by sourceware.org (Postfix) with ESMTPS id A747238708C9 for ; Tue, 24 Nov 2020 18:17:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A747238708C9 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CgXL85Pzqz1qs0Z; Tue, 24 Nov 2020 19:17:20 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CgXL856JDz1tD90; Tue, 24 Nov 2020 19:17:20 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id RljLfTlNWMIf; Tue, 24 Nov 2020 19:17:18 +0100 (CET) X-Auth-Info: W6f/zY+8+yH0EGw+Nh71mtQnnUeuChSgpR4sWS4aC/Y= Received: from jawa (89-64-5-98.dynamic.chello.pl [89.64.5.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 24 Nov 2020 19:17:18 +0100 (CET) Date: Tue, 24 Nov 2020 19:16:43 +0100 From: Lukasz Majewski To: Adhemerval Zanella via Libc-alpha Cc: Adhemerval Zanella , Michael Kerrisk Subject: Re: [PATCH 04/13] linux: Extend __futex_abstimed_wait_cancelable64 comment Message-ID: <20201124191643.6922a95d@jawa> In-Reply-To: <20201123195256.3336217-4-adhemerval.zanella@linaro.org> References: <20201123195256.3336217-1-adhemerval.zanella@linaro.org> <20201123195256.3336217-4-adhemerval.zanella@linaro.org> Organization: denx.de X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/oXjRkpIF/YZZZEV21cWDEyd"; protocol="application/pgp-signature" X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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, 24 Nov 2020 18:17:23 -0000 --Sig_/oXjRkpIF/YZZZEV21cWDEyd Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Adhemerval, > And add a small optimization to avoid setting the operation for the > 32-bit time fallback operation. >=20 > Checked on x86_64-linux-gnu and i686-linux-gnu. > --- > sysdeps/nptl/futex-internal.c | 8 ++------ > sysdeps/nptl/futex-internal.h | 18 +++++++++++++++--- > 2 files changed, 17 insertions(+), 9 deletions(-) >=20 > diff --git a/sysdeps/nptl/futex-internal.c > b/sysdeps/nptl/futex-internal.c index 457cd3cd69..e4a14b477c 100644 > --- a/sysdeps/nptl/futex-internal.c > +++ b/sysdeps/nptl/futex-internal.c > @@ -25,7 +25,7 @@ > #ifndef __ASSUME_TIME64_SYSCALLS > static int > __futex_abstimed_wait_cancelable32 (unsigned int* futex_word, > - unsigned int expected, clockid_t > clockid, > + unsigned int expected, int op, > const struct __timespec64* > abstime, int private) > { > @@ -39,10 +39,6 @@ __futex_abstimed_wait_cancelable32 (unsigned int* > futex_word, pts32 =3D &ts32; > } > =20 > - unsigned int clockbit =3D (clockid =3D=3D CLOCK_REALTIME) > - ? FUTEX_CLOCK_REALTIME : 0; > - int op =3D __lll_private_flag (FUTEX_WAIT_BITSET | clockbit, > private); - > return INTERNAL_SYSCALL_CANCEL (futex, futex_word, op, expected, > pts32, NULL /* Unused. */, > FUTEX_BITSET_MATCH_ANY); > @@ -119,7 +115,7 @@ __futex_abstimed_wait_cancelable64 (unsigned int* > futex_word, #ifndef __ASSUME_TIME64_SYSCALLS > if (err =3D=3D -ENOSYS) > err =3D __futex_abstimed_wait_cancelable32 (futex_word, expected, > - clockid, abstime, > private); > + op, abstime, private); > #endif > =20 > switch (err) > diff --git a/sysdeps/nptl/futex-internal.h > b/sysdeps/nptl/futex-internal.h index d5f13d15fb..cefab74301 100644 > --- a/sysdeps/nptl/futex-internal.h > +++ b/sysdeps/nptl/futex-internal.h > @@ -390,9 +390,21 @@ futex_unlock_pi (unsigned int *futex_word, int > private) } > } > =20 > -/* The futex_abstimed_wait_cancelable64 has been moved to a separate > file > - to avoid problems with exhausting available registers on some > architectures > - - e.g. on m68k architecture. */ > +/* Like futex_wait, but will eventually time out (i.e., stop being > blocked) > + after the duration of time provided (i.e., ABSTIME) has passed > using the > + clock specified by CLOCKID (currently only CLOCK_REALTIME and > + CLOCK_MONOTONIC, the ones support by > lll_futex_supported_clockid). ABSTIME > + can also equal NULL, in which case this function behaves > equivalent to > + futex_wait. > + > + Returns the same values as futex_wait under those same conditions; > + additionally, returns ETIMEDOUT if the timeout expired. > + > + The call acts a cancellation entrypoint. > + > + (The implementation has been moved to a separate file to avoid > problems > + with exhausting available registers on some architectures - e.g. > on > + m68k). */ > int > __futex_abstimed_wait_cancelable64 (unsigned int* futex_word, > unsigned int expected, clockid_t > clockid, Reviewed-by: Lukasz Majewski Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/oXjRkpIF/YZZZEV21cWDEyd Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl+9TgsACgkQAR8vZIA0 zr3g3wgApslpV4TRexF9wzaygDZIUEOYZmXZOcJuetylwAnRYYiOoQTg3Y0Atm5G GFUwGy110Jh1jS2URWHxRcBrlU2qUul6cNQaQdR1SlmaZCMUvARevy2LnhhsGiby 2VYhp7No3Rcrtk/GTYcUu8tyijWYDfBUcU8Dnbgt/ps0j0r33GfUvPOvrmmvCHSG hiEWzsUSwKf8zFTimApWIjGJKcDphEBmmmLdtH4+2j2ptDWXzv+CC3edWJpW5YH3 9OgXiQu7YEkY13AmrTruMRIm3vhc4bdkXIFujKInYljbKXWMomUUJW1YCFVh1p58 dwyVp4pa0rl7DAdRz9op/6ba4wEGwQ== =0yQN -----END PGP SIGNATURE----- --Sig_/oXjRkpIF/YZZZEV21cWDEyd--