From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Manfred Spraul <manfred@colorfullife.com>,
LKML <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Mike Galbraith <efault@gmx.de>
Subject: Re: [PATCH 2/3] ipc/sem.c: handle spurious wakeups
Date: Wed, 12 Oct 2011 09:09:35 +0200 [thread overview]
Message-ID: <1318403375.3968.4.camel@twins> (raw)
In-Reply-To: <20111011145441.228e4c94.akpm@linux-foundation.org>
On Tue, 2011-10-11 at 14:54 -0700, Andrew Morton wrote:
> On Sat, 24 Sep 2011 19:37:11 +0200
> Manfred Spraul <manfred@colorfullife.com> wrote:
>
> > semtimedop() does not handle spurious wakeups, it returns -EINTR to user space.
> > Most other schedule() users would just loop and not return to user space.
> > The patch adds such a loop to semtimedop()
>
> What is a "spurious wakeup" and how can a process receive one?
Its a wakeup unrelated to the condition its waiting for. They shouldn't
happen (often) but all wait loops should deal with them. Sadly of course
most out of core wait loops don't :-(
> I'm wondering about the userspace-visible effects of this change, and
> any compatibility issues?
For this particular case it would be returning to userspace with -EINTR
without a signal having been raised what so ever. Not a big deal as
userspace it supposed to be able to deal with -EINTR and retry.
Also, these spurious wakeups hardly ever happen in the current kernel, I
only noticed it because I made them slightly more likely with a patch
currently on the back-burner until I figure out a sane way to audit all
1400+ schedule() and co. callsites.
next prev parent reply other threads:[~2011-10-12 7:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-24 17:37 [PATCH 2/3] ipc/sem.c: handle spurious wakeups Manfred Spraul
2011-10-11 21:54 ` Andrew Morton
2011-10-12 7:09 ` Peter Zijlstra [this message]
2011-10-13 18:51 ` Manfred Spraul
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=1318403375.3968.4.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=tglx@linutronix.de \
/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