From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: sem_wait and EINTR
Date: Fri, 14 Dec 2018 14:45:16 -0500 [thread overview]
Message-ID: <20181214194516.GA23599@brightrain.aerifal.cx> (raw)
In-Reply-To: <20181212051559.GA3315@voyager>
On Wed, Dec 12, 2018 at 06:15:59AM +0100, Markus Wichmann wrote:
> On Tue, Dec 11, 2018 at 07:32:38PM -0500, Rich Felker wrote:
> > One other thought: would it be preferable for the EINTR suppression in
> > the absence of interruptible signal handlers to be in __timedwait
> > rather than sem_timedwait? Then any code using __timedwait would
> > benefit from it. I'm not sure if there are other callers where it
> > would help but it wouldn't hurt either.
>
> Nope, that would not help. I had a look at all users of SYS_futex that
Perhaps help was the wrong word; I think you're right that there's
nowhere else it matters and that all other callers already ignore
EINTR unconditionally because they're supposed to. The only plausible
improvement is avoiding spurious dec/inc cycle on the waiter count in
some places. On the other hand it might be a nicer factorization (less
ugly and linux-bug-specific logic in high level code, i.e.
sem_timedwait) if the workaround were buried in low-level stuff
(__timedwait).
x> might be impacted by the kernel bug you mentioned (and followed them
> back to the public interfaces that use them). Only __timedwait does
> anything with the return value at all, and of all the users of
> __timedwait(), sem_timedwait() is the only function even specified to
> return EINTR. All others are specified to *never* return EINTR. At least
> according to the manpages I have here (manpages-posix).
>
> So only sem_timedwait() needs this patch. For the other users it would
> hurt conformance.
I don't see how it could hurt conformance.
Rich
next prev parent reply other threads:[~2018-12-14 19:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 19:16 Orivej Desh
2018-12-05 19:47 ` Markus Wichmann
2018-12-05 21:27 ` Ondřej Jirman
2018-12-05 21:58 ` Rich Felker
2018-12-06 2:43 ` Orivej Desh
2018-12-06 3:17 ` Rich Felker
2018-12-06 15:57 ` Markus Wichmann
2018-12-06 16:23 ` Rich Felker
2018-12-06 17:03 ` Markus Wichmann
2018-12-06 17:33 ` Markus Wichmann
2018-12-06 20:31 ` Orivej Desh
2018-12-09 2:51 ` Rich Felker
2018-12-09 6:50 ` Markus Wichmann
2018-12-12 0:32 ` Rich Felker
2018-12-12 5:15 ` Markus Wichmann
2018-12-14 19:45 ` Rich Felker [this message]
2018-12-15 9:45 ` Markus Wichmann
2018-12-05 22:03 ` Rich Felker
2018-12-06 2:43 ` Orivej Desh
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=20181214194516.GA23599@brightrain.aerifal.cx \
--to=dalias@libc.org \
--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).