From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54458 invoked by alias); 14 Jun 2018 12:28:07 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 54446 invoked by uid 89); 14 Jun 2018 12:28:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,KAM_LAZY_DOMAIN_SECURITY,KAM_LIVE autolearn=ham version=3.3.2 spammy=pictures, UD:cuni.cz, UD:mff.cuni.cz, approaches X-HELO: atrey.karlin.mff.cuni.cz Date: Thu, 14 Jun 2018 12:28:00 -0000 From: Pavel Machek To: Mathieu Desnoyers Cc: Florian Weimer , carlos , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Thomas Gleixner , linux-kernel , libc-alpha Subject: Re: Restartable Sequences system call merged into Linux Message-ID: <20180614122759.GB8798@amd> References: <1084280721.10859.1528746558696.JavaMail.zimbra@efficios.com> <31fc101a-295b-067b-1a82-7e9e509fc92f@redhat.com> <305409897.10888.1528747473727.JavaMail.zimbra@efficios.com> <091061df-3482-8762-30e4-feaf3417be11@redhat.com> <417742741.11550.1528821084084.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E39vaYmALEf/7YXx" Content-Disposition: inline In-Reply-To: <417742741.11550.1528821084084.JavaMail.zimbra@efficios.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2018-06/txt/msg00395.txt.bz2 --E39vaYmALEf/7YXx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2004 On Tue 2018-06-12 12:31:24, Mathieu Desnoyers wrote: > ----- On Jun 12, 2018, at 9:11 AM, Florian Weimer fweimer@redhat.com wrot= e: >=20 > > On 06/11/2018 10:04 PM, Mathieu Desnoyers wrote: > >> ----- On Jun 11, 2018, at 3:55 PM, Florian Weimer fweimer@redhat.com w= rote: > >>=20 > >>> On 06/11/2018 09:49 PM, Mathieu Desnoyers wrote: > >>>> It should be noted that there can be only one rseq TLS area register= ed per > >>>> thread, > >>>> which can then be used by many libraries and by the executable, so t= his is a > >>>> process-wide (per-thread) resource that we need to manage carefully. > >>> > >>> Is it possible to resize the area after thread creation, perhaps even > >>> from other threads? > >>=20 > >> I'm not sure why we would want to resize it. The per-thread area is fi= xed-size. > >> Its layout is here: include/uapi/linux/rseq.h: struct rseq > >=20 > > Looks I was mistaken and this is very similar to the robust mutex list. > >=20 > > Should we treat it the same way? Always allocate it for each new thread > > and register it with the kernel? >=20 > That would be an efficient way to do it, indeed. There is very little > performance overhead to have rseq registered for all threads, whether or > not they intend to run rseq critical sections. People with slow / low memory machines would prefer not to see overhead they don't need... > I have a few possible approaches in mind (feel free to suggest other > options): >=20 > A) glibc exposes a strong __rseq_abi TLS symbol: >=20 > - should ideally *not* be global-dynamic for performance reasons, > - registration to kernel can either be handled explicitly by requiring > application or libraries to call an API, or implicitly at thread > creation, ...so I'd prefer explicit API call. > B) librseq.so exposes a strong __rseq_abi symbol: Works for me. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --E39vaYmALEf/7YXx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 181 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlsiX08ACgkQMOfwapXb+vIGNACeNy91T8kQ+NKZCXIfadQOsy0x rt0AoKfCKvP0Nt149SG3III4J3k1d81V =7Bff -----END PGP SIGNATURE----- --E39vaYmALEf/7YXx--