public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Naman Jain <namjain@linux.microsoft.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>, Chaitanya Kulkarni <kch@nvidia.com>,
	John Hubbard <jhubbard@nvidia.com>,
	Logan Gunthorpe <logang@deltatee.com>,
	linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	Saurabh Sengar <ssengar@linux.microsoft.com>,
	Long Li <longli@microsoft.com>,
	Michael Kelley <mhklinux@outlook.com>
Subject: Re: [PATCH 2/2] block: allow different-pgmap pages as separate bvecs in bio_add_page
Date: Tue, 7 Apr 2026 12:38:30 +0530	[thread overview]
Message-ID: <6106a655-2d4b-4ebf-b269-459e3bd3efd4@linux.microsoft.com> (raw)
In-Reply-To: <20260407055247.GA6405@lst.de>



On 4/7/2026 11:22 AM, Christoph Hellwig wrote:
>> -               if (!zone_device_pages_have_same_pgmap(bv->bv_page, page))
>> +               if (!zone_device_pages_compatible(bv->bv_page, page))
>>                          return 0;
>> -
>> -               if (bvec_try_merge_hw_page(q, bv, page, len, offset)) {
>> +               if (zone_device_pages_have_same_pgmap(bv->bv_page, page) &&
>> +                   bvec_try_merge_hw_page(q, bv, page, len, offset)) {
> 
> We still can't merge merge pages with different P2P pgmaps into the
> same request.
> 
> So the zone_device_pages_have_same_pgmap check should go into
> zone_device_pages_compatible and we need to stop building the bio
> as well in that case.

Ok, so rest all things same, from my last email, but my previous 
compatible function would look like this:

static inline bool zone_device_pages_compatible(const struct page *a,
                         const struct page *b)
{
     if (is_pci_p2pdma_page(a) || is_pci_p2pdma_page(b))
         return zone_device_pages_have_same_pgmap(a, b);
     return true;
}

This would prevent two P2PDMA pages from different pgmaps (different PCI 
devices) passing the compatible check and both get added to the bio.
Please correct me if that is not what you meant. I'll wait for a couple 
more days and send the next version with this, and we can review this again.

Thanks for your inputs.

Regards,
Naman

      reply	other threads:[~2026-04-07  7:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-01  8:23 [PATCH 0/2] block: fix pgmap handling for zone device pages in bio merge paths Naman Jain
2026-04-01  8:23 ` [PATCH 1/2] block: add pgmap check to biovec_phys_mergeable Naman Jain
2026-04-01 14:07   ` Christoph Hellwig
2026-04-01  8:23 ` [PATCH 2/2] block: allow different-pgmap pages as separate bvecs in bio_add_page Naman Jain
2026-04-01 14:08   ` Christoph Hellwig
2026-04-02  5:21     ` Naman Jain
2026-04-02  5:30       ` Christoph Hellwig
2026-04-02  8:55         ` Naman Jain
2026-04-07  5:52           ` Christoph Hellwig
2026-04-07  7:08             ` Naman Jain [this message]

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=6106a655-2d4b-4ebf-b269-459e3bd3efd4@linux.microsoft.com \
    --to=namjain@linux.microsoft.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=jhubbard@nvidia.com \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=longli@microsoft.com \
    --cc=mhklinux@outlook.com \
    --cc=ssengar@linux.microsoft.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