Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1881253imm; Thu, 14 Jun 2018 05:30:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ8EQSkOVRQ6+kLL08LTJpA9KLYrmS9D/gh16Dzj+vQE7LqhW+7lORLykNNBPSycoAt9FJF X-Received: by 2002:a63:81c7:: with SMTP id t190-v6mr2151683pgd.378.1528979435306; Thu, 14 Jun 2018 05:30:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528979435; cv=none; d=google.com; s=arc-20160816; b=F1PaiA07NHeRpbvcgpP3Of/A6JxiyRuSMyyam2Eh1ZMM88NVLEFoYMb+SoGT0h+4Cc ICeYBGuwv7krKHTbBtZufJ1PqkIcL1OjmwGD8QNMcSU1VEecLQIDNcps0mwNdvYCr3G2 IjZWB4ca9ObczQHxiT4IBGqQI5wuj6PfgJLkq5nDF/WEjW+HOO8bMJsdWpWsA962z1JC DV1WdkMz1sNxVTDB6uyZuJSrTRzqXPmBSclCZFV/5cYn9U2aWa6dunRIdji/r2IDmjJF GgHB3z4lM97SAEbYTP7es51J9UgcDV7bEFO1HXh12yJl8ZvUw3UQDkg3G1kjK/bSWMpQ nvTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=cjIXbfIvzehecd+StRZLrxfrNdrN8z1D6dNcK4wSCiQ=; b=wTQgwYamLnwyFKgNr/OQ5seGcdqqhU0Dn8+kzEX3nnostSJO10Fp358BwZ6953PtxG zzLptDhCwVjCzJvYnG00nIi0q3pGuQzuOU7vSqJxwFqgkD9TFWzjxDBkL4+GYxIrz1v7 PgdNx0s88fnWIFYGNr3FhSqNWg4YVCqsKwyWIcpzcC0ezjtZJV4Ge0EPtTYKrekGNh+R bG+tuTcD56F5uH+Q5Af1LL+3Hib1sDsQs0KzsRT4Q4FYywPFnecqGtTwNTS7QX1L1MIk 9EPTQir4vKTRvUzepBA+a4MJVhXaiw6OeMHyeUR9/7x1h+nJA8L5ibrg0KaMj0JLSd8g J41g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r5-v6si5127970pls.518.2018.06.14.05.30.19; Thu, 14 Jun 2018 05:30:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755097AbeFNM2D (ORCPT + 99 others); Thu, 14 Jun 2018 08:28:03 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:60461 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754869AbeFNM2C (ORCPT ); Thu, 14 Jun 2018 08:28:02 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 48C1E803F4; Thu, 14 Jun 2018 14:28:00 +0200 (CEST) Date: Thu, 14 Jun 2018 14:27:59 +0200 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --E39vaYmALEf/7YXx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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, =2E..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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlsiX08ACgkQMOfwapXb+vIGNACeNy91T8kQ+NKZCXIfadQOsy0x rt0AoKfCKvP0Nt149SG3III4J3k1d81V =7Bff -----END PGP SIGNATURE----- --E39vaYmALEf/7YXx--