Re: [patch 1/16] unplugging fix

Andrew Morton (akpm@zip.com.au)
Mon, 03 Jun 2002 12:27:04 -0700


Jens Axboe wrote:
>
> On Mon, Jun 03 2002, Andrew Morton wrote:
> > Jens Axboe wrote:
> > >
> > > ...
> > > Does this work? I can't poke holes in it, but then again...
> >
> > It survives a 30-minute test. It would not have done that
> > before...
>
> Excellent.

Hope so. My Friday-night-notfix wouild have survived that long :(

> > Are you sure blk_stop_queue() and blk_run_queues() can't
> > race against each other? Seems there's a window where
> > they could both do a list_del().
>
> Hmm I'd prefer to just use the safe variant and not rely on the plugged
> flag when the lock isn't held, so here's my final version with just that
> change. Agree?

Not really ;)

There still seems to be a window where blk_run_queues() will
assume the queue is on local_plug_list while not holding
plug_list_lock. The QUEUE_PLUGGED flag is set, so blk_stop_queue()
will remove the queue from local_plug_list. Then blk_run_queues()
removes it as well. The new list_head debug code will rudely
catch that.

I'd be more comfortable if the duplicated info in QUEUE_FLAG_PLUGGED
and "presence on a list" were made fully atomic/coherent via
blk_plug_lock?

-
-
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/