Re: [patch 1/16] unplugging fix

Andrew Morton
2002-06-03T19:28:30Z

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?

-