Re: [PATCH 2/3] ipc/sem.c: handle spurious wakeups

From: Manfred Spraul
Date: Thu Oct 13 2011 - 14:44:05 EST


On 10/11/2011 11:54 PM, Andrew Morton wrote:
On Sat, 24 Sep 2011 19:37:11 +0200
Manfred Spraul<manfred@xxxxxxxxxxxxxxxx> 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?
A spurious wakeup means that someone calls wake_up_process() without a proper reason.
The most common case would be a wake_up_process() that was somehow delayed.

Peter's patch made such delayed wakeups very common, this is how we found the issue.

The "standard" kernel primitives handle such wakeups, ipc/sem.c doesn't handle that.

I'm wondering about the userspace-visible effects of this change, and
any compatibility issues?
This change has no userspace visible effects.

--
Manfred
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/