All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Zeng, Oak" <Oak.Zeng@amd.com>
To: "Sierra Guiza, Alejandro (Alex)" <Alex.Sierra@amd.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"Kuehling, Felix" <Felix.Kuehling@amd.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"rcampbell@nvidia.com" <rcampbell@nvidia.com>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>
Cc: "jglisse@redhat.com" <jglisse@redhat.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"jgg@nvidia.com" <jgg@nvidia.com>, "hch@lst.de" <hch@lst.de>
Subject: Re: [PATCH v4 06/13] include/linux/mm.h: helpers to check zone device generic type
Date: Mon, 19 Jul 2021 20:47:04 +0000	[thread overview]
Message-ID: <25BBA6FE-5134-4CF8-B0B2-BF3BE907AC38@amd.com> (raw)
In-Reply-To: <20210717192135.9030-7-alex.sierra@amd.com>



Regards,
Oak 

 

On 2021-07-17, 3:22 PM, "amd-gfx on behalf of Alex Sierra" <amd-gfx-bounces@lists.freedesktop.org on behalf of Alex.Sierra@amd.com> wrote:

    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 d8d79bb94be8..f5b247a63044 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)

The function name here is confusing. Theoretically as long as page's zone number is ZONE_DEVICE, then the page is a device page. You put the condition more strict below just because the kfd svm implementation only uses MEMORY_DEVICE_PRIVATE/GENERIC. But MEMORY_DEVICE_FS_DAX and MEMORY_DEVICE_PCI_P2PDMA is also device memory (compared to normal cpu system memory).

    +{
    +	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

    _______________________________________________
    amd-gfx mailing list
    amd-gfx@lists.freedesktop.org
    https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Coak.zeng%40amd.com%7C6a01845fd1524360d79a08d949583365%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637621465431851292%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=nHblZdGYyYuQVws%2BgG4HgnKpGiQXCfxxEnWZuozKy9g%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

WARNING: multiple messages have this Message-ID (diff)
From: "Zeng, Oak" <Oak.Zeng@amd.com>
To: "Sierra Guiza, Alejandro (Alex)" <Alex.Sierra@amd.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"Kuehling, Felix" <Felix.Kuehling@amd.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"rcampbell@nvidia.com" <rcampbell@nvidia.com>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>
Cc: "jglisse@redhat.com" <jglisse@redhat.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"jgg@nvidia.com" <jgg@nvidia.com>, "hch@lst.de" <hch@lst.de>
Subject: Re: [PATCH v4 06/13] include/linux/mm.h: helpers to check zone device generic type
Date: Mon, 19 Jul 2021 20:47:04 +0000	[thread overview]
Message-ID: <25BBA6FE-5134-4CF8-B0B2-BF3BE907AC38@amd.com> (raw)
In-Reply-To: <20210717192135.9030-7-alex.sierra@amd.com>



Regards,
Oak 

 

On 2021-07-17, 3:22 PM, "amd-gfx on behalf of Alex Sierra" <amd-gfx-bounces@lists.freedesktop.org on behalf of Alex.Sierra@amd.com> wrote:

    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 d8d79bb94be8..f5b247a63044 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)

The function name here is confusing. Theoretically as long as page's zone number is ZONE_DEVICE, then the page is a device page. You put the condition more strict below just because the kfd svm implementation only uses MEMORY_DEVICE_PRIVATE/GENERIC. But MEMORY_DEVICE_FS_DAX and MEMORY_DEVICE_PCI_P2PDMA is also device memory (compared to normal cpu system memory).

    +{
    +	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

    _______________________________________________
    amd-gfx mailing list
    amd-gfx@lists.freedesktop.org
    https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Coak.zeng%40amd.com%7C6a01845fd1524360d79a08d949583365%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637621465431851292%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=nHblZdGYyYuQVws%2BgG4HgnKpGiQXCfxxEnWZuozKy9g%3D&amp;reserved=0


WARNING: multiple messages have this Message-ID (diff)
From: "Zeng, Oak" <Oak.Zeng@amd.com>
To: "Sierra Guiza, Alejandro (Alex)" <Alex.Sierra@amd.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"Kuehling, Felix" <Felix.Kuehling@amd.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"rcampbell@nvidia.com" <rcampbell@nvidia.com>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>
Cc: "jglisse@redhat.com" <jglisse@redhat.com>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"hch@lst.de" <hch@lst.de>
Subject: Re: [PATCH v4 06/13] include/linux/mm.h: helpers to check zone device generic type
Date: Mon, 19 Jul 2021 20:47:04 +0000	[thread overview]
Message-ID: <25BBA6FE-5134-4CF8-B0B2-BF3BE907AC38@amd.com> (raw)
In-Reply-To: <20210717192135.9030-7-alex.sierra@amd.com>



Regards,
Oak 

 

On 2021-07-17, 3:22 PM, "amd-gfx on behalf of Alex Sierra" <amd-gfx-bounces@lists.freedesktop.org on behalf of Alex.Sierra@amd.com> wrote:

    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 d8d79bb94be8..f5b247a63044 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)

