From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Verma, Vishal L" <vishal.l.verma@intel.com>
Cc: "Jiang, Dave" <dave.jiang@intel.com>,
"pankaj.gupta.linux@gmail.com" <pankaj.gupta.linux@gmail.com>,
"houtao@huaweicloud.com" <houtao@huaweicloud.com>,
"houtao1@huawei.com" <houtao1@huawei.com>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"hch@infradead.org" <hch@infradead.org>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"axboe@kernel.dk" <axboe@kernel.dk>,
"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"pankaj.gupta@amd.com" <pankaj.gupta@amd.com>,
"kch@nvidia.com" <kch@nvidia.com>
Subject: Re: [PATCH v4] virtio_pmem: add the missing REQ_OP_WRITE for flush bio
Date: Sun, 6 Aug 2023 11:10:22 -0400 [thread overview]
Message-ID: <20230806110854-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <47f9753353d07e3beb60b6254632d740682376f9.camel@intel.com>
On Fri, Aug 04, 2023 at 09:03:20PM +0000, Verma, Vishal L wrote:
> On Fri, 2023-08-04 at 20:39 +0200, Pankaj Gupta wrote:
> > Gentle ping!
> >
> > Dan, Vishal for suggestion/review on this patch and request for merging.
> > +Cc Michael for awareness, as virtio-pmem device is currently broken.
>
> Looks good to me,
>
> Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
>
> Dave, will you queue this for 6.6.
Generally if you expect me to merge a patch I should be CC'd.
> >
> > Thanks,
> > Pankaj
> >
> > > From: Hou Tao <houtao1@huawei.com>
> > >
> > > When doing mkfs.xfs on a pmem device, the following warning was
> > > reported:
> > >
> > > ------------[ cut here ]------------
> > > WARNING: CPU: 2 PID: 384 at block/blk-core.c:751 submit_bio_noacct
> > > Modules linked in:
> > > CPU: 2 PID: 384 Comm: mkfs.xfs Not tainted 6.4.0-rc7+ #154
> > > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
> > > RIP: 0010:submit_bio_noacct+0x340/0x520
> > > ......
> > > Call Trace:
> > > <TASK>
> > > ? submit_bio_noacct+0xd5/0x520
> > > submit_bio+0x37/0x60
> > > async_pmem_flush+0x79/0xa0
> > > nvdimm_flush+0x17/0x40
> > > pmem_submit_bio+0x370/0x390
> > > __submit_bio+0xbc/0x190
> > > submit_bio_noacct_nocheck+0x14d/0x370
> > > submit_bio_noacct+0x1ef/0x520
> > > submit_bio+0x55/0x60
> > > submit_bio_wait+0x5a/0xc0
> > > blkdev_issue_flush+0x44/0x60
> > >
> > > The root cause is that submit_bio_noacct() needs bio_op() is either
> > > WRITE or ZONE_APPEND for flush bio and async_pmem_flush() doesn't assign
> > > REQ_OP_WRITE when allocating flush bio, so submit_bio_noacct just fail
> > > the flush bio.
> > >
> > > Simply fix it by adding the missing REQ_OP_WRITE for flush bio. And we
> > > could fix the flush order issue and do flush optimization later.
> > >
> > > Cc: stable@vger.kernel.org # 6.3+
> > > Fixes: b4a6bb3a67aa ("block: add a sanity check for non-write flush/fua bios")
> > > Reviewed-by: Christoph Hellwig <hch@lst.de>
> > > Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
> > > Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
> > > Tested-by: Pankaj Gupta <pankaj.gupta@amd.com>
> > > Signed-off-by: Hou Tao <houtao1@huawei.com>
> > > ---
> > > v4:
> > > * add stable Cc
> > > * collect Rvb and Tested-by tags
> > >
> > > v3: https://lore.kernel.org/linux-block/20230625022633.2753877-1-houtao@huaweicloud.com
> > > * adjust the overly long lines in both commit message and code
> > >
> > > v2: https://lore.kernel.org/linux-block/20230621134340.878461-1-houtao@huaweicloud.com
> > > * do a minimal fix first (Suggested by Christoph)
> > >
> > > v1: https://lore.kernel.org/linux-block/ZJLpYMC8FgtZ0k2k@infradead.org/T/#t
> > >
> > > drivers/nvdimm/nd_virtio.c | 3 ++-
> > > 1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/nvdimm/nd_virtio.c b/drivers/nvdimm/nd_virtio.c
> > > index c6a648fd8744..1f8c667c6f1e 100644
> > > --- a/drivers/nvdimm/nd_virtio.c
> > > +++ b/drivers/nvdimm/nd_virtio.c
> > > @@ -105,7 +105,8 @@ int async_pmem_flush(struct nd_region *nd_region, struct bio *bio)
> > > * parent bio. Otherwise directly call nd_region flush.
> > > */
> > > if (bio && bio->bi_iter.bi_sector != -1) {
> > > - struct bio *child = bio_alloc(bio->bi_bdev, 0, REQ_PREFLUSH,
> > > + struct bio *child = bio_alloc(bio->bi_bdev, 0,
> > > + REQ_OP_WRITE | REQ_PREFLUSH,
> > > GFP_ATOMIC);
> > >
> > > if (!child)
> > > --
> > > 2.29.2
> > >
>
next prev parent reply other threads:[~2023-08-06 15:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-20 3:28 [PATCH] virtio_pmem: do flush synchronously Hou Tao
2023-06-21 12:13 ` Christoph Hellwig
2023-06-21 13:43 ` [PATCH v2] virtio_pmem: add the missing REQ_OP_WRITE for flush bio Hou Tao
2023-06-21 13:15 ` Christoph Hellwig
2023-06-25 2:26 ` [PATCH v3] " Hou Tao
2023-06-26 7:53 ` Christoph Hellwig
2023-06-26 8:40 ` Chaitanya Kulkarni
2023-07-13 8:17 ` Pankaj Gupta
2023-06-27 9:03 ` Pankaj Gupta
2023-07-13 8:23 ` Pankaj Gupta
2023-07-13 13:06 ` Hou Tao
2023-07-13 13:54 ` [PATCH v4] " Hou Tao
2023-08-04 18:39 ` Pankaj Gupta
2023-08-04 21:03 ` Verma, Vishal L
2023-08-06 15:10 ` Michael S. Tsirkin [this message]
2023-08-07 16:42 ` Dave Jiang
2023-08-07 17:55 ` Pankaj Gupta
2023-06-22 8:35 ` [PATCH v2] " Pankaj Gupta
2023-06-30 2:25 ` Hou Tao
2023-06-30 4:45 ` Pankaj Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230806110854-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=axboe@kernel.dk \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=hch@infradead.org \
--cc=houtao1@huawei.com \
--cc=houtao@huaweicloud.com \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=pankaj.gupta.linux@gmail.com \
--cc=pankaj.gupta@amd.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).