public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Chris Kennelly <ckennelly@google.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Paul Turner <pjt@google.com>, Peter Oskolkov <posk@posk.io>,
	Florian Weimer <fweimer@redhat.com>,
	 libc-alpha <libc-alpha@sourceware.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	 Peter Zijlstra <peterz@infradead.org>
Subject: Re: Aligning tcmalloc with glibc 2.35 rseq ABI
Date: Tue, 1 Feb 2022 15:33:15 -0500	[thread overview]
Message-ID: <CAEE+ybn_Cp1-T=2uB7xJqU2gEU-PxzsaV5jqCOupNp2cx_bK-Q@mail.gmail.com> (raw)
In-Reply-To: <432231420.24682.1643727496135.JavaMail.zimbra@efficios.com>

Thanks for the heads up.

I did have a question about whether the new protocol would introduce
an extra memory reference while initializing a critical section.

* With initial-exec TLS, I can directly reference __rseq_abi.
* With the new ABI, I might need to ask glibc for the address of the
registered rseq structure in its thread data.

I saw https://lkml.org/lkml/2022/1/24/859 mention using %gs, but it
also mentions consulting "rseq_offset" in the address calculation.  Is
rseq_offset something I can resolve to a constant or would I need to
access a global for it, or does glibc take care of initializing %gs to
the address of the structure registered with the kernel (for the
current thread)?

Thanks,
Chris


On Tue, Feb 1, 2022 at 9:58 AM Mathieu Desnoyers
<mathieu.desnoyers@efficios.com> wrote:
>
> Hi Chris,
>
> You will probably want to have a look at the userspace rseq ABI exposed by glibc 2.35 to ensure
> tcmalloc becomes compatible with it.
>
> If it helps, you can have a look at how I modified librseq to play nicely with glibc 2.35:
>
> https://git.kernel.org/pub/scm/libs/librseq/librseq.git/
>
> Most relevant bits:
>
> https://git.kernel.org/pub/scm/libs/librseq/librseq.git/tree/src/rseq.c#n108
>
> Thanks,
>
> Mathieu
>
> --
> Mathieu Desnoyers
> EfficiOS Inc.
> http://www.efficios.com

  reply	other threads:[~2022-02-01 20:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 14:58 Mathieu Desnoyers
2022-02-01 20:33 ` Chris Kennelly [this message]
2022-02-01 20:39   ` Florian Weimer
2022-02-02  8:41     ` Florian Weimer
2022-02-02 11:36       ` Mathieu Desnoyers
2022-02-02 13:08         ` Mathieu Desnoyers
2022-02-02 15:01           ` Florian Weimer
2022-02-02 17:31             ` Carlos O'Donell
2022-02-02 22:28               ` Carlos O'Donell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEE+ybn_Cp1-T=2uB7xJqU2gEU-PxzsaV5jqCOupNp2cx_bK-Q@mail.gmail.com' \
    --to=ckennelly@google.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=posk@posk.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).