From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D23F633F8AA for ; Thu, 9 Jul 2026 11:01:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783594918; cv=none; b=eh0+Iv5cbKa1uqIB98FoZjamMxaZF+WlEV3mUCpCe8G5FIgQi/Et7d9YssLT3BorzU24jd1Oc0uo/NTuCKUUwyPabBY3X83p1EgCRwaXYsgo9lDVz8Qyl32qG2+3YTpkc6BckGOzsvOLGiuJOmv4jnu6wrMLLYoPDQkAgyL1YlI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783594918; c=relaxed/simple; bh=acOPYsQ5t8L0N6qgYlfpWGDnBKp841iAL6aTmuLWoVc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=UCUIBurJYTXSSBizc8vP+nolxk4F5izcbe70LVmzDW7dffsxqziknfn+4w1jq/3aF8JVZwy2clDv2d17RZLgZziFq8NYgHmIxRfUP0/tt02DESOzUk/LKpbcyWHAOusIHB27wr3eRqCxvUPjr/3u4vKZBwq3wMd5Bo15R/4WFWQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=fJyE1SwT; arc=none smtp.client-ip=115.124.30.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="fJyE1SwT" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1783594907; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=qSyvZ7VwzehdQqU5aTMtSf6gb+Qx3ccdNmccDd5Tlxg=; b=fJyE1SwTmfuEHlOxBcu9ZADzdUH0mrLk8FP6K4VhZx9nxjm5wWSlTABnvhG7VM4vr8VBImXdxc4Cmxjq1+Qq6RtOfgbgpcCtWdzatLWXfcL8xWu2cuxsTFbw5tMl3bADjPCov7JCbtDLQoiAn70bTUCWPoXbh0nMmvFw71S1kuw= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033032089153;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0X6kh0Jt_1783594906; Received: from 30.221.145.97(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0X6kh0Jt_1783594906 cluster:ay36) by smtp.aliyun-inc.com; Thu, 09 Jul 2026 19:01:47 +0800 Message-ID: Date: Thu, 9 Jul 2026 19:01:45 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] virtio-pmem: use GFP_NOIO for flush bio allocation To: Pankaj Gupta Cc: Christoph Hellwig , virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, Baokun Li References: <20260708124238.2817165-1-joseph.qi@linux.alibaba.com> <20260708162435.GB2502@lst.de> <55f7befb-5ef3-4ede-a3ed-4968864c45b7@linux.alibaba.com> From: Joseph Qi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 7/9/26 6:58 PM, Pankaj Gupta wrote: >> 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? > > Hi Joseph, > > Thank you for the patch! > > I am not very familiar with the internals of fs_bio_set, so I do not > have a strong opinion on the implementation details. However, a > driver-private bio_set sounds reasonable to me, and I would go with > Christoph's suggestion. > Fine, I'll send out v2 later to address this. Thanks, Joseph