public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Chris Kennelly <ckennelly@google.com>,
	Paul Turner <pjt@google.com>,  Peter Oskolkov <posk@posk.io>,
	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: Wed, 2 Feb 2022 08:08:55 -0500 (EST)	[thread overview]
Message-ID: <770517862.27112.1643807335312.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <1375227765.27051.1643801804042.JavaMail.zimbra@efficios.com>

----- On Feb 2, 2022, at 6:36 AM, Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote:

> ----- On Feb 2, 2022, at 3:41 AM, Florian Weimer fweimer@redhat.com wrote:
> 
>> * Florian Weimer:
>> 
>>> * Chris Kennelly:
>>>
>>>> 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.
>>>
>>> You can write __rseq_offset to a static/hidden variable in an ELF
>>> constructor, and then use pretty much the same assembler sequences as
>>> for initial-exec TLS on most architectures.
>> 
>> And now I'm kind of worried that we should be using ptrdiff_t for
>> __rseq_offset because that's what the initial-exec relocations use. 8-/
> 
> I suspect the underlying question here is: how likely is it that a libc
> requires an offset of more than 2GB either way from the thread pointer
> to allocate its rseq thread area on a 64-bit architecture ?

More to the point: is ptrdiff_t the correct type here ? I think so.
Do we want to revert the ABI and wait another 6 months before we
bring back rseq into glibc just for this ? I'm not sure this limitation
justifies it.

So if there is a quick way to fix that before the official 2.35 release,
I'm all for it, otherwise I cannot say that __rseq_offset being an "int"
rather than a "ptrdiff_t" will make much real-life difference (unless
I'm proven wrong). But we will be stuck with this quirk forever.

Thanks,

Mathieu


-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

  reply	other threads:[~2022-02-02 13:08 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
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 [this message]
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=770517862.27112.1643807335312.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=ckennelly@google.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-kernel@vger.kernel.org \
    --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).