lkml.org 
[lkml]   [2002]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] scheduler fixes, 2.5.32-BK

On Fri, 30 Aug 2002, Ingo Molnar wrote:
>
> actually, i think the race does not exist. up() is perfectly safely done
> on the on-stack semaphore, because both the wake_up() done by __up() and
> the __down() path takes the waitqueue spinlock, so i cannot see where
> the up() touches the semaphore after the down()-ed task has been woken
> up.

It touches the _spinlock_.

Which may no longer be a spinlock, since the waiter may never have blocked
on it at all, and may have just succeeded directly with the atomic
decrement of the counter.

Trust me, semaphores on the stack do not work unless there is some other
synchronization above the semaphore level (or unless we make semaphores
much slower, ie we take the spinlock even in the fast path).

Linus

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

\
 
 \ /
  Last update: 2005-03-22 13:28    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site