From: Jens Gustedt <jens.gustedt@inria.fr>
To: musl@lists.openwall.com
Subject: Re: [PATCH] unify the use of FUTEX_PRIVATE
Date: Sun, 25 Jun 2017 09:29:51 +0200 [thread overview]
Message-ID: <20170625092951.4f67a70b@inria.fr> (raw)
In-Reply-To: <20170624221630.GV1627@brightrain.aerifal.cx>
[-- Attachment #1: Type: text/plain, Size: 1731 bytes --]
Hello Rich,
On Sat, 24 Jun 2017 18:16:30 -0400 Rich Felker <dalias@libc.org> wrote:
> For now let's just use a macro for FUTEX_PRIVATE.
Ok, was my guess :)
> My concern was
> mainly about whether there are cases where it's assumed that the 128
> or ^128 translates to FUTEX_PRIVATE by arithmetic ops. The __wait,
> __timedwait, and __wake interfaces just treat their argument as a
> boolean now, so I think the only places there might be remaining
> assumptions of that sort is where a flag bit from the sync object is
> passed directly into a futex __syscall -- places like the condvar
> implementation. You've looked at all this code just now so you
> probably have a better idea if there are any such places;
All the usages that I found go through a Boolean operation. The only
place where -maybe- the compiler might shortcut some of it is __wake
because it is inlined. In any case, by just using the macro the
compiler see's the same 128.
> if so I
> think the assumption that the bits match up should just be replaced by
> a conditional (e.g. flags & 128 ? 0 : FUTEX_PRIVATE or such).
There is none in the arch independent code, so you could go with my
patch as it is, I think.
I only found one other place, but which I don't understand (and I am
not sure that I want to :). This is in
src/thread/x32/syscall_cp_fixup.c
where there is a special casing for SYS_futex
Thanks
Jens
--
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536 ::
:: :::::::::::::::::::::: gsm France : +33 651400183 ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::
[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2017-06-25 7:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-24 8:18 Jens Gustedt
2017-06-24 16:40 ` Szabolcs Nagy
2017-06-24 17:51 ` Jens Gustedt
2017-06-24 21:31 ` Jens Gustedt
2017-06-24 22:16 ` Rich Felker
2017-06-25 7:29 ` Jens Gustedt [this message]
2017-07-04 21:14 ` Rich Felker
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=20170625092951.4f67a70b@inria.fr \
--to=jens.gustedt@inria.fr \
--cc=musl@lists.openwall.com \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).