[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250828125251.08e4a429.alex.williamson@redhat.com>
Date: Thu, 28 Aug 2025 12:52:51 -0600
From: Alex Williamson <alex.williamson@...hat.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, Brett Creeley <brett.creeley@....com>,
Jason Gunthorpe <jgg@...pe.ca>, Yishai Hadas <yishaih@...dia.com>, Shameer
Kolothum <shameerali.kolothum.thodi@...wei.com>, Kevin Tian
<kevin.tian@...el.com>, Alexander Potapenko <glider@...gle.com>, Andrew
Morton <akpm@...ux-foundation.org>, Brendan Jackman <jackmanb@...gle.com>,
Christoph Lameter <cl@...two.org>, Dennis Zhou <dennis@...nel.org>, Dmitry
Vyukov <dvyukov@...gle.com>, dri-devel@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org, iommu@...ts.linux.dev,
io-uring@...r.kernel.org, Jason Gunthorpe <jgg@...dia.com>, Jens Axboe
<axboe@...nel.dk>, Johannes Weiner <hannes@...xchg.org>, John Hubbard
<jhubbard@...dia.com>, kasan-dev@...glegroups.com, kvm@...r.kernel.org,
"Liam R. Howlett" <Liam.Howlett@...cle.com>, Linus Torvalds
<torvalds@...ux-foundation.org>, linux-arm-kernel@...s.com,
linux-arm-kernel@...ts.infradead.org, linux-crypto@...r.kernel.org,
linux-ide@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-mips@...r.kernel.org, linux-mmc@...r.kernel.org, linux-mm@...ck.org,
linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org,
linux-scsi@...r.kernel.org, Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Marco Elver <elver@...gle.com>, Marek Szyprowski
<m.szyprowski@...sung.com>, Michal Hocko <mhocko@...e.com>, Mike Rapoport
<rppt@...nel.org>, Muchun Song <muchun.song@...ux.dev>,
netdev@...r.kernel.org, Oscar Salvador <osalvador@...e.de>, Peter Xu
<peterx@...hat.com>, Robin Murphy <robin.murphy@....com>, Suren
Baghdasaryan <surenb@...gle.com>, Tejun Heo <tj@...nel.org>,
virtualization@...ts.linux.dev, Vlastimil Babka <vbabka@...e.cz>,
wireguard@...ts.zx2c4.com, x86@...nel.org, Zi Yan <ziy@...dia.com>
Subject: Re: [PATCH v1 31/36] vfio/pci: drop nth_page() usage within SG
entry
On Thu, 28 Aug 2025 00:01:35 +0200
David Hildenbrand <david@...hat.com> wrote:
> It's no longer required to use nth_page() when iterating pages within a
> single SG entry, so let's drop the nth_page() usage.
>
> Cc: Brett Creeley <brett.creeley@....com>
> Cc: Jason Gunthorpe <jgg@...pe.ca>
> Cc: Yishai Hadas <yishaih@...dia.com>
> Cc: Shameer Kolothum <shameerali.kolothum.thodi@...wei.com>
> Cc: Kevin Tian <kevin.tian@...el.com>
> Cc: Alex Williamson <alex.williamson@...hat.com>
> Signed-off-by: David Hildenbrand <david@...hat.com>
> ---
> drivers/vfio/pci/pds/lm.c | 3 +--
> drivers/vfio/pci/virtio/migrate.c | 3 +--
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/vfio/pci/pds/lm.c b/drivers/vfio/pci/pds/lm.c
> index f2673d395236a..4d70c833fa32e 100644
> --- a/drivers/vfio/pci/pds/lm.c
> +++ b/drivers/vfio/pci/pds/lm.c
> @@ -151,8 +151,7 @@ static struct page *pds_vfio_get_file_page(struct pds_vfio_lm_file *lm_file,
> lm_file->last_offset_sg = sg;
> lm_file->sg_last_entry += i;
> lm_file->last_offset = cur_offset;
> - return nth_page(sg_page(sg),
> - (offset - cur_offset) / PAGE_SIZE);
> + return sg_page(sg) + (offset - cur_offset) / PAGE_SIZE;
> }
> cur_offset += sg->length;
> }
> diff --git a/drivers/vfio/pci/virtio/migrate.c b/drivers/vfio/pci/virtio/migrate.c
> index ba92bb4e9af94..7dd0ac866461d 100644
> --- a/drivers/vfio/pci/virtio/migrate.c
> +++ b/drivers/vfio/pci/virtio/migrate.c
> @@ -53,8 +53,7 @@ virtiovf_get_migration_page(struct virtiovf_data_buffer *buf,
> buf->last_offset_sg = sg;
> buf->sg_last_entry += i;
> buf->last_offset = cur_offset;
> - return nth_page(sg_page(sg),
> - (offset - cur_offset) / PAGE_SIZE);
> + return sg_page(sg) + (offset - cur_offset) / PAGE_SIZE;
> }
> cur_offset += sg->length;
> }
Reviewed-by: Alex Williamson <alex.williamson@...hat.com>
Powered by blists - more mailing lists