Bart,

On Mon, 2017-09-25 at 21:34 +0000, Bart Van Assche wrote:
> On Mon, 2017-09-25 at 15:14 +0900, Damien Le Moal wrote:
> > Modify mq-dealine init_queue and exit_queue elevator methods to handle
> 
>          ^^^^^^^^^^
>          mq-deadline ?
> 
> > +static int deadline_init_zones_wlock(struct request_queue *q,
> > +                                struct deadline_data *dd)
> > +{
> > +   /*
> > +    * For regular drives or non-conforming zoned block device,
> > +    * do not use zone write locking.
> > +    */
> > +   if (!blk_queue_nr_zones(q))
> > +           return 0;
> > +
> > +   /*
> > +    * Treat host aware drives as regular disks.
> > +    */
> > +   if (blk_queue_zoned_model(q) != BLK_ZONED_HM)
> > +           return 0;
> > +
> > +   dd->zones_wlock =
> > kzalloc_node(BITS_TO_LONGS(blk_queue_nr_zones(q))
> > +                                  * sizeof(unsigned long),
> > +                                  GFP_KERNEL, q->node);
> 
> A request queue is created before disk validation occurs and before the
> number of zones is initialized (sd_probe_async()). If a scheduler is
> assigned to a ZBC drive through a udev rule, can it happen that
> deadline_init_zones_wlock() is called before the number of zones has been
> initialized?

Yes indeed. I am aware of this, hence the last patch of the series which
disables setting a default scheduler for blk-mq devices.

That is however a little extreme. So for V6, I am looking at diferring the
default elevator setup after device information is gathered. Not sure where
the right place to do so is though. Looking.

Best regards.

-- 
Damien Le Moal
Western Digital

Reply via email to