lkml.org 
[lkml]   [1999]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] fixed down_interruptible() race and implemented a newsemi-trivial down_trylock() [Re: race condition in down_interruptible ]
Andrea Arcangeli wrote:
>
> On Sat, 13 Feb 1999, Ulrich Schmid wrote:
>
> >1. A signal is pending for Process B
> >2. Process B runs waking_non_zero before A calls up
> >3. Process A calls up before B calls atomic_inc
>
> task A task B(signal_pending) count waking
> ----------- ----------------- ----- ------
> 1 0
> down() 0 0
> CS
> down() -1 0
> waking_non_zero() -1 0
> signal_pending() == 1 -1 0
> up() 0 1
> atomic_inc(count) 1 1 boom!
>
> Cool, you discovered a really subtle bug ;). Who knows how many random
> crazy bug-report are been due this race?!? BTW, I think that also some
> 2.2.1 bug report/hang/lockups could be due recursive semaphores used as
> no-recursive semaphores... maybe not...
>
> Well I thought a bit about your race and I think to have fixed it well
> now. Note I also killed the recursive semaphores that are no longer needed
> since 2.2.2-pre2 (thanks to kpiod).
>
> Here my patch that will fix your race and implements down_trylock(). It's
> against 2.2.2-pre2 clean.

This fixed my "X hangs on reading the mouse at startup untill the mouse
is moved" problem :)
is it included in pre-patch-2.2.2-4 ?
I don't know what fixed it though, the race removing or the removal of
recursive semaphores,
i didn't have time to test which part of the patch fixed it.

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

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.053 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site