The function name here is confusing. Theoretically as long as page's zone number is ZONE_DEVICE, then the page is a device page. You put the condition more strict below just because the kfd svm implementation only uses MEMORY_DEVICE_PRIVATE/GENERIC. But MEMORY_DEVICE_FS_DAX and MEMORY_DEVICE_PCI_P2PDMA is also device memory (compared to normal cpu system memory).

    +{
    +	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

    _______________________________________________
    amd-gfx mailing list
    amd-gfx@lists.freedesktop.org
    https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Coak.zeng%40amd.com%7C6a01845fd1524360d79a08d949583365%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637621465431851292%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=nHblZdGYyYuQVws%2BgG4HgnKpGiQXCfxxEnWZuozKy9g%3D&amp;reserved=0


  reply	other threads:[~2021-07-19 20:47 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-17 19:21 [PATCH v4 00/13] Support DEVICE_GENERIC memory in migrate_vma_* Alex Sierra
2021-07-17 19:21 ` Alex Sierra
2021-07-17 19:21 ` Alex Sierra
2021-07-17 19:21 ` [PATCH v4 01/13] ext4/xfs: add page refcount helper Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21 ` [PATCH v4 02/13] mm: remove extra ZONE_DEVICE struct page refcount Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21 ` [PATCH v4 03/13] kernel: resource: lookup_resource as exported symbol Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-19  9:16   ` Christoph Hellwig
2021-07-19  9:16     ` Christoph Hellwig
2021-07-17 19:21 ` [PATCH v4 04/13] drm/amdkfd: add SPM support for SVM Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21 ` [PATCH v4 05/13] drm/amdkfd: generic type as sys mem on migration to ram Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-19  9:17   ` Christoph Hellwig
2021-07-19  9:17     ` Christoph Hellwig
2021-07-17 19:21 ` [PATCH v4 06/13] include/linux/mm.h: helpers to check zone device generic type Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-19 20:47   ` Zeng, Oak [this message]
2021-07-19 20:47     ` Zeng, Oak
2021-07-19 20:47     ` Zeng, Oak
2021-07-17 19:21 ` [PATCH v4 07/13] mm: add generic type support to migrate_vma helpers Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21 ` [PATCH v4 08/13] mm: call pgmap->ops->page_free for DEVICE_GENERIC pages Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-19  9:18   ` Christoph Hellwig
2021-07-19  9:18     ` Christoph Hellwig
2021-07-17 19:21 ` [PATCH v4 09/13] lib: test_hmm add ioctl to get zone device type Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21 ` [PATCH v4 10/13] lib: test_hmm add module param for " Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-22 12:23   ` Jason Gunthorpe
2021-07-22 12:23     ` Jason Gunthorpe
2021-07-22 12:23     ` Jason Gunthorpe
2021-07-22 16:59     ` Sierra Guiza, Alejandro (Alex)
2021-07-22 16:59       ` Sierra Guiza, Alejandro (Alex)
2021-07-22 16:59       ` Sierra Guiza, Alejandro (Alex)
2021-07-22 17:26       ` Jason Gunthorpe
2021-07-22 17:26         ` Jason Gunthorpe
2021-07-22 17:26         ` Jason Gunthorpe
2021-07-28 23:45         ` Sierra Guiza, Alejandro (Alex)
2021-07-28 23:45           ` Sierra Guiza, Alejandro (Alex)
2021-07-28 23:45           ` Sierra Guiza, Alejandro (Alex)
2021-07-30 19:11           ` Felix Kuehling
2021-07-17 19:21 ` [PATCH v4 11/13] lib: add support for device generic type in test_hmm Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21 ` [PATCH v4 12/13] tools: update hmm-test to support device generic type Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21 ` [PATCH v4 13/13] tools: update test_hmm script to support SP config Alex Sierra
2021-07-17 19:21   ` Alex Sierra
2021-07-17 19:21   ` Alex Sierra

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=25BBA6FE-5134-4CF8-B0B2-BF3BE907AC38@amd.com \
    --to=oak.zeng@amd.com \
    --cc=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 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.