qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v11 00/13] hw/block/nvme: Support Namespace Types and Zoned N


From: Minwoo Im
Subject: Re: [PATCH v11 00/13] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set
Date: Sat, 6 Feb 2021 01:48:29 +0900
User-agent: Mutt/1.11.4 (2019-03-13)

On 21-02-06 01:43:18, Minwoo Im wrote:
> On 21-02-05 08:22:52, Keith Busch wrote:
> > On Sat, Feb 06, 2021 at 01:07:57AM +0900, Minwoo Im wrote:
> > > If multipath is enabled, the namespace head and hidden namespace will be
> > > created.  In this case, /sys/block/nvme0n1/queue/nr_zones are not
> > > returning proper value for the namespace itself.  By the way, the hidden
> > > namespace /sys/block/nvme0c0n1/queue/nr_zones are returning properly.
> > > 
> > > Is it okay for sysfs of the head namespace node (nvme0n1) not to manage
> > > the request queue attributes like nr_zones?
> > 
> > This should fix it. Untested, as my dev machine is in need of repair,
> > but if someone can confirm this is successful, I can send it to the
> > kernel list.
> > 
> > ---
> > diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
> > index 65bd6efa5e1c..eb18949bb999 100644
> > --- a/drivers/nvme/host/multipath.c
> > +++ b/drivers/nvme/host/multipath.c
> > @@ -677,6 +677,8 @@ void nvme_mpath_add_disk(struct nvme_ns *ns, struct 
> > nvme_id_ns *id)
> >     if (blk_queue_stable_writes(ns->queue) && ns->head->disk)
> >             blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES,
> >                                ns->head->disk->queue);
> > +   if (blk_queue_is_zoned(ns->queue))
> > +           blk_revalidate_disk_zones(ns->head->disk, NULL);
> >  }
> >  
> >  void nvme_mpath_remove_disk(struct nvme_ns_head *head)
> > --
> 
> Thanks Keith,
> 
> Just for sharing testing result based on this kernel quickly:
> 
> In blk_revalidate_disk_zones(), 
> 
>       488 int blk_revalidate_disk_zones(struct gendisk *disk,
>       489                               void (*update_driver_data)(struct 
> gendisk *disk))
>       490 {
>       491         struct request_queue *q = disk->queue;
>       492         struct blk_revalidate_zone_args args = {
>       493                 .disk           = disk,
>       494         };
>       495         unsigned int noio_flag;
>       496         int ret;
>       497
>       498         if (WARN_ON_ONCE(!blk_queue_is_zoned(q)))
>       499                 return -EIO;
>       500         if (WARN_ON_ONCE(!queue_is_mq(q)))
>       501                 return -EIO;
>                           ^^^^^^^^^^^^ 
> 
> (q->mq_ops == NULL) in this case, so that the q->nr_zones are not
> getting set.

Not sure if this is okay just give ctrl->tagset for the head
request_queue, but this patch works fine as far.

---
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 282b7a4ea9a9..22febc7baa36 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -375,7 +375,7 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct 
nvme_ns_head *head)
        if (!(ctrl->subsys->cmic & NVME_CTRL_CMIC_MULTI_CTRL) || !multipath)
                return 0;
 
-       q = blk_alloc_queue(ctrl->numa_node);
+       q = blk_mq_init_queue(ctrl->tagset);
        if (!q)
                goto out;
        blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
@@ -677,6 +677,8 @@ void nvme_mpath_add_disk(struct nvme_ns *ns, struct 
nvme_id_ns *id)
        if (blk_queue_stable_writes(ns->queue) && ns->head->disk)
                blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES,
                                   ns->head->disk->queue);
+       if (blk_queue_is_zoned(ns->queue))
+               blk_revalidate_disk_zones(ns->head->disk, NULL);
 }
 
 void nvme_mpath_remove_disk(struct nvme_ns_head *head)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]