lkml.org 
[lkml]   [2001]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.4.2-ac3: loop threads in D state


On Sun, 25 Feb 2001, Alexander Viro wrote:

>
>
> On Mon, 26 Feb 2001, Jens Axboe wrote:
>
> > On Sun, Feb 25 2001, Alexander Viro wrote:
> > > Erm... Jens, it really should be
> > > if (atomic_dec_and_test(...))
> > > up(...);
> > > not just
> > > atomic_dec(...);
> > > up(...);
> > >
> > > Otherwise you can end up with too early exit of loop_thread. Normally
> > > it would not matter, but in pathological cases...
> >
> > How so? We dec it and up the semaphore, loop_thread runs until it's
> > done and ups lo_sem.
>
> You are risking an extra up() here. Think what happens if you already had a
> pending request.

Let me elaborate: the race is very narrow and takes deliberate efforts to
hit. It _can_ be triggered, unfortunately. This extra up() will mess your
life later on.

-
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:17    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site