unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Michael Jeanson <mjeanson@efficios.com>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH v3] linux: Use rseq area unconditionally in sched_getcpu (bug 31479)
Date: Wed, 13 Mar 2024 16:51:15 -0400	[thread overview]
Message-ID: <adf21fcb-9174-45d2-96b5-5792b331efa6@efficios.com> (raw)
In-Reply-To: <87y1amnd85.fsf@oldenburg.str.redhat.com>

On 2024-03-13 15:28, Florian Weimer wrote:
> Originally, nptl/descr.h included <sys/rseq.h>, but we removed that
> in commit 2c6b4b272e6b4d07303af25709051c3e96288f2d ("nptl:
> Unconditionally use a 32-byte rseq area").  After that, it was
> not ensured that the RSEQ_SIG macro was defined during sched_getcpu.c
> compilation that provided a definition.  This commit always checks
> the rseq area for CPU number information before using the other
> approaches.
> 
> This adds an unnecessary (but well-predictable) branch on
> architectures which do not define RSEQ_SIG, but its cost is small
> compared to the system call.  Most architectures that have vDSO
> acceleration for getcpu also have rseq support.
> 
> Fixes: 2c6b4b272e6b4d07303af25709051c3e96288f2d
> Fixes: 1d350aa06091211863e41169729cee1bca39f72f

Would adding back the '#include <sys/rseq.h>' in nptl/descr.h have any adverse 
consequences?

It would restore the original behavior without any effect on architectures 
which do not define RSEQ_SIG.

  reply	other threads:[~2024-03-13 20:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 19:28 [PATCH v3] linux: Use rseq area unconditionally in sched_getcpu (bug 31479) Florian Weimer
2024-03-13 20:51 ` Michael Jeanson [this message]
2024-03-13 20:52   ` Michael Jeanson
2024-03-15 14:40 ` Arjun Shankar

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=adf21fcb-9174-45d2-96b5-5792b331efa6@efficios.com \
    --to=mjeanson@efficios.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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).