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, Linus Torvalds 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_.

it touches the waitqueue spinlock - and the __down() path [ie. the process
that gets woken up, which has the semaphore on the stack] takes the
spinlock after waking up. Ie. there's guaranteed synchronization, the
semaphore will not be 'unused' before the __down() path takes the spinlock
- ie. after the __up() path releases the spinlock. What am i missing?

Ingo

-
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    [W:0.051 / U:1.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site