From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,jgg@ziepe.ca,david@redhat.com,dan.j.williams@intel.com,apopple@nvidia.com,balbirs@nvidia.com,akpm@linux-foundation.org
Subject: + mm-allow-compound-zone-device-pages-fix.patch added to mm-unstable branch
Date: Wed, 19 Feb 2025 16:00:22 -0800 [thread overview]
Message-ID: <20250220000023.3F461C4CED1@smtp.kernel.org> (raw)
The patch titled
Subject: mm/migrate_device: do not access pgmap for non zone device pages
has been added to the -mm mm-unstable branch. Its filename is
mm-allow-compound-zone-device-pages-fix.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-allow-compound-zone-device-pages-fix.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Balbir Singh <balbirs@nvidia.com>
Subject: mm/migrate_device: do not access pgmap for non zone device pages
Date: Thu, 20 Feb 2025 10:13:37 +1100
page_pgmap() is referenced before checking if the page is a zone device
page and this triggers the warning in page_pgmap(). Refactor the code to
use the helper function after relevant checks.
Link: https://lkml.kernel.org/r/20250219231337.364133-1-balbirs@nvidia.com
Signed-off-by: Balbir Singh <balbirs@nvidia.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/migrate_device.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
--- a/mm/migrate_device.c~mm-allow-compound-zone-device-pages-fix
+++ a/mm/migrate_device.c
@@ -153,14 +153,17 @@ again:
goto next;
}
page = vm_normal_page(migrate->vma, addr, pte);
- pgmap = page_pgmap(page);
if (page && !is_zone_device_page(page) &&
!(migrate->flags & MIGRATE_VMA_SELECT_SYSTEM))
goto next;
- else if (page && is_device_coherent_page(page) &&
- (!(migrate->flags & MIGRATE_VMA_SELECT_DEVICE_COHERENT) ||
- pgmap->owner != migrate->pgmap_owner))
- goto next;
+ else if (page && is_device_coherent_page(page)) {
+ pgmap = page_pgmap(page);
+
+ if (!(migrate->flags &
+ MIGRATE_VMA_SELECT_DEVICE_COHERENT) ||
+ pgmap->owner != migrate->pgmap_owner)
+ goto next;
+ }
mpfn = migrate_pfn(pfn) | MIGRATE_PFN_MIGRATE;
mpfn |= pte_write(pte) ? MIGRATE_PFN_WRITE : 0;
}
_
Patches currently in -mm which might be from balbirs@nvidia.com are
mm-allow-compound-zone-device-pages-fix.patch
reply other threads:[~2025-02-20 0:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250220000023.3F461C4CED1@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=balbirs@nvidia.com \
--cc=dan.j.williams@intel.com \
--cc=david@redhat.com \
--cc=jgg@ziepe.ca \
--cc=mm-commits@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.