From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: Christoph Hellwig <hch@lst.de>,
Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Cc: virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
Baokun Li <libaokun@linux.alibaba.com>
Subject: Re: [PATCH] virtio-pmem: use GFP_NOIO for flush bio allocation
Date: Thu, 9 Jul 2026 11:13:51 +0800 [thread overview]
Message-ID: <55f7befb-5ef3-4ede-a3ed-4968864c45b7@linux.alibaba.com> (raw)
In-Reply-To: <20260708162435.GB2502@lst.de>
On 7/9/26 12:24 AM, Christoph Hellwig wrote:
> On Wed, Jul 08, 2026 at 08:42:38PM +0800, Joseph Qi wrote:
>> diff --git a/drivers/nvdimm/nd_virtio.c b/drivers/nvdimm/nd_virtio.c
>> index 4176046627beb..081370aac6317 100644
>> --- a/drivers/nvdimm/nd_virtio.c
>> +++ b/drivers/nvdimm/nd_virtio.c
>> @@ -117,7 +117,7 @@ int async_pmem_flush(struct nd_region *nd_region, struct bio *bio)
>> if (bio && bio->bi_iter.bi_sector != -1) {
>> struct bio *child = bio_alloc(bio->bi_bdev, 0,
>> REQ_OP_WRITE | REQ_PREFLUSH,
>> - GFP_ATOMIC);
>> + GFP_NOIO);
>>
>> if (!child)
>> return -ENOMEM;
>
> This NULL check can go away now, and probaby should to avoid confusion.
>
> Also bio_alloc allocates from fs_bio_set, so if the incoming bio
> is from that, we can still deadlock. We'll need a separate bio_set
> for this to be deadlock free. disk->bio_split isn't otherwise
> used for the drivers/nvdimm/ driverss, so you might be able to
> repurpose that if you want to be creative.
Thanks for pointing this out.
Seems it is more proper to use a driver-private bio_set instead of
repurposing bd_disk->bio_split, like raid5-ppl flush_bs.
Pankaj, what's your opinion?
Thanks,
Joseph
next prev parent reply other threads:[~2026-07-09 3:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 12:42 [PATCH] virtio-pmem: use GFP_NOIO for flush bio allocation Joseph Qi
2026-07-08 16:24 ` Christoph Hellwig
2026-07-09 3:13 ` Joseph Qi [this message]
2026-07-09 10:58 ` Pankaj Gupta
2026-07-09 11:01 ` Joseph Qi
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=55f7befb-5ef3-4ede-a3ed-4968864c45b7@linux.alibaba.com \
--to=joseph.qi@linux.alibaba.com \
--cc=hch@lst.de \
--cc=libaokun@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pankaj.gupta.linux@gmail.com \
--cc=virtualization@lists.linux.dev \
/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