public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Sergey Bugaev <bugaevc@gmail.com>
To: Samuel Thibault <samuel.thibault@gnu.org>
Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org
Subject: Re: [PATCH 3/4] hurd: Microoptimize mmap ()
Date: Tue, 25 Apr 2023 00:09:58 +0300	[thread overview]
Message-ID: <CAN9u=HcHkt0pggx9ps-oQfvWXnegsrhoW9DQABP8yrPEp4ZFkQ@mail.gmail.com> (raw)
In-Reply-To: <20230424204644.omudvkhihy3nzj7m@begin>

On Mon, Apr 24, 2023 at 11:47 PM Samuel Thibault
<samuel.thibault@gnu.org> wrote:
> Is it really worth making the code a bit obscure?

No, not really.

What happened here was I looked at what my mask computation compiled
to, to verify it does the right thing on both x86_64 and i686, and
then I saw how the error branches are compiled, and next thing you
know there are new __glibc_unlikely's in my tree :)

What I should rather look into is marking __hurd_fail and friends with
__attribute__((cold)); that would take care of all the error branches
everywhere automatically without having to mark things up. But I did a
quick grep and found nothing using __attribute__((cold)) yet, so I
don't know what the right way of using it would be (and maybe it's not
being used intentionally?). I'm thinking it should probably go into
misc/sys/cdefs.h as __COLD (or __attribute_cold?). Something like
this:

#if __glibc_has_attribute (cold)
#define __COLD __attribute__ ((cold))
#else
#define __COLD
#endif

What do you think?

Sergey

  reply	other threads:[~2023-04-24 21:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-23 21:55 [PATCH 1/4] hurd: Implement MAP_32BIT Sergey Bugaev
2023-04-23 21:55 ` [PATCH 2/4] hurd: Don't attempt to deallocate MACH_PORT_DEAD Sergey Bugaev
2023-04-24 20:44   ` Samuel Thibault
2023-04-23 21:55 ` [PATCH 3/4] hurd: Microoptimize mmap () Sergey Bugaev
2023-04-24 20:46   ` Samuel Thibault
2023-04-24 21:09     ` Sergey Bugaev [this message]
2023-04-24 21:25       ` Samuel Thibault
2023-04-23 21:55 ` [RFC PATCH 4/4] hurd: Implement prefer_map_32bit_exec tunable Sergey Bugaev
2023-04-24 20:48   ` Samuel Thibault
2023-04-24 20:42 ` [PATCH 1/4] hurd: Implement MAP_32BIT Samuel Thibault

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='CAN9u=HcHkt0pggx9ps-oQfvWXnegsrhoW9DQABP8yrPEp4ZFkQ@mail.gmail.com' \
    --to=bugaevc@gmail.com \
    --cc=bug-hurd@gnu.org \
    --cc=libc-alpha@sourceware.org \
    --cc=samuel.thibault@gnu.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).