From: Alex Sierra <alex.sierra@amd.com>
To: akpm@linux-foundation.org, Felix.Kuehling@amd.com,
linux-mm@kvack.org, rcampbell@nvidia.com,
linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
hch@lst.de, jgg@nvidia.com, jglisse@redhat.com
Subject: [PATCH v5 06/13] include/linux/mm.h: helpers to check zone device generic type
Date: Thu, 12 Aug 2021 01:30:53 -0500 [thread overview]
Message-ID: <20210812063100.31997-7-alex.sierra@amd.com> (raw)
In-Reply-To: <20210812063100.31997-1-alex.sierra@amd.com>
Two helpers added. One checks if zone device page is generic
type. The other if page is either private or generic type.
Signed-off-by: Alex Sierra <alex.sierra@amd.com>
---
include/linux/mm.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c0fcb47d7641..8853acb89b1a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1125,6 +1125,14 @@ static inline bool is_device_private_page(const struct page *page)
page->pgmap->type == MEMORY_DEVICE_PRIVATE;
}
+static inline bool is_device_page(const struct page *page)
+{
+ return IS_ENABLED(CONFIG_DEV_PAGEMAP_OPS) &&
+ is_zone_device_page(page) &&
+ (page->pgmap->type == MEMORY_DEVICE_PRIVATE ||
+ page->pgmap->type == MEMORY_DEVICE_GENERIC);
+}
+
static inline bool is_pci_p2pdma_page(const struct page *page)
{
return IS_ENABLED(CONFIG_DEV_PAGEMAP_OPS) &&
--
2.32.0
next prev parent reply other threads:[~2021-08-12 6:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-12 6:30 [PATCH v5 00/13] Support DEVICE_GENERIC memory in migrate_vma_* Alex Sierra
2021-08-12 6:30 ` [PATCH v5 01/13] ext4/xfs: add page refcount helper Alex Sierra
2021-08-12 6:30 ` [PATCH v5 02/13] mm: remove extra ZONE_DEVICE struct page refcount Alex Sierra
2021-08-12 6:30 ` [PATCH v5 03/13] kernel: resource: lookup_resource as exported symbol Alex Sierra
2021-08-12 6:30 ` [PATCH v5 04/13] drm/amdkfd: add SPM support for SVM Alex Sierra
2021-08-12 6:30 ` [PATCH v5 05/13] drm/amdkfd: generic type as sys mem on migration to ram Alex Sierra
2021-08-12 6:30 ` Alex Sierra [this message]
2021-08-12 6:30 ` [PATCH v5 07/13] mm: add generic type support to migrate_vma helpers Alex Sierra
2021-08-12 6:30 ` [PATCH v5 08/13] mm: call pgmap->ops->page_free for DEVICE_GENERIC pages Alex Sierra
2021-08-12 6:30 ` [PATCH v5 09/13] lib: test_hmm add ioctl to get zone device type Alex Sierra
2021-08-12 6:30 ` [PATCH v5 10/13] lib: test_hmm add module param for " Alex Sierra
2021-08-12 6:30 ` [PATCH v5 11/13] lib: add support for device generic type in test_hmm Alex Sierra
2021-08-12 6:30 ` [PATCH v5 12/13] tools: update hmm-test to support device generic type Alex Sierra
2021-08-12 6:31 ` [PATCH v5 13/13] tools: update test_hmm script to support SP config Alex Sierra
2021-08-12 6:34 ` [PATCH v5 00/13] Support DEVICE_GENERIC memory in migrate_vma_* Christoph Hellwig
2021-08-13 5:18 ` Sierra Guiza, Alejandro (Alex)
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=20210812063100.31997-7-alex.sierra@amd.com \
--to=alex.sierra@amd.com \
--cc=Felix.Kuehling@amd.com \
--cc=akpm@linux-foundation.org \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hch@lst.de \
--cc=jgg@nvidia.com \
--cc=jglisse@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=rcampbell@nvidia.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