Skip to contentSkip to conversation

Enable THP support in drm_pagemap

PATCH Superseded Francois Dugast 9 participants 52 messages Jan 11 – Jan 13

Subsystems (18)
DRM drivers Memory management VFS KVM +14 more subsystems

v4 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v4 cover Enable THP support in drm_pagemap

Use Balbir Singh's series for device-private THP support [1] and previous preparation work in drm_pagemap [2] to add 2MB/THP support in xe. This leads to significant performance improvements when using SVM with 2MB pages.

[1] https://lore.kernel.org/linux-mm/[email protected]/
[2] https://patchwork.freedesktop.org/series/151754/

v2:
- rebase on top of multi-device SVM
- add drm_pagemap_cpages() with temporary patch
- address other feedback from Matt Brost on v1

v3:
The major change is to remove the dependency to the mm/huge_memory helper migrate_device_split_page() that was called explicitely when a 2M buddy allocation backed by a large folio would be later reused for a smaller allocation (4K or 64K). Instead, the first 3 patches provided by Matthew Brost ensure large folios are split at the time of freeing.

v4:
- add order argument to folio_free callback
- send complete series to linux-mm and MM folks as requested (Zi Yan and Andrew Morton) and cover letter to anyone receiving at least one of the patches (Liam R. Howlett)

Cc Zi Yan <[email protected]>
Cc Madhavan Srinivasan <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc "Christophe Leroy (CS GROUP)" <[email protected]>
Cc Felix Kuehling <[email protected]>
Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
Cc David Airlie <[email protected]>
Cc Simona Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Lyude Paul <[email protected]>
Cc Danilo Krummrich <[email protected]>
Cc Bjorn Helgaas <[email protected]>
Cc Logan Gunthorpe <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Leon Romanovsky <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Dan Williams <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Jan Kara <[email protected]>
Cc Alexander Viro <[email protected]>
Cc Christian Brauner <[email protected]>

Francois Dugast (3):
drm/pagemap: Unlock and put folios when possible drm/pagemap: Add helper to access zone_device_data drm/pagemap: Enable THP support for GPU memory migration

Matthew Brost (4):
mm/zone_device: Add order argument to folio_free callback mm/zone_device: Add free_zone_device_folio_prepare() helper fs/dax: Use free_zone_device_folio_prepare() helper drm/pagemap: Correct cpages calculation for migrate_vma_setup

 arch/powerpc/kvm/book3s_hv_uvmem.c       |   2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c |   2 +-
 drivers/gpu/drm/drm_gpusvm.c             |   7 +-
 drivers/gpu/drm/drm_pagemap.c            | 165 ++++++++++++++++++-----
 drivers/gpu/drm/nouveau/nouveau_dmem.c   |   4 +-
 drivers/pci/p2pdma.c                     |   2 +-
 fs/dax.c                                 |  24 +---
 include/drm/drm_pagemap.h                |  15 +++
 include/linux/memremap.h                 |   8 +-
 lib/test_hmm.c                           |   4 +-
 mm/memremap.c                            |  60 ++++++++-
 11 files changed, 227 insertions(+), 66 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v4 1/7 mm/zone_device: Add order argument to folio_free callback

From: Matthew Brost <[email protected]>

The core MM splits the folio before calling folio_free, restoring the zone pages associated with the folio to an initialized state (e.g., non-compound, pgmap valid, etc...). The order argument represents the folio’s order prior to the split which can be used driver side to know how many pages are being freed.

Fixes 3a5a06554566 ("mm/zone_device: rename page_free callback to folio_free")
Cc Zi Yan <[email protected]>
Cc Madhavan Srinivasan <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc "Christophe Leroy (CS GROUP)" <[email protected]>
Cc Felix Kuehling <[email protected]>
Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
Cc David Airlie <[email protected]>
Cc Simona Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Lyude Paul <[email protected]>
Cc Danilo Krummrich <[email protected]>
Cc Bjorn Helgaas <[email protected]>
Cc Logan Gunthorpe <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Leon Romanovsky <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 arch/powerpc/kvm/book3s_hv_uvmem.c       | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 2 +-
 drivers/gpu/drm/drm_pagemap.c            | 3 ++-
 drivers/gpu/drm/nouveau/nouveau_dmem.c   | 4 ++--
 drivers/pci/p2pdma.c                     | 2 +-
 include/linux/memremap.h                 | 7 ++++++-
 lib/test_hmm.c                           | 4 +---
 mm/memremap.c                            | 5 +++--
 8 files changed, 17 insertions(+), 12 deletions(-)
arch/powerpc/kvm/book3s_hv_uvmem.c +1 -1
index e5000bef90f2..b58f34eec6e5 100644
@@ -1014,7 +1014,7 @@ static vm_fault_t kvmppc_uvmem_migrate_to_ram(struct vm_fault *vmf)
  * to a normal PFN during H_SVM_PAGE_OUT.
  * Gets called with kvm->arch.uvmem_lock held.
  */
-static void kvmppc_uvmem_folio_free(struct folio *folio)
+static void kvmppc_uvmem_folio_free(struct folio *folio, unsigned int order)
 {
 	struct page *page = &folio->page;
 	unsigned long pfn = page_to_pfn(page) -
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +1 -1
index af53e796ea1b..a26e3c448e47 100644
@@ -567,7 +567,7 @@ svm_migrate_ram_to_vram(struct svm_range *prange, uint32_t best_loc,
 	return r < 0 ? r : 0;
 }
 
-static void svm_migrate_folio_free(struct folio *folio)
+static void svm_migrate_folio_free(struct folio *folio, unsigned int order)
 {
 	struct page *page = &folio->page;
 	struct svm_range_bo *svm_bo = page->zone_device_data;
drivers/gpu/drm/drm_pagemap.c +2 -1
index 03ee39a761a4..df253b13cf85 100644
@@ -1144,11 +1144,12 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 /**
  * drm_pagemap_folio_free() - Put GPU SVM zone device data associated with a folio
  * @folio: Pointer to the folio
+ * @order: Order of the folio prior to being split by core MM
  *
  * This function is a callback used to put the GPU SVM zone device data
  * associated with a page when it is being released.
  */
-static void drm_pagemap_folio_free(struct folio *folio)
+static void drm_pagemap_folio_free(struct folio *folio, unsigned int order)
 {
 	drm_pagemap_zdd_put(folio->page.zone_device_data);
 }
drivers/gpu/drm/nouveau/nouveau_dmem.c +2 -2
index 58071652679d..545f316fca14 100644
@@ -115,14 +115,14 @@ unsigned long nouveau_dmem_page_addr(struct page *page)
 	return chunk->bo->offset + off;
 }
 
-static void nouveau_dmem_folio_free(struct folio *folio)
+static void nouveau_dmem_folio_free(struct folio *folio, unsigned int order)
 {
 	struct page *page = &folio->page;
 	struct nouveau_dmem_chunk *chunk = nouveau_page_to_chunk(page);
 	struct nouveau_dmem *dmem = chunk->drm->dmem;
 
 	spin_lock(&dmem->lock);
-	if (folio_order(folio)) {
+	if (order) {
 		page->zone_device_data = dmem->free_folios;
 		dmem->free_folios = folio;
 	} else {
drivers/pci/p2pdma.c +1 -1
index 4a2fc7ab42c3..a6fa7610f8a8 100644
@@ -200,7 +200,7 @@ static const struct attribute_group p2pmem_group = {
 	.name = "p2pmem",
 };
 
-static void p2pdma_folio_free(struct folio *folio)
+static void p2pdma_folio_free(struct folio *folio, unsigned int order)
 {
 	struct page *page = &folio->page;
 	struct pci_p2pdma_pagemap *pgmap = to_p2p_pgmap(page_pgmap(page));
include/linux/memremap.h +6 -1
index 713ec0435b48..97fcffeb1c1e 100644
@@ -79,8 +79,13 @@ struct dev_pagemap_ops {
 	 * Called once the folio refcount reaches 0.  The reference count will be
 	 * reset to one by the core code after the method is called to prepare
 	 * for handing out the folio again.
+	 *
+	 * The core MM splits the folio before calling folio_free, restoring the
+	 * zone pages associated with the folio to an initialized state (e.g.,
+	 * non-compound, pgmap valid, etc...). The order argument represents the
+	 * folio’s order prior to the split.
 	 */
-	void (*folio_free)(struct folio *folio);
+	void (*folio_free)(struct folio *folio, unsigned int order);
 
 	/*
 	 * Used for private (un-addressable) device memory only.  Must migrate
lib/test_hmm.c +1 -3
index 8af169d3873a..e17c71d02a3a 100644
@@ -1580,13 +1580,11 @@ static const struct file_operations dmirror_fops = {
 	.owner		= THIS_MODULE,
 };
 
-static void dmirror_devmem_free(struct folio *folio)
+static void dmirror_devmem_free(struct folio *folio, unsigned int order)
 {
 	struct page *page = &folio->page;
 	struct page *rpage = BACKING_PAGE(page);
 	struct dmirror_device *mdevice;
-	struct folio *rfolio = page_folio(rpage);
-	unsigned int order = folio_order(rfolio);
 
 	if (rpage != page) {
 		if (order)
mm/memremap.c +3 -2
index 63c6ab4fdf08..39dc4bd190d0 100644
@@ -417,6 +417,7 @@ void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;
 	unsigned long nr = folio_nr_pages(folio);
+	unsigned int order = folio_order(folio);
 	int i;
 
 	if (WARN_ON_ONCE(!pgmap))
@@ -453,7 +454,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
-		pgmap->ops->folio_free(folio);
+		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;
 
@@ -472,7 +473,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_PCI_P2PDMA:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
-		pgmap->ops->folio_free(folio);
+		pgmap->ops->folio_free(folio, order);
 		break;
 	}
 }
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 5 lines · Francois Dugast

The core MM splits the folio before calling folio_free, restoring the zone pages associated with the folio to an initialized state (e.g., non-compound, pgmap valid, etc...). The order argument represents the folio’s order prior to the split which can be used driver side to know how many pages are being freed.

This really feels like the wrong way to fix this problem.

I think someone from the graphics side really needs to take the lead on understanding what the MM is doing (both currently and in the future). I'm happy to work with you, but it feels like there's a lot of churn right now because there's a lot of people working on this without understanding the MM side of things (and conversely, I don't think (m)any people on the MM side really understand what graphics cards are trying to accomplish).

Who is that going to be? I'm happy to get on the phone with someone.

#3 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 9 lines · Matthew Wilcox
Quoted 5 lines · Francois Dugast

The core MM splits the folio before calling folio_free, restoring the zone pages associated with the folio to an initialized state (e.g., non-compound, pgmap valid, etc...). The order argument represents the folio’s order prior to the split which can be used driver side to know how many pages are being freed.

This really feels like the wrong way to fix this problem.

This stems from a special requirement, freeing is done in two phases

1. Free the folio -> inform the driver (which implies freeing the backing device memory)
2. Return the folio back, split it back to single order folios

The current code does not do 2. 1 followed by 2 does not work for Francois since the backing memory can get reused before we reach step 2. The proposed patch does 2 followed 1, but doing 2 means we've lost the folio order and thus the old order is passed in. Although, I wonder if the backing folio's zone_device_data can be used to encode any order information about the device side allocation.

@Francois, I hope I did not miss anything in the explanation above.

Quoted 7 lines

I think someone from the graphics side really needs to take the lead on understanding what the MM is doing (both currently and in the future). I'm happy to work with you, but it feels like there's a lot of churn right now because there's a lot of people working on this without understanding the MM side of things (and conversely, I don't think (m)any people on the MM side really understand what graphics cards are trying to accomplish).

I suspect you are referring to folio specialization and/or downsizing?

Quoted 1 line

Who is that going to be? I'm happy to get on the phone with someone.

Happy to work with you, but I am not the authority on graphics, I can speak to zone device folios. I suspect we'd need to speak to more than one person.

Balbir

#4 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 10 lines · Balbir Singh
Quoted 9 lines · Matthew Wilcox
Quoted 5 lines · Francois Dugast

The core MM splits the folio before calling folio_free, restoring the zone pages associated with the folio to an initialized state (e.g., non-compound, pgmap valid, etc...). The order argument represents the folio’s order prior to the split which can be used driver side to know how many pages are being freed.

This really feels like the wrong way to fix this problem.

Hi Matthew,

I think the wording is confusing, since the actual issue is that:

1. zone_device_page_init() calls prep_compound_page() to form a large folio,
2. but free_zone_device_folio() never reverse the course,
3. the undo of prep_compound_page() in free_zone_device_folio() needs to be done before driver callback ->folio_free(), since once ->folio_free() is called, the folio can be reallocated immediately,
4. after the undo of prep_compound_page(), folio_order() can no longer provide the original order information, thus, folio_free() needs that for proper device side ref manipulation.

So this is not used for "split" but undo of prep_compound_page(). It might look like a split to non core MM people, since it changes a large folio to a bunch of base pages. BTW, core MM has no compound_page_dctor() but open codes it in free_pages_prepare() by resetting page flags, page->mapping, and so on. So it might be why the undo prep_compound_page() is missed by non core MM people.

Quoted 5 lines

This stems from a special requirement, freeing is done in two phases

1. Free the folio -> inform the driver (which implies freeing the backing device memory)
2. Return the folio back, split it back to single order folios

Hi Balbir,

Please refrain from using "split" here, since it confuses MM people. A folio is split when it is still in use, but in this case, the folio has been freed and needs to be restored to "free page" state.

Quoted 18 lines

The current code does not do 2. 1 followed by 2 does not work for Francois since the backing memory can get reused before we reach step 2. The proposed patch does 2 followed 1, but doing 2 means we've lost the folio order and thus the old order is passed in. Although, I wonder if the backing folio's zone_device_data can be used to encode any order information about the device side allocation.

@Francois, I hope I did not miss anything in the explanation above.

Quoted 7 lines

I think someone from the graphics side really needs to take the lead on understanding what the MM is doing (both currently and in the future). I'm happy to work with you, but it feels like there's a lot of churn right now because there's a lot of people working on this without understanding the MM side of things (and conversely, I don't think (m)any people on the MM side really understand what graphics cards are trying to accomplish).

Quoted 7 lines

I suspect you are referring to folio specialization and/or downsizing?

Quoted 1 line

Who is that going to be? I'm happy to get on the phone with someone.

Happy to work with you, but I am not the authority on graphics, I can speak to zone device folios. I suspect we'd need to speak to more than one person.

--
Best Regards,
Yan, Zi

maintainer
#5 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 26 lines · Zi Yan
Quoted 10 lines · Balbir Singh
Quoted 9 lines · Matthew Wilcox
Quoted 5 lines · Francois Dugast

The core MM splits the folio before calling folio_free, restoring the zone pages associated with the folio to an initialized state (e.g., non-compound, pgmap valid, etc...). The order argument represents the folio’s order prior to the split which can be used driver side to know how many pages are being freed.

This really feels like the wrong way to fix this problem.

Hi Matthew,

I think the wording is confusing, since the actual issue is that:

1. zone_device_page_init() calls prep_compound_page() to form a large folio,
2. but free_zone_device_folio() never reverse the course,
3. the undo of prep_compound_page() in free_zone_device_folio() needs to be done before driver callback ->folio_free(), since once ->folio_free() is called, the folio can be reallocated immediately,
4. after the undo of prep_compound_page(), folio_order() can no longer provide the original order information, thus, folio_free() needs that for proper device side ref manipulation.

Quoted 7 lines

So this is not used for "split" but undo of prep_compound_page(). It might look like a split to non core MM people, since it changes a large folio to a bunch of base pages. BTW, core MM has no compound_page_dctor() but open codes it in free_pages_prepare() by resetting page flags, page->mapping, and so on. So it might be why the undo prep_compound_page() is missed by non core MM people.

Let me try to reword this while avoiding the term “split” and properly explaining the problem.

Quoted 12 lines
Quoted 5 lines

This stems from a special requirement, freeing is done in two phases

1. Free the folio -> inform the driver (which implies freeing the backing device memory)
2. Return the folio back, split it back to single order folios

Hi Balbir,

Please refrain from using "split" here, since it confuses MM people. A folio is split when it is still in use, but in this case, the folio has been freed and needs to be restored to "free page" state.

Yeah, “split” is a bad term. We are reinitializing all zone pages in a folio upon free.

Quoted 9 lines
Quoted 9 lines

The current code does not do 2. 1 followed by 2 does not work for Francois since the backing memory can get reused before we reach step 2. The proposed patch does 2 followed 1, but doing 2 means we've lost the folio order and thus the old order is passed in. Although, I wonder if the backing folio's zone_device_data can be used to encode any order information about the device side allocation.

@Francois, I hope I did not miss anything in the explanation above.

Yes, correct. The pages in the folio must be reinitialized before calling into the driver to free them, because once that happens, the pages can be immediately reallocated.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

I think someone from the graphics side really needs to take the lead on understanding what the MM is doing (both currently and in the future). I'm happy to work with you, but it feels like there's a lot of churn right now because there's a lot of people working on this without understanding the MM side of things (and conversely, I don't think (m)any people on the MM side really understand what graphics cards are trying to accomplish).

I can’t disagree with anything you’re saying. The core MM is about as complex as it gets, and my understanding of what’s going on isn’t great—it’s basically just reverse engineering until I reach a point where I can fix a problem, think it’s correct, and hope I don’t get shredded.

Graphics/DRM is also quite complex, but that’s where I work...

Quoted 9 lines
Quoted 9 lines
Quoted 1 line

I suspect you are referring to folio specialization and/or downsizing?

Quoted 1 line

Who is that going to be? I'm happy to get on the phone with someone.

Happy to work with you, but I am not the authority on graphics, I can speak to zone device folios. I suspect we'd need to speak to more than one person.

Also happy to work with you, but I agree with Zi—graphics isn’t something one company can speak as an authority on, much less one person.

Matt

Quoted 4 lines

--
Best Regards,
Yan, Zi

#6 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

In reply to Zi Yan
Quoted 36 lines · Zi Yan
Quoted 10 lines · Balbir Singh
Quoted 9 lines · Matthew Wilcox
Quoted 5 lines · Francois Dugast

The core MM splits the folio before calling folio_free, restoring the zone pages associated with the folio to an initialized state (e.g., non-compound, pgmap valid, etc...). The order argument represents the folio’s order prior to the split which can be used driver side to know how many pages are being freed.

This really feels like the wrong way to fix this problem.

Hi Matthew,

I think the wording is confusing, since the actual issue is that:

1. zone_device_page_init() calls prep_compound_page() to form a large folio,
2. but free_zone_device_folio() never reverse the course,
3. the undo of prep_compound_page() in free_zone_device_folio() needs to be done before driver callback ->folio_free(), since once ->folio_free() is called, the folio can be reallocated immediately,
4. after the undo of prep_compound_page(), folio_order() can no longer provide the original order information, thus, folio_free() needs that for proper device side ref manipulation.

So this is not used for "split" but undo of prep_compound_page(). It might look like a split to non core MM people, since it changes a large folio to a bunch of base pages. BTW, core MM has no compound_page_dctor() but open codes it in free_pages_prepare() by resetting page flags, page->mapping, and so on. So it might be why the undo prep_compound_page() is missed by non core MM people.

Quoted 3 lines

This stems from a special requirement, freeing is done in two phases

Quoted 9 lines
Quoted 2 lines

1. Free the folio -> inform the driver (which implies freeing the backing device memory)
2. Return the folio back, split it back to single order folios

Hi Balbir,

Please refrain from using "split" here, since it confuses MM people. A folio is split when it is still in use, but in this case, the folio has been freed and needs to be restored to "free page" state.

Yeah, the word split came from the initial version that called it folio_split_unref() and I was also thinking of the split callback for zone device folios, but I agree (re)initialization is a better term.

Quoted 29 lines
Quoted 18 lines

The current code does not do 2. 1 followed by 2 does not work for Francois since the backing memory can get reused before we reach step 2. The proposed patch does 2 followed 1, but doing 2 means we've lost the folio order and thus the old order is passed in. Although, I wonder if the backing folio's zone_device_data can be used to encode any order information about the device side allocation.

@Francois, I hope I did not miss anything in the explanation above.

Quoted 7 lines

I think someone from the graphics side really needs to take the lead on understanding what the MM is doing (both currently and in the future). I'm happy to work with you, but it feels like there's a lot of churn right now because there's a lot of people working on this without understanding the MM side of things (and conversely, I don't think (m)any people on the MM side really understand what graphics cards are trying to accomplish).

Quoted 7 lines

I suspect you are referring to folio specialization and/or downsizing?

Quoted 1 line

Who is that going to be? I'm happy to get on the phone with someone.

Happy to work with you, but I am not the authority on graphics, I can speak to zone device folios. I suspect we'd need to speak to more than one person.

--
Best Regards,
Yan, Zi

#7 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

In reply to Zi Yan
Quoted 17 lines · Zi Yan
Quoted 10 lines · Balbir Singh
Quoted 9 lines · Matthew Wilcox
Quoted 5 lines · Francois Dugast

The core MM splits the folio before calling folio_free, restoring the zone pages associated with the folio to an initialized state (e.g., non-compound, pgmap valid, etc...). The order argument represents the folio’s order prior to the split which can be used driver side to know how many pages are being freed.

This really feels like the wrong way to fix this problem.

Hi Matthew,

I think the wording is confusing, since the actual issue is that:

Quoted 8 lines

1. zone_device_page_init() calls prep_compound_page() to form a large folio,
2. but free_zone_device_folio() never reverse the course,
3. the undo of prep_compound_page() in free_zone_device_folio() needs to be done before driver callback ->folio_free(), since once ->folio_free() is called, the folio can be reallocated immediately,
4. after the undo of prep_compound_page(), folio_order() can no longer provide the original order information, thus, folio_free() needs that for proper device side ref manipulation.

There is something wrong with the driver if the "folio can be reallocated immediately".

The flow generally expects there to be a driver allocator linked to folio_free()

1) Allocator finds free memory
2) zone_device_page_init() allocates the memory and makes refcount=1
3) __folio_put() knows the recount 0.
4) free_zone_device_folio() calls folio_free(), but it doesn't actually need to undo prep_compound_page() because *NOTHING* can use the page pointer at this point.
5) Driver puts the memory back into the allocator and now #1 can happen. It knows how much memory to put back because folio->order is valid from #2
6) #1 happens again, then #2 happens again and the folio is in the right state for use. The successor #2 fully undoes the work of the predecessor #2.

If you have races where #1 can happen immediately after #3 then the driver design is fundamentally broken and passing around order isn't going to help anything.

If the allocator is using the struct page memory then step #5 should also clean up the struct page with the allocator data before returning it to the allocator.

I vaugely remember talking about this before in the context of the Xe driver.. You can't just take an existing VRAM allocator and layer it on top of the folios and have it broadly ignore the folio_free callback.

Jsaon

#8 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 33 lines · Jason Gunthorpe
Quoted 17 lines · Zi Yan
Quoted 10 lines · Balbir Singh
Quoted 9 lines · Matthew Wilcox
Quoted 5 lines · Francois Dugast

The core MM splits the folio before calling folio_free, restoring the zone pages associated with the folio to an initialized state (e.g., non-compound, pgmap valid, etc...). The order argument represents the folio’s order prior to the split which can be used driver side to know how many pages are being freed.

This really feels like the wrong way to fix this problem.

Hi Matthew,

I think the wording is confusing, since the actual issue is that:

Quoted 8 lines

1. zone_device_page_init() calls prep_compound_page() to form a large folio,
2. but free_zone_device_folio() never reverse the course,
3. the undo of prep_compound_page() in free_zone_device_folio() needs to be done before driver callback ->folio_free(), since once ->folio_free() is called, the folio can be reallocated immediately,
4. after the undo of prep_compound_page(), folio_order() can no longer provide the original order information, thus, folio_free() needs that for proper device side ref manipulation.

There is something wrong with the driver if the "folio can be reallocated immediately".

The flow generally expects there to be a driver allocator linked to folio_free()

Quoted 12 lines

1) Allocator finds free memory
2) zone_device_page_init() allocates the memory and makes refcount=1
3) __folio_put() knows the recount 0.
4) free_zone_device_folio() calls folio_free(), but it doesn't actually need to undo prep_compound_page() because *NOTHING* can use the page pointer at this point.
5) Driver puts the memory back into the allocator and now #1 can happen. It knows how much memory to put back because folio->order is valid from #2
6) #1 happens again, then #2 happens again and the folio is in the right state for use. The successor #2 fully undoes the work of the predecessor #2.

But how can a successor #2 undo the work if the second #1 only allocates half of the original folio? For example, an order-9 at PFN 0 is allocated and freed, then an order-8 at PFN 0 is allocated and another order-8 at PFN 256 is allocated. How can two #2s undo the same order-9 without corrupting each other’s data?

Quoted 8 lines

If you have races where #1 can happen immediately after #3 then the driver design is fundamentally broken and passing around order isn't going to help anything.

If the allocator is using the struct page memory then step #5 should also clean up the struct page with the allocator data before returning it to the allocator.

Do you mean ->folio_free() callback should undo prep_compound_page() instead?

Quoted 5 lines

I vaugely remember talking about this before in the context of the Xe driver.. You can't just take an existing VRAM allocator and layer it on top of the folios and have it broadly ignore the folio_free callback.

Best Regards,
Yan, Zi

#9 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 15 lines · Zi Yan
Quoted 14 lines

folio_free()

1) Allocator finds free memory
2) zone_device_page_init() allocates the memory and makes refcount=1
3) __folio_put() knows the recount 0.
4) free_zone_device_folio() calls folio_free(), but it doesn't actually need to undo prep_compound_page() because *NOTHING* can use the page pointer at this point.
5) Driver puts the memory back into the allocator and now #1 can happen. It knows how much memory to put back because folio->order is valid from #2
6) #1 happens again, then #2 happens again and the folio is in the right state for use. The successor #2 fully undoes the work of the predecessor #2.

Quoted 5 lines

But how can a successor #2 undo the work if the second #1 only allocates half of the original folio? For example, an order-9 at PFN 0 is allocated and freed, then an order-8 at PFN 0 is allocated and another order-8 at PFN 256 is allocated. How can two #2s undo the same order-9 without corrupting each other’s data?

What do you mean? The fundamental rule is you can't read the folio or the order outside folio_free once it's refcount reaches 0.

So the successor #2 will write updated heads and order to the order 8 pages at PFN 0 and the ones starting at PFN 256 will remain with garbage.

This is OK because nothing is allowed to read them as their refcount is 0.

If later PFN256 is allocated then it will get updated head and order at the same time it's refcount becomes 1.

There is corruption and they don't corrupt each other's data.

Quoted 6 lines
Quoted 3 lines

If the allocator is using the struct page memory then step #5 should also clean up the struct page with the allocator data before returning it to the allocator.

Do you mean ->folio_free() callback should undo prep_compound_page() instead?

I wouldn't say undo, I was very careful to say it needs to get the struct page memory into a state that the allocator algorithm expects, whatever that means.

Jason

#10 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 16 lines · Jason Gunthorpe
Quoted 15 lines · Zi Yan
Quoted 14 lines

folio_free()

1) Allocator finds free memory
2) zone_device_page_init() allocates the memory and makes refcount=1
3) __folio_put() knows the recount 0.
4) free_zone_device_folio() calls folio_free(), but it doesn't actually need to undo prep_compound_page() because *NOTHING* can use the page pointer at this point.
5) Driver puts the memory back into the allocator and now #1 can happen. It knows how much memory to put back because folio->order is valid from #2
6) #1 happens again, then #2 happens again and the folio is in the right state for use. The successor #2 fully undoes the work of the predecessor #2.

Quoted 8 lines
Quoted 5 lines

But how can a successor #2 undo the work if the second #1 only allocates half of the original folio? For example, an order-9 at PFN 0 is allocated and freed, then an order-8 at PFN 0 is allocated and another order-8 at PFN 256 is allocated. How can two #2s undo the same order-9 without corrupting each other’s data?

What do you mean? The fundamental rule is you can't read the folio or the order outside folio_free once it's refcount reaches 0.

There is no such a rule. In core MM, folio_split(), which splits a high order folio to low order ones, freezes the folio (turning refcount to 0) and manipulates the folio order and all tail pages compound_head to restructure the folio. Your fundamental rule breaks this. Allowing compound information to stay after a folio is freed means you cannot tell whether a folio is under split or freed.

Quoted 17 lines

So the successor #2 will write updated heads and order to the order 8 pages at PFN 0 and the ones starting at PFN 256 will remain with garbage.

This is OK because nothing is allowed to read them as their refcount is 0.

If later PFN256 is allocated then it will get updated head and order at the same time it's refcount becomes 1.

There is corruption and they don't corrupt each other's data.

Quoted 4 lines
Quoted 3 lines

If the allocator is using the struct page memory then step #5 should also clean up the struct page with the allocator data before returning it to the allocator.

Quoted 8 lines
Quoted 2 lines

Do you mean ->folio_free() callback should undo prep_compound_page() instead?

I wouldn't say undo, I was very careful to say it needs to get the struct page memory into a state that the allocator algorithm expects, whatever that means.

Jason

Best Regards,
Yan, Zi

#11 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 24 lines · Zi Yan
Quoted 22 lines · Jason Gunthorpe
Quoted 20 lines · Zi Yan
Quoted 14 lines

folio_free()

1) Allocator finds free memory
2) zone_device_page_init() allocates the memory and makes refcount=1
3) __folio_put() knows the recount 0.
4) free_zone_device_folio() calls folio_free(), but it doesn't actually need to undo prep_compound_page() because *NOTHING* can use the page pointer at this point.
5) Driver puts the memory back into the allocator and now #1 can happen. It knows how much memory to put back because folio->order is valid from #2
6) #1 happens again, then #2 happens again and the folio is in the right state for use. The successor #2 fully undoes the work of the predecessor #2.

But how can a successor #2 undo the work if the second #1 only allocates half of the original folio? For example, an order-9 at PFN 0 is allocated and freed, then an order-8 at PFN 0 is allocated and another order-8 at PFN 256 is allocated. How can two #2s undo the same order-9 without corrupting each other’s data?

Quoted 7 lines
Quoted 2 lines

What do you mean? The fundamental rule is you can't read the folio or the order outside folio_free once it's refcount reaches 0.

There is no such a rule. In core MM, folio_split(), which splits a high order folio to low order ones, freezes the folio (turning refcount to 0) and manipulates the folio order and all tail pages compound_head to restructure the folio.

That's different, I am talking about reaching 0 because it has been freed, meaning there are no external pointers to it.

Further, when a page is frozen page_ref_freeze() takes in the number of references the caller has ownership over and it doesn't succeed if there are stray references elsewhere.

This is very important because the entire operating model of split only works if it has exclusive locks over all the valid pointers into that page.

Spurious refcount failures concurrent with split cannot be allowed.

I don't see how pointing at __folio_freeze_and_split_unmapped() can justify this series.

Quoted 3 lines

Your fundamental rule breaks this. Allowing compound information to stay after a folio is freed means you cannot tell whether a folio is under split or freed.

You can't refcount a folio out of nothing. It has to come from a memory location that already is holding a refcount, and then you can incr it.

For example lockless GUP fast will read the PTE, adjust to the head page, attempt to incr it, then recheck the PTE.

If there are races then sure maybe the PTE will point to a stray tail page that refers to an already allocated head page, but the re-check of the PTE wille exclude this. The refcount system already has to tolerate spurious refcount incrs because of GUP fast.

Nothing should be looking at order and refcount to try to guess if concurrent split is happening!!

Jason

#12 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 40 lines · Jason Gunthorpe
Quoted 24 lines · Zi Yan
Quoted 22 lines · Jason Gunthorpe
Quoted 20 lines · Zi Yan
Quoted 14 lines

folio_free()

1) Allocator finds free memory
2) zone_device_page_init() allocates the memory and makes refcount=1
3) __folio_put() knows the recount 0.
4) free_zone_device_folio() calls folio_free(), but it doesn't actually need to undo prep_compound_page() because *NOTHING* can use the page pointer at this point.
5) Driver puts the memory back into the allocator and now #1 can happen. It knows how much memory to put back because folio->order is valid from #2
6) #1 happens again, then #2 happens again and the folio is in the right state for use. The successor #2 fully undoes the work of the predecessor #2.

But how can a successor #2 undo the work if the second #1 only allocates half of the original folio? For example, an order-9 at PFN 0 is allocated and freed, then an order-8 at PFN 0 is allocated and another order-8 at PFN 256 is allocated. How can two #2s undo the same order-9 without corrupting each other’s data?

Quoted 7 lines
Quoted 2 lines

What do you mean? The fundamental rule is you can't read the folio or the order outside folio_free once it's refcount reaches 0.

There is no such a rule. In core MM, folio_split(), which splits a high order folio to low order ones, freezes the folio (turning refcount to 0) and manipulates the folio order and all tail pages compound_head to restructure the folio.

That's different, I am talking about reaching 0 because it has been freed, meaning there are no external pointers to it.

Further, when a page is frozen page_ref_freeze() takes in the number of references the caller has ownership over and it doesn't succeed if there are stray references elsewhere.

Quoted 9 lines

This is very important because the entire operating model of split only works if it has exclusive locks over all the valid pointers into that page.

Spurious refcount failures concurrent with split cannot be allowed.

I don't see how pointing at __folio_freeze_and_split_unmapped() can justify this series.

But from anyone looking at the folio state, refcount == 0, compound_head is set, they cannot tell the difference.

If what you said is true, why is free_pages_prepare() needed? No one should touch these free pages. Why bother resetting these states.

Quoted 7 lines
Quoted 3 lines

Your fundamental rule breaks this. Allowing compound information to stay after a folio is freed means you cannot tell whether a folio is under split or freed.

You can't refcount a folio out of nothing. It has to come from a memory location that already is holding a refcount, and then you can incr it.

Right. There is also no guarantee that all code is correct and follows this.

My point here is that calling prep_compound_page() on a compound page does not follow core MM’s conventions.

Best Regards,
Yan, Zi

#13 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 11 lines · Zi Yan
Quoted 11 lines

That's different, I am talking about reaching 0 because it has been freed, meaning there are no external pointers to it.

Further, when a page is frozen page_ref_freeze() takes in the number of references the caller has ownership over and it doesn't succeed if there are stray references elsewhere.

This is very important because the entire operating model of split only works if it has exclusive locks over all the valid pointers into that page.

Quoted 8 lines
Quoted 5 lines

Spurious refcount failures concurrent with split cannot be allowed.

I don't see how pointing at __folio_freeze_and_split_unmapped() can justify this series.

But from anyone looking at the folio state, refcount == 0, compound_head is set, they cannot tell the difference.

This isn't reliable, nothing correct can be doing it :\

Quoted 2 lines

If what you said is true, why is free_pages_prepare() needed? No one should touch these free pages. Why bother resetting these states.

? that function does alot of stuff, thinks like uncharging the cgroup should obviously happen at free time.

What part of it are you looking at?

Quoted 6 lines
Quoted 3 lines

You can't refcount a folio out of nothing. It has to come from a memory location that already is holding a refcount, and then you can incr it.

Right. There is also no guarantee that all code is correct and follows this.

Let's concretely point at things that have a problem please.

Quoted 2 lines

My point here is that calling prep_compound_page() on a compound page does not follow core MM’s conventions.

Maybe, but that doesn't mean it isn't the right solution..

Jason

#14 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 23 lines · Jason Gunthorpe
Quoted 11 lines · Zi Yan
Quoted 11 lines

That's different, I am talking about reaching 0 because it has been freed, meaning there are no external pointers to it.

Further, when a page is frozen page_ref_freeze() takes in the number of references the caller has ownership over and it doesn't succeed if there are stray references elsewhere.

This is very important because the entire operating model of split only works if it has exclusive locks over all the valid pointers into that page.

Quoted 8 lines
Quoted 5 lines

Spurious refcount failures concurrent with split cannot be allowed.

I don't see how pointing at __folio_freeze_and_split_unmapped() can justify this series.

But from anyone looking at the folio state, refcount == 0, compound_head is set, they cannot tell the difference.

This isn't reliable, nothing correct can be doing it :\

Quoted 7 lines
Quoted 2 lines

If what you said is true, why is free_pages_prepare() needed? No one should touch these free pages. Why bother resetting these states.

? that function does alot of stuff, thinks like uncharging the cgroup should obviously happen at free time.

What part of it are you looking at?

page[1].flags.f &= ~PAGE_FLAGS_SECOND. It clears folio->order.

free_tail_page_prepare() clears ->mapping, which is TAIL_MAPPING, and compound_head at the end.

page->flags.f &= ~PAGE_FLAGS_CHECK_AT_PREP. It clears PG_head for compound pages.

These three parts undo prep_compound_page().

Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

You can't refcount a folio out of nothing. It has to come from a memory location that already is holding a refcount, and then you can incr it.

Right. There is also no guarantee that all code is correct and follows this.

Quoted 6 lines

Let's concretely point at things that have a problem please.

Quoted 2 lines

My point here is that calling prep_compound_page() on a compound page does not follow core MM’s conventions.

Maybe, but that doesn't mean it isn't the right solution..

In current nouveau code, ->free_folios is used holding the freed folio. In nouveau_dmem_page_alloc_locked(), the freed folio is passed to zone_device_folio_init(). If the allocated folio order is different from the freed folio order, I do not know how you are going to keep track of the rest of the freed folio. Of course you can implement a buddy allocator there.

If this still does not convince you that overwriting an existing compound page with a different order configuration is a bad idea, feel free to do whatever you think it is right.

Best Regards,
Yan, Zi

#15 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 9 lines · Zi Yan

page[1].flags.f &= ~PAGE_FLAGS_SECOND. It clears folio->order.

free_tail_page_prepare() clears ->mapping, which is TAIL_MAPPING, and compound_head at the end.

page->flags.f &= ~PAGE_FLAGS_CHECK_AT_PREP. It clears PG_head for compound pages.

These three parts undo prep_compound_page().

Well, mm doesn't clear all things on alloc..

Quoted 6 lines

In current nouveau code, ->free_folios is used holding the freed folio. In nouveau_dmem_page_alloc_locked(), the freed folio is passed to zone_device_folio_init(). If the allocated folio order is different from the freed folio order, I do not know how you are going to keep track of the rest of the freed folio. Of course you can implement a buddy allocator there.

nouveau doesn't support high order folios.

A simple linked list is not really a suitable data structure to ever support high order folios with.. If it were to use such a thing, and did want to take a high order folio off the list, and reduce its order, then it would have to put the remainder back on the list with a revised order value. That's all, nothing hard.

Again if the driver needs to store information in the struct page to manage its free list mechanism (ie linked pointers, order, whatever) then it should be doing that directly.

When it takes the memory range off the free list it should call zone_device_page_init() to make it ready to be used again. I think it is a poor argument to say that zone_device_page_init() should rely on values already in the struct page to work properly :\

The usable space within the struct page, and what values must be fixed for correct system function, should exactly mirror what frozen pages require. After free it is effectively now a frozen page owned by the device driver.

I haven't seen any documentation on that, but I suspect Matthew and David have some ideas..

If there is a reason for order, flags and mapping to be something particular then it should flow from the definition of frozen pages, and be documented, IMHO.

Jason

#16 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 42 lines · Jason Gunthorpe
Quoted 9 lines · Zi Yan

page[1].flags.f &= ~PAGE_FLAGS_SECOND. It clears folio->order.

free_tail_page_prepare() clears ->mapping, which is TAIL_MAPPING, and compound_head at the end.

page->flags.f &= ~PAGE_FLAGS_CHECK_AT_PREP. It clears PG_head for compound pages.

These three parts undo prep_compound_page().

Well, mm doesn't clear all things on alloc..

Quoted 6 lines

In current nouveau code, ->free_folios is used holding the freed folio. In nouveau_dmem_page_alloc_locked(), the freed folio is passed to zone_device_folio_init(). If the allocated folio order is different from the freed folio order, I do not know how you are going to keep track of the rest of the freed folio. Of course you can implement a buddy allocator there.

nouveau doesn't support high order folios.

A simple linked list is not really a suitable data structure to ever support high order folios with.. If it were to use such a thing, and did want to take a high order folio off the list, and reduce its order, then it would have to put the remainder back on the list with a revised order value. That's all, nothing hard.

Again if the driver needs to store information in the struct page to manage its free list mechanism (ie linked pointers, order, whatever) then it should be doing that directly.

When it takes the memory range off the free list it should call zone_device_page_init() to make it ready to be used again. I think it is a poor argument to say that zone_device_page_init() should rely on values already in the struct page to work properly :\

The usable space within the struct page, and what values must be fixed for correct system function, should exactly mirror what frozen pages require. After free it is effectively now a frozen page owned by the device driver.

Quoted 6 lines

I haven't seen any documentation on that, but I suspect Matthew and David have some ideas..

If there is a reason for order, flags and mapping to be something particular then it should flow from the definition of frozen pages, and be documented, IMHO.

Thank you for the explanation.

It seems that I do not have enough knowledge to comment on device private pages. I will refrain myself from doing so from now on

Best Regards,
Yan, Zi

maintainer
#17 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

In reply to Jason Gunthorpe
Quoted 41 lines · Jason Gunthorpe
Quoted 15 lines · Zi Yan
Quoted 14 lines

folio_free()

1) Allocator finds free memory
2) zone_device_page_init() allocates the memory and makes refcount=1
3) __folio_put() knows the recount 0.
4) free_zone_device_folio() calls folio_free(), but it doesn't actually need to undo prep_compound_page() because *NOTHING* can use the page pointer at this point.
5) Driver puts the memory back into the allocator and now #1 can happen. It knows how much memory to put back because folio->order is valid from #2
6) #1 happens again, then #2 happens again and the folio is in the right state for use. The successor #2 fully undoes the work of the predecessor #2.

Quoted 5 lines

But how can a successor #2 undo the work if the second #1 only allocates half of the original folio? For example, an order-9 at PFN 0 is allocated and freed, then an order-8 at PFN 0 is allocated and another order-8 at PFN 256 is allocated. How can two #2s undo the same order-9 without corrupting each other’s data?

What do you mean? The fundamental rule is you can't read the folio or the order outside folio_free once it's refcount reaches 0.

So the successor #2 will write updated heads and order to the order 8 pages at PFN 0 and the ones starting at PFN 256 will remain with garbage.

This is OK because nothing is allowed to read them as their refcount is 0.

If later PFN256 is allocated then it will get updated head and order at the same time it's refcount becomes 1.

There is corruption and they don't corrupt each other's data.

Quoted 4 lines
Quoted 3 lines

If the allocator is using the struct page memory then step #5 should also clean up the struct page with the allocator data before returning it to the allocator.

Quoted 7 lines
Quoted 2 lines

Do you mean ->folio_free() callback should undo prep_compound_page() instead?

I wouldn't say undo, I was very careful to say it needs to get the struct page memory into a state that the allocator algorithm expects, whatever that means.

Hi Jason,

A lot of back and forth with Zi — if I’m understanding correctly, your suggestion is to just call free_zone_device_folio_prepare() [1] in ->folio_free() if required by the driver. This is the function that puts struct page into a state my allocator expects. That works just fine for me.

Matt

[1] https://patchwork.freedesktop.org/patch/697877/?series=159120&rev=4

Quoted 1 line

Jason

maintainer
#18 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

In reply to Jason Gunthorpe

On Mon, Jan 12, 2026 at 09:45:10AM -0400, Jason Gunthorpe wrote:

Hi, catching up here.

Quoted 33 lines · Zi Yan
Quoted 17 lines · Balbir Singh
Quoted 11 lines · Matthew Wilcox
Quoted 9 lines · Francois Dugast
Quoted 5 lines

The core MM splits the folio before calling folio_free, restoring the zone pages associated with the folio to an initialized state (e.g., non-compound, pgmap valid, etc...). The order argument represents the folio’s order prior to the split which can be used driver side to know how many pages are being freed.

This really feels like the wrong way to fix this problem.

Hi Matthew,

I think the wording is confusing, since the actual issue is that:

Quoted 8 lines

1. zone_device_page_init() calls prep_compound_page() to form a large folio,
2. but free_zone_device_folio() never reverse the course,
3. the undo of prep_compound_page() in free_zone_device_folio() needs to be done before driver callback ->folio_free(), since once ->folio_free() is called, the folio can be reallocated immediately,
4. after the undo of prep_compound_page(), folio_order() can no longer provide the original order information, thus, folio_free() needs that for proper device side ref manipulation.

There is something wrong with the driver if the "folio can be reallocated immediately".

The flow generally expects there to be a driver allocator linked to folio_free()

Quoted 6 lines

1) Allocator finds free memory
2) zone_device_page_init() allocates the memory and makes refcount=1
3) __folio_put() knows the recount 0.
4) free_zone_device_folio() calls folio_free(), but it doesn't actually need to undo prep_compound_page() because *NOTHING* can use the page pointer at this point.

Correct—nothing can use the folio prior to calling folio_free(). Once folio_free() returns, the driver side is free to immediately reallocate the folio (or a subset of its pages).

Quoted 11 lines

5) Driver puts the memory back into the allocator and now #1 can happen. It knows how much memory to put back because folio->order is valid from #2
6) #1 happens again, then #2 happens again and the folio is in the right state for use. The successor #2 fully undoes the work of the predecessor #2.

If you have races where #1 can happen immediately after #3 then the driver design is fundamentally broken and passing around order isn't going to help anything.

The above race does not exist; if it did, I agree we’d be solving nothing here.

Quoted 4 lines

If the allocator is using the struct page memory then step #5 should also clean up the struct page with the allocator data before returning it to the allocator.

We could move the call to free_zone_device_folio_prepare() [1] into the driver-side implementation of ->folio_free() and drop the order argument here. Zi didn’t particularly like that; he preferred calling free_zone_device_folio_prepare() [2] before invoking ->folio_free(), which is why this patch exists.

FWIW, I do not have a strong opinion here—either way works. Xe doesn’t actually need the order regardless of where free_zone_device_folio_prepare() is called, but Nouveau does need the order if free_zone_device_folio_prepare() is called before ->folio_free().

[1] https://patchwork.freedesktop.org/patch/697877/?series=159120&rev=4
[2] https://patchwork.freedesktop.org/patch/697709/?series=159120&rev=3#comment_1282405

Quoted 5 lines

I vaugely remember talking about this before in the context of the Xe driver.. You can't just take an existing VRAM allocator and layer it on top of the folios and have it broadly ignore the folio_free callback.

We are definitely not ignoring the ->folio_free callback—that is the point at which we tell our VRAM allocator (DRM buddy) it is okay to release the allocation and make it available for reuse.

Matt

Quoted 1 line

Jsaon

#19 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 68 lines · Matthew Brost

On Mon, Jan 12, 2026 at 09:45:10AM -0400, Jason Gunthorpe wrote:

Hi, catching up here.

Quoted 33 lines · Zi Yan
Quoted 17 lines · Balbir Singh
Quoted 11 lines · Matthew Wilcox
Quoted 9 lines · Francois Dugast
Quoted 5 lines

The core MM splits the folio before calling folio_free, restoring the zone pages associated with the folio to an initialized state (e.g., non-compound, pgmap valid, etc...). The order argument represents the folio’s order prior to the split which can be used driver side to know how many pages are being freed.

This really feels like the wrong way to fix this problem.

Hi Matthew,

I think the wording is confusing, since the actual issue is that:

Quoted 8 lines

1. zone_device_page_init() calls prep_compound_page() to form a large folio,
2. but free_zone_device_folio() never reverse the course,
3. the undo of prep_compound_page() in free_zone_device_folio() needs to be done before driver callback ->folio_free(), since once ->folio_free() is called, the folio can be reallocated immediately,
4. after the undo of prep_compound_page(), folio_order() can no longer provide the original order information, thus, folio_free() needs that for proper device side ref manipulation.

There is something wrong with the driver if the "folio can be reallocated immediately".

The flow generally expects there to be a driver allocator linked to folio_free()

Quoted 6 lines

1) Allocator finds free memory
2) zone_device_page_init() allocates the memory and makes refcount=1
3) __folio_put() knows the recount 0.
4) free_zone_device_folio() calls folio_free(), but it doesn't actually need to undo prep_compound_page() because *NOTHING* can use the page pointer at this point.

Correct—nothing can use the folio prior to calling folio_free(). Once folio_free() returns, the driver side is free to immediately reallocate the folio (or a subset of its pages).

Quoted 11 lines

5) Driver puts the memory back into the allocator and now #1 can happen. It knows how much memory to put back because folio->order is valid from #2
6) #1 happens again, then #2 happens again and the folio is in the right state for use. The successor #2 fully undoes the work of the predecessor #2.

If you have races where #1 can happen immediately after #3 then the driver design is fundamentally broken and passing around order isn't going to help anything.

The above race does not exist; if it did, I agree we’d be solving nothing here.

Quoted 4 lines

If the allocator is using the struct page memory then step #5 should also clean up the struct page with the allocator data before returning it to the allocator.

Quoted 5 lines

We could move the call to free_zone_device_folio_prepare() [1] into the driver-side implementation of ->folio_free() and drop the order argument here. Zi didn’t particularly like that; he preferred calling free_zone_device_folio_prepare() [2] before invoking ->folio_free(), which is why this patch exists.

On a second thought, if calling free_zone_device_folio_prepare() in ->folio_free() works, feel free to do so.

Quoted 16 lines

FWIW, I do not have a strong opinion here—either way works. Xe doesn’t actually need the order regardless of where free_zone_device_folio_prepare() is called, but Nouveau does need the order if free_zone_device_folio_prepare() is called before ->folio_free().

[1] https://patchwork.freedesktop.org/patch/697877/?series=159120&rev=4
[2] https://patchwork.freedesktop.org/patch/697709/?series=159120&rev=3#comment_1282405

Quoted 5 lines

I vaugely remember talking about this before in the context of the Xe driver.. You can't just take an existing VRAM allocator and layer it on top of the folios and have it broadly ignore the folio_free callback.

Quoted 7 lines

We are definitely not ignoring the ->folio_free callback—that is the point at which we tell our VRAM allocator (DRM buddy) it is okay to release the allocation and make it available for reuse.

Matt

Quoted 1 line

Jsaon

Best Regards,
Yan, Zi

maintainer
#20 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 70 lines · Zi Yan
Quoted 68 lines · Matthew Brost

On Mon, Jan 12, 2026 at 09:45:10AM -0400, Jason Gunthorpe wrote:

Hi, catching up here.

Quoted 33 lines · Zi Yan
Quoted 17 lines · Balbir Singh
Quoted 11 lines · Matthew Wilcox
Quoted 9 lines · Francois Dugast
Quoted 5 lines

The core MM splits the folio before calling folio_free, restoring the zone pages associated with the folio to an initialized state (e.g., non-compound, pgmap valid, etc...). The order argument represents the folio’s order prior to the split which can be used driver side to know how many pages are being freed.

This really feels like the wrong way to fix this problem.

Hi Matthew,

I think the wording is confusing, since the actual issue is that:

Quoted 8 lines

1. zone_device_page_init() calls prep_compound_page() to form a large folio,
2. but free_zone_device_folio() never reverse the course,
3. the undo of prep_compound_page() in free_zone_device_folio() needs to be done before driver callback ->folio_free(), since once ->folio_free() is called, the folio can be reallocated immediately,
4. after the undo of prep_compound_page(), folio_order() can no longer provide the original order information, thus, folio_free() needs that for proper device side ref manipulation.

There is something wrong with the driver if the "folio can be reallocated immediately".

The flow generally expects there to be a driver allocator linked to folio_free()

Quoted 6 lines

1) Allocator finds free memory
2) zone_device_page_init() allocates the memory and makes refcount=1
3) __folio_put() knows the recount 0.
4) free_zone_device_folio() calls folio_free(), but it doesn't actually need to undo prep_compound_page() because *NOTHING* can use the page pointer at this point.

Correct—nothing can use the folio prior to calling folio_free(). Once folio_free() returns, the driver side is free to immediately reallocate the folio (or a subset of its pages).

Quoted 11 lines

5) Driver puts the memory back into the allocator and now #1 can happen. It knows how much memory to put back because folio->order is valid from #2
6) #1 happens again, then #2 happens again and the folio is in the right state for use. The successor #2 fully undoes the work of the predecessor #2.

If you have races where #1 can happen immediately after #3 then the driver design is fundamentally broken and passing around order isn't going to help anything.

The above race does not exist; if it did, I agree we’d be solving nothing here.

Quoted 4 lines

If the allocator is using the struct page memory then step #5 should also clean up the struct page with the allocator data before returning it to the allocator.

Quoted 9 lines
Quoted 5 lines

We could move the call to free_zone_device_folio_prepare() [1] into the driver-side implementation of ->folio_free() and drop the order argument here. Zi didn’t particularly like that; he preferred calling free_zone_device_folio_prepare() [2] before invoking ->folio_free(), which is why this patch exists.

On a second thought, if calling free_zone_device_folio_prepare() in ->folio_free() works, feel free to do so.

+1, testing this change right now and it does indeed work.

Matt

Quoted 27 lines
Quoted 16 lines

FWIW, I do not have a strong opinion here—either way works. Xe doesn’t actually need the order regardless of where free_zone_device_folio_prepare() is called, but Nouveau does need the order if free_zone_device_folio_prepare() is called before ->folio_free().

[1] https://patchwork.freedesktop.org/patch/697877/?series=159120&rev=4
[2] https://patchwork.freedesktop.org/patch/697709/?series=159120&rev=3#comment_1282405

Quoted 5 lines

I vaugely remember talking about this before in the context of the Xe driver.. You can't just take an existing VRAM allocator and layer it on top of the folios and have it broadly ignore the folio_free callback.

Quoted 7 lines

We are definitely not ignoring the ->folio_free callback—that is the point at which we tell our VRAM allocator (DRM buddy) it is okay to release the allocation and make it available for reuse.

Matt

Quoted 1 line

Jsaon

Best Regards,
Yan, Zi

#21 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

On 2026-01-13 at 10:22 +1100, Matthew Brost <[email protected]> wrote...

Quoted 71 lines · Zi Yan
Quoted 70 lines · Matthew Brost
Quoted 69 lines · Jason Gunthorpe

Hi, catching up here.

Quoted 33 lines · Zi Yan
Quoted 17 lines · Balbir Singh
Quoted 11 lines · Matthew Wilcox
Quoted 9 lines · Francois Dugast
Quoted 5 lines

The core MM splits the folio before calling folio_free, restoring the zone pages associated with the folio to an initialized state (e.g., non-compound, pgmap valid, etc...). The order argument represents the folio’s order prior to the split which can be used driver side to know how many pages are being freed.

This really feels like the wrong way to fix this problem.

Hi Matthew,

I think the wording is confusing, since the actual issue is that:

Quoted 8 lines

1. zone_device_page_init() calls prep_compound_page() to form a large folio,
2. but free_zone_device_folio() never reverse the course,
3. the undo of prep_compound_page() in free_zone_device_folio() needs to be done before driver callback ->folio_free(), since once ->folio_free() is called, the folio can be reallocated immediately,
4. after the undo of prep_compound_page(), folio_order() can no longer provide the original order information, thus, folio_free() needs that for proper device side ref manipulation.

There is something wrong with the driver if the "folio can be reallocated immediately".

The flow generally expects there to be a driver allocator linked to folio_free()

Quoted 6 lines

1) Allocator finds free memory
2) zone_device_page_init() allocates the memory and makes refcount=1
3) __folio_put() knows the recount 0.
4) free_zone_device_folio() calls folio_free(), but it doesn't actually need to undo prep_compound_page() because *NOTHING* can use the page pointer at this point.

Correct—nothing can use the folio prior to calling folio_free(). Once folio_free() returns, the driver side is free to immediately reallocate the folio (or a subset of its pages).

Quoted 11 lines

5) Driver puts the memory back into the allocator and now #1 can happen. It knows how much memory to put back because folio->order is valid from #2
6) #1 happens again, then #2 happens again and the folio is in the right state for use. The successor #2 fully undoes the work of the predecessor #2.

If you have races where #1 can happen immediately after #3 then the driver design is fundamentally broken and passing around order isn't going to help anything.

The above race does not exist; if it did, I agree we’d be solving nothing here.

Quoted 4 lines

If the allocator is using the struct page memory then step #5 should also clean up the struct page with the allocator data before returning it to the allocator.

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

We could move the call to free_zone_device_folio_prepare() [1] into the driver-side implementation of ->folio_free() and drop the order argument here. Zi didn’t particularly like that; he preferred calling free_zone_device_folio_prepare() [2] before invoking ->folio_free(), which is why this patch exists.

On a second thought, if calling free_zone_device_folio_prepare() in ->folio_free() works, feel free to do so.

I think making drivers do this is the correct approach and is consistent with what P2PDMA and DAX does. All the interfaces for mapping a ZONE_DEVICE folio currently rely on the driver correctly initialising the folio, so this special case for ZONE_DEVICE_PRIVATE/COHERENT seemed weird to me - they shouldn't rely on the core-mm to do some of the re-initialisation in the free paths.

Also drivers may have different strategies than just resetting everything back to small pages. For example the may choose to only ever allocate large folios making the whole clearing/resetting of folio fields superfluous.

- Alistair

Quoted 31 lines

+1, testing this change right now and it does indeed work.

Matt

Quoted 27 lines
Quoted 16 lines

FWIW, I do not have a strong opinion here—either way works. Xe doesn’t actually need the order regardless of where free_zone_device_folio_prepare() is called, but Nouveau does need the order if free_zone_device_folio_prepare() is called before ->folio_free().

[1] https://patchwork.freedesktop.org/patch/697877/?series=159120&rev=4
[2] https://patchwork.freedesktop.org/patch/697709/?series=159120&rev=3#comment_1282405

Quoted 5 lines

I vaugely remember talking about this before in the context of the Xe driver.. You can't just take an existing VRAM allocator and layer it on top of the folios and have it broadly ignore the folio_free callback.

Quoted 7 lines

We are definitely not ignoring the ->folio_free callback—that is the point at which we tell our VRAM allocator (DRM buddy) it is okay to release the allocation and make it available for reuse.

Matt

Quoted 1 line

Jsaon

Best Regards,
Yan, Zi

#22 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

Quoted 3 lines · Alistair Popple

Also drivers may have different strategies than just resetting everything back to small pages. For example the may choose to only ever allocate large folios making the whole clearing/resetting of folio fields superfluous.

+1

Jason

#23 lore raw

Re: [PATCH v4 1/7] mm/zone_device: Add order argument to folio_free callback

In reply to Zi Yan
Quoted 8 lines · Zi Yan
Quoted 5 lines

We could move the call to free_zone_device_folio_prepare() [1] into the driver-side implementation of ->folio_free() and drop the order argument here. Zi didn’t particularly like that; he preferred calling free_zone_device_folio_prepare() [2] before invoking ->folio_free(), which is why this patch exists.

On a second thought, if calling free_zone_device_folio_prepare() in ->folio_free() works, feel free to do so.

I don't think there is anything "prepare" about free_zone_device_folio_prepare() it effectively zeros the struct page memory - ie undoes some amount of zone_device_page_init() and AFAIK there are only two reasons to do this:

1) It helps catch bugs where things are UAF'ing the folio, now they read back zeros (it also creates bugs where zero might be OK, so you might be better to poison it under a debug flag)

2) It avoids the allocate side having to zero the page memory - and perhaps the allocate side is not doing a good job of this right now but I think you should state a position why it makes more sense for the free side to do this instead of the allocate side.

IOW why should it be mandatory to call free_zone_device_folio_prepare() prior to zone_device_page_init() ?

Certainly if the only reason you are passing the order is because the core code zero'd the order too early, that doesn't make alot of sense.

I think calling the deinit function paired with zone_device_page_init() within the driver does make alot of sense and I see no issue with that. But please name it more sensibly and describe concretely why it should be split up like this.

Because what I see is you write to all the folios on free and then write to them all again on allocation - which is 2x the cost that is probably really needed...

Jason

#24 lore raw

PATCH v4 2/7 mm/zone_device: Add free_zone_device_folio_prepare() helper

In reply to Francois Dugast

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +55 -0

67 lines not on this page · raw message

Signature · 1 line
2.43.0
#25 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

Quoted 98 lines · Francois Dugast

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +40 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 10 lines
mm/memremap.c +10 -0
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

maintainer
#26 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

Quoted 104 lines · Balbir Singh
Quoted 103 lines · Francois Dugast

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +45 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

#27 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

Quoted 115 lines · Matthew Brost
Quoted 104 lines · Balbir Singh
Quoted 103 lines · Francois Dugast

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +45 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

Quoted 9 lines

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

I assume it is still backed by pages that are ref counted? I suspect you'd need to convert one reference count to PMD_ORDER reference counts to make this change work, or are the references not at page granularity?

I followed the code through drm_zdd_pagemap_put() and zdd->refcount seemed like a per folio refcount

Quoted 7 lines

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

Agreed

Quoted 21 lines

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

maintainer
#28 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

Quoted 120 lines · Balbir Singh
Quoted 119 lines · Matthew Brost
Quoted 104 lines · Balbir Singh
Quoted 103 lines · Francois Dugast

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +45 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

Quoted 7 lines
Quoted 5 lines

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

I assume it is still backed by pages that are ref counted? I suspect you'd

Yes.

Quoted 6 lines

need to convert one reference count to PMD_ORDER reference counts to make this change work, or are the references not at page granularity?

I followed the code through drm_zdd_pagemap_put() and zdd->refcount seemed like a per folio refcount

The refcount is incremented by 1 for each call to folio_set_zone_device_data. If we have a 2MB device folio backing a 2MB allocation, the refcount is 1. If we have 512 4KB device pages backing a 2MB allocation, the refcount is 512. The refcount matches the number of folio_free calls we expect to receive for the size of the backing allocation. Right now, in Xe, we allocate either 4k, 64k or 2M but thia all configurable via a table driver side (Xe) in GPU SVM (drm common layer).

Matt

Quoted 32 lines
Quoted 7 lines

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

Agreed

Quoted 21 lines

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

maintainer
#29 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

Quoted 127 lines · Matthew Brost
Quoted 126 lines · Balbir Singh
Quoted 124 lines · Matthew Brost
Quoted 104 lines · Balbir Singh
Quoted 103 lines · Francois Dugast

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +45 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

Quoted 4 lines
Quoted 1 line

I assume it is still backed by pages that are ref counted? I suspect you'd

Yes.

Let me clarify this a bit. We don’t track individual pages in our refcounting; instead, we maintain a reference count for the original allocation (i.e., there are no partial frees of the original allocation). This refcounting is handled in GPU SVM (DRM common), and when the allocation’s refcount reaches zero, GPU SVM calls into the driver to indicate that the memory can be released. In Xe, the backing memory is a TTM BO (think of this as an eviction hook), which is layered on top of DRM Buddy (which actually controls VRAM allocation and can determine device pages from this layer).

I suspect AMD, when using GPU SVM (they have indicated this is the plan), will also use TTM BO here. Nova, assuming they eventually adopt SVM and use GPU SVM, will likely implement something very similar to TTM in Rust, but with DRM Buddy also controlling the actual allocation (they have already written bindings for DRM buddy).

Matt

Quoted 50 lines
Quoted 6 lines

need to convert one reference count to PMD_ORDER reference counts to make this change work, or are the references not at page granularity?

I followed the code through drm_zdd_pagemap_put() and zdd->refcount seemed like a per folio refcount

The refcount is incremented by 1 for each call to folio_set_zone_device_data. If we have a 2MB device folio backing a 2MB allocation, the refcount is 1. If we have 512 4KB device pages backing a 2MB allocation, the refcount is 512. The refcount matches the number of folio_free calls we expect to receive for the size of the backing allocation. Right now, in Xe, we allocate either 4k, 64k or 2M but thia all configurable via a table driver side (Xe) in GPU SVM (drm common layer).

Matt

Quoted 32 lines
Quoted 7 lines

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

Agreed

Quoted 21 lines

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

#30 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

In reply to Matthew Brost

On 2026-01-12 at 12:16 +1100, Matthew Brost <[email protected]> wrote...

Quoted 73 lines · Balbir Singh
Quoted 72 lines · Francois Dugast
Quoted 71 lines

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +13 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
Quoted 8 lines
Quoted 8 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 436

Quoted 8 lines
mm/memremap.c +8 -0
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)

I don't really like the naming here - we're not preparing a folio to be freed, from the core-mm perspective the folio is already free. This is just reinitialising the folio metadata ready for the driver to reuse it, which may actually involve just recreating a compound folio.

So maybe zone_device_folio_reinitialise()? Or would it be possible to roll this into a zone_device_folio_init() type function (similar to zone_device_page_init()) that just deals with everything at allocation time?

Quoted 43 lines
Quoted 24 lines
Quoted 24 lines
mm/memremap.c +24 -0
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

Quoted 6 lines

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

I agree it's probably by coincidence but it is a perfectly valid design to always just (re)allocate at the same order and not worry about having to reinitialise things to different orders.

- Alistair

Quoted 21 lines

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

maintainer
#31 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

Quoted 88 lines · Alistair Popple

On 2026-01-12 at 12:16 +1100, Matthew Brost <[email protected]> wrote...

Quoted 73 lines · Balbir Singh
Quoted 72 lines · Francois Dugast
Quoted 71 lines

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +13 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
Quoted 8 lines
Quoted 8 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 436

Quoted 8 lines
mm/memremap.c +8 -0
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)

I don't really like the naming here - we're not preparing a folio to be freed, from the core-mm perspective the folio is already free. This is just reinitialising the folio metadata ready for the driver to reuse it, which may actually involve just recreating a compound folio.

Quoted 1 line

So maybe zone_device_folio_reinitialise()? Or would it be possible to

zone_device_folio_reinitialise - that works for me... but seem like everyone has a opinion.

Quoted 3 lines

roll this into a zone_device_folio_init() type function (similar to zone_device_page_init()) that just deals with everything at allocation time?

I don’t think doing this at allocation actually works without a big lock per pgmap. Consider the case where a VRAM allocator allocates two distinct subsets of a large folio and you have a multi-threaded GPU page fault handler (Xe does). It’s possible two threads could call zone_device_folio_reinitialise at the same time, racing and causing all sorts of issues. My plan is to just call this function in the driver’s ->folio_free() prior to returning the VRAM allocation to my driver pool.

Quoted 50 lines
Quoted 43 lines
Quoted 24 lines
Quoted 24 lines
mm/memremap.c +24 -0
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

Quoted 6 lines

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

Quoted 4 lines

I agree it's probably by coincidence but it is a perfectly valid design to always just (re)allocate at the same order and not worry about having to reinitialise things to different orders.

I would agree with this statement too — it’s perfectly valid if a driver always wants to (re)allocate at the same order.

Matt

Quoted 23 lines

- Alistair

Quoted 21 lines

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

#32 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

On 2026-01-13 at 11:23 +1100, Matthew Brost <[email protected]> wrote...

Quoted 89 lines · Alistair Popple
Quoted 88 lines

On 2026-01-12 at 12:16 +1100, Matthew Brost <[email protected]> wrote...

Quoted 73 lines · Balbir Singh
Quoted 72 lines · Francois Dugast
Quoted 71 lines

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +13 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
Quoted 8 lines
Quoted 8 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 436

Quoted 8 lines
mm/memremap.c +8 -0
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)

I don't really like the naming here - we're not preparing a folio to be freed, from the core-mm perspective the folio is already free. This is just reinitialising the folio metadata ready for the driver to reuse it, which may actually involve just recreating a compound folio.

Quoted 4 lines
Quoted 1 line

So maybe zone_device_folio_reinitialise()? Or would it be possible to

zone_device_folio_reinitialise - that works for me... but seem like everyone has a opinion.

Well of course :) There are only two hard problems in programming and I forget the other one. But I didn't want to just say I don't like free_zone_device_folio_prepare() without offering an alternative, I'd be open to others.

Quoted 5 lines
Quoted 4 lines

roll this into a zone_device_folio_init() type function (similar to zone_device_page_init()) that just deals with everything at allocation time?

Quoted 7 lines

I don’t think doing this at allocation actually works without a big lock per pgmap. Consider the case where a VRAM allocator allocates two distinct subsets of a large folio and you have a multi-threaded GPU page fault handler (Xe does). It’s possible two threads could call zone_device_folio_reinitialise at the same time, racing and causing all sorts of issues. My plan is to just call this function in the driver’s ->folio_free() prior to returning the VRAM allocation to my driver pool.

This doesn't make sense to me (at least as someone who doesn't know DRM SVM intimately) - the folio metadata initialisation should only happen after the VRAM allocation has occured.

IOW the VRAM allocator needs to deal with the locking, once you have the VRAM physical range you just initialise the folio/pages associated with that range with zone_device_folio_(re)initialise() and you're done.

Is the concern that reinitialisation would touch pages outside of the allocated VRAM range if it was previously a large folio?

Quoted 83 lines
Quoted 50 lines
Quoted 43 lines
Quoted 24 lines
Quoted 24 lines
mm/memremap.c +24 -0
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

Quoted 6 lines

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

Quoted 4 lines

I agree it's probably by coincidence but it is a perfectly valid design to always just (re)allocate at the same order and not worry about having to reinitialise things to different orders.

I would agree with this statement too — it’s perfectly valid if a driver always wants to (re)allocate at the same order.

Matt

Quoted 23 lines

- Alistair

Quoted 21 lines

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

maintainer
#33 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

Quoted 92 lines · Alistair Popple

On 2026-01-13 at 11:23 +1100, Matthew Brost <[email protected]> wrote...

Quoted 91 lines · Alistair Popple
Quoted 89 lines

On 2026-01-12 at 12:16 +1100, Matthew Brost <[email protected]> wrote...

Quoted 73 lines · Balbir Singh
Quoted 72 lines · Francois Dugast
Quoted 71 lines

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +13 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
Quoted 8 lines
Quoted 8 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 436

Quoted 8 lines
mm/memremap.c +8 -0
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)

I don't really like the naming here - we're not preparing a folio to be freed, from the core-mm perspective the folio is already free. This is just reinitialising the folio metadata ready for the driver to reuse it, which may actually involve just recreating a compound folio.

So maybe zone_device_folio_reinitialise()? Or would it be possible to

Quoted 8 lines
Quoted 2 lines

zone_device_folio_reinitialise - that works for me... but seem like everyone has a opinion.

Well of course :) There are only two hard problems in programming and I forget the other one. But I didn't want to just say I don't like free_zone_device_folio_prepare() without offering an alternative, I'd be open to others.

zone_device_folio_reinitialise is good with me.

Quoted 13 lines
Quoted 5 lines
Quoted 4 lines

roll this into a zone_device_folio_init() type function (similar to zone_device_page_init()) that just deals with everything at allocation time?

Quoted 7 lines

I don’t think doing this at allocation actually works without a big lock per pgmap. Consider the case where a VRAM allocator allocates two distinct subsets of a large folio and you have a multi-threaded GPU page fault handler (Xe does). It’s possible two threads could call zone_device_folio_reinitialise at the same time, racing and causing all sorts of issues. My plan is to just call this function in the driver’s ->folio_free() prior to returning the VRAM allocation to my driver pool.

Quoted 8 lines

This doesn't make sense to me (at least as someone who doesn't know DRM SVM intimately) - the folio metadata initialisation should only happen after the VRAM allocation has occured.

IOW the VRAM allocator needs to deal with the locking, once you have the VRAM physical range you just initialise the folio/pages associated with that range with zone_device_folio_(re)initialise() and you're done.

Our VRAM allocator does have locking (via DRM buddy), but that layer doesn’t have visibility into the folio or its pages. By the time we handle the folio/pages in the GPU fault handler, there are no global locks preventing two GPU faults from each having, say, 16 pages from the same order-9 folio. I believe if both threads call zone_device_folio_reinitialise/init at the same time, bad things could happen.

Quoted 2 lines

Is the concern that reinitialisation would touch pages outside of the allocated VRAM range if it was previously a large folio?

No just two threads call zone_device_folio_reinitialise/init at the same time, on the same folio.

If we call zone_device_folio_reinitialise in ->folio_free this problem goes away. We could solve this with split_lock or something but I'd prefer not to add lock for this (although some of prior revs did do this, maybe we will revist this later).

Anyways - this falls in driver detail / choice IMO.

Matt

Quoted 84 lines
Quoted 84 lines
Quoted 51 lines
Quoted 44 lines
Quoted 25 lines
Quoted 25 lines
mm/memremap.c +24 -0
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

Quoted 6 lines

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

Quoted 4 lines

I agree it's probably by coincidence but it is a perfectly valid design to always just (re)allocate at the same order and not worry about having to reinitialise things to different orders.

I would agree with this statement too — it’s perfectly valid if a driver always wants to (re)allocate at the same order.

Matt

Quoted 23 lines

- Alistair

Quoted 21 lines

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

#34 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

On 2026-01-13 at 12:07 +1100, Matthew Brost <[email protected]> wrote...

Quoted 121 lines · Alistair Popple
Quoted 92 lines

On 2026-01-13 at 11:23 +1100, Matthew Brost <[email protected]> wrote...

Quoted 91 lines · Alistair Popple
Quoted 89 lines

On 2026-01-12 at 12:16 +1100, Matthew Brost <[email protected]> wrote...

Quoted 73 lines · Balbir Singh
Quoted 72 lines · Francois Dugast
Quoted 71 lines

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +13 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
Quoted 8 lines
Quoted 8 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 436

Quoted 8 lines
mm/memremap.c +8 -0
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)

I don't really like the naming here - we're not preparing a folio to be freed, from the core-mm perspective the folio is already free. This is just reinitialising the folio metadata ready for the driver to reuse it, which may actually involve just recreating a compound folio.

So maybe zone_device_folio_reinitialise()? Or would it be possible to

Quoted 8 lines
Quoted 2 lines

zone_device_folio_reinitialise - that works for me... but seem like everyone has a opinion.

Well of course :) There are only two hard problems in programming and I forget the other one. But I didn't want to just say I don't like free_zone_device_folio_prepare() without offering an alternative, I'd be open to others.

zone_device_folio_reinitialise is good with me.

Quoted 17 lines
Quoted 5 lines
Quoted 4 lines

roll this into a zone_device_folio_init() type function (similar to zone_device_page_init()) that just deals with everything at allocation time?

Quoted 7 lines

I don’t think doing this at allocation actually works without a big lock per pgmap. Consider the case where a VRAM allocator allocates two distinct subsets of a large folio and you have a multi-threaded GPU page fault handler (Xe does). It’s possible two threads could call zone_device_folio_reinitialise at the same time, racing and causing all sorts of issues. My plan is to just call this function in the driver’s ->folio_free() prior to returning the VRAM allocation to my driver pool.

This doesn't make sense to me (at least as someone who doesn't know DRM SVM intimately) - the folio metadata initialisation should only happen after the VRAM allocation has occured.

Quoted 6 lines
Quoted 4 lines

IOW the VRAM allocator needs to deal with the locking, once you have the VRAM physical range you just initialise the folio/pages associated with that range with zone_device_folio_(re)initialise() and you're done.

Our VRAM allocator does have locking (via DRM buddy), but that layer

I mean I assumed it did :-)

Quoted 6 lines

doesn’t have visibility into the folio or its pages. By the time we handle the folio/pages in the GPU fault handler, there are no global locks preventing two GPU faults from each having, say, 16 pages from the same order-9 folio. I believe if both threads call zone_device_folio_reinitialise/init at the same time, bad things could happen.

This is confusing to me. If you are getting a GPU fault it implies no page is mapped at a particular virtual address. The normal process (or at least the process I'm familiar with) for handling this is to allocate and map a page at the faulting virtual address. So in the scenario of two GPUs faulting on the same VA each thread would allocate VRAM using DRM buddy, presumably getting different physical pages, and so the zone_device_folio_init() call would be to different folios/pages.

Then eventually one thread would succeed in creating the mapping from VA->VRAM and the losing thread would free the VRAM allocation back to DRM buddy.

So I'm a bit confused by the above statement that two GPUs faults could each have the same pages or be calling zone_device_folio_init() on the same pages. How would that happen?

Quoted 6 lines
Quoted 2 lines

Is the concern that reinitialisation would touch pages outside of the allocated VRAM range if it was previously a large folio?

No just two threads call zone_device_folio_reinitialise/init at the same time, on the same folio.

Quoted 6 lines

If we call zone_device_folio_reinitialise in ->folio_free this problem goes away. We could solve this with split_lock or something but I'd prefer not to add lock for this (although some of prior revs did do this, maybe we will revist this later).

Anyways - this falls in driver detail / choice IMO.

Agreed.

- Alistair

Quoted 86 lines

Matt

Quoted 84 lines
Quoted 84 lines
Quoted 51 lines
Quoted 44 lines
Quoted 25 lines
Quoted 25 lines
mm/memremap.c +24 -0
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

Quoted 6 lines

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

Quoted 4 lines

I agree it's probably by coincidence but it is a perfectly valid design to always just (re)allocate at the same order and not worry about having to reinitialise things to different orders.

I would agree with this statement too — it’s perfectly valid if a driver always wants to (re)allocate at the same order.

Matt

Quoted 23 lines

- Alistair

Quoted 21 lines

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

maintainer
#35 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

Quoted 138 lines · Alistair Popple

On 2026-01-13 at 12:07 +1100, Matthew Brost <[email protected]> wrote...

Quoted 121 lines · Alistair Popple
Quoted 92 lines

On 2026-01-13 at 11:23 +1100, Matthew Brost <[email protected]> wrote...

Quoted 91 lines · Alistair Popple
Quoted 89 lines

On 2026-01-12 at 12:16 +1100, Matthew Brost <[email protected]> wrote...

Quoted 73 lines · Balbir Singh
Quoted 72 lines · Francois Dugast
Quoted 71 lines

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +13 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
Quoted 8 lines
Quoted 8 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 436

Quoted 8 lines
mm/memremap.c +8 -0
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)

I don't really like the naming here - we're not preparing a folio to be freed, from the core-mm perspective the folio is already free. This is just reinitialising the folio metadata ready for the driver to reuse it, which may actually involve just recreating a compound folio.

So maybe zone_device_folio_reinitialise()? Or would it be possible to

Quoted 8 lines
Quoted 2 lines

zone_device_folio_reinitialise - that works for me... but seem like everyone has a opinion.

Well of course :) There are only two hard problems in programming and I forget the other one. But I didn't want to just say I don't like free_zone_device_folio_prepare() without offering an alternative, I'd be open to others.

zone_device_folio_reinitialise is good with me.

Quoted 17 lines
Quoted 5 lines
Quoted 4 lines

roll this into a zone_device_folio_init() type function (similar to zone_device_page_init()) that just deals with everything at allocation time?

Quoted 7 lines

I don’t think doing this at allocation actually works without a big lock per pgmap. Consider the case where a VRAM allocator allocates two distinct subsets of a large folio and you have a multi-threaded GPU page fault handler (Xe does). It’s possible two threads could call zone_device_folio_reinitialise at the same time, racing and causing all sorts of issues. My plan is to just call this function in the driver’s ->folio_free() prior to returning the VRAM allocation to my driver pool.

This doesn't make sense to me (at least as someone who doesn't know DRM SVM intimately) - the folio metadata initialisation should only happen after the VRAM allocation has occured.

Quoted 6 lines
Quoted 4 lines

IOW the VRAM allocator needs to deal with the locking, once you have the VRAM physical range you just initialise the folio/pages associated with that range with zone_device_folio_(re)initialise() and you're done.

Our VRAM allocator does have locking (via DRM buddy), but that layer

I mean I assumed it did :-)

Quoted 6 lines

doesn’t have visibility into the folio or its pages. By the time we handle the folio/pages in the GPU fault handler, there are no global locks preventing two GPU faults from each having, say, 16 pages from the same order-9 folio. I believe if both threads call zone_device_folio_reinitialise/init at the same time, bad things could happen.

Quoted 5 lines

This is confusing to me. If you are getting a GPU fault it implies no page is mapped at a particular virtual address. The normal process (or at least the process I'm familiar with) for handling this is to allocate and map a page at the faulting virtual address. So in the scenario of two GPUs faulting on the same VA each thread would allocate VRAM using DRM buddy, presumably getting

Different VAs.

Quoted 1 line

different physical pages, and so the zone_device_folio_init() call would be to

Yes, different physical pages but same folio which is possible if it hasn't been split yet (i.e., both threads a different subset of pages in the same folio, try to split at the same time and boom something bad happens).

Quoted 9 lines

different folios/pages.

Then eventually one thread would succeed in creating the mapping from VA->VRAM and the losing thread would free the VRAM allocation back to DRM buddy.

So I'm a bit confused by the above statement that two GPUs faults could each have the same pages or be calling zone_device_folio_init() on the same pages. How would that happen?

See above. I hope my above statements make this clear.

Matt

Quoted 103 lines
Quoted 6 lines
Quoted 2 lines

Is the concern that reinitialisation would touch pages outside of the allocated VRAM range if it was previously a large folio?

No just two threads call zone_device_folio_reinitialise/init at the same time, on the same folio.

Quoted 6 lines

If we call zone_device_folio_reinitialise in ->folio_free this problem goes away. We could solve this with split_lock or something but I'd prefer not to add lock for this (although some of prior revs did do this, maybe we will revist this later).

Anyways - this falls in driver detail / choice IMO.

Agreed.

- Alistair

Quoted 86 lines

Matt

Quoted 84 lines
Quoted 84 lines
Quoted 51 lines
Quoted 44 lines
Quoted 25 lines
Quoted 25 lines
mm/memremap.c +24 -0
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

Quoted 6 lines

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

Quoted 4 lines

I agree it's probably by coincidence but it is a perfectly valid design to always just (re)allocate at the same order and not worry about having to reinitialise things to different orders.

I would agree with this statement too — it’s perfectly valid if a driver always wants to (re)allocate at the same order.

Matt

Quoted 23 lines

- Alistair

Quoted 21 lines

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

#36 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

On 2026-01-13 at 12:40 +1100, Matthew Brost <[email protected]> wrote...

Quoted 145 lines · Alistair Popple
Quoted 138 lines

On 2026-01-13 at 12:07 +1100, Matthew Brost <[email protected]> wrote...

Quoted 121 lines · Alistair Popple
Quoted 92 lines

On 2026-01-13 at 11:23 +1100, Matthew Brost <[email protected]> wrote...

Quoted 91 lines · Alistair Popple
Quoted 89 lines

On 2026-01-12 at 12:16 +1100, Matthew Brost <[email protected]> wrote...

Quoted 73 lines · Balbir Singh
Quoted 72 lines · Francois Dugast
Quoted 71 lines

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +13 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
Quoted 8 lines
Quoted 8 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 436

Quoted 8 lines
mm/memremap.c +8 -0
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)

I don't really like the naming here - we're not preparing a folio to be freed, from the core-mm perspective the folio is already free. This is just reinitialising the folio metadata ready for the driver to reuse it, which may actually involve just recreating a compound folio.

So maybe zone_device_folio_reinitialise()? Or would it be possible to

Quoted 8 lines
Quoted 2 lines

zone_device_folio_reinitialise - that works for me... but seem like everyone has a opinion.

Well of course :) There are only two hard problems in programming and I forget the other one. But I didn't want to just say I don't like free_zone_device_folio_prepare() without offering an alternative, I'd be open to others.

zone_device_folio_reinitialise is good with me.

Quoted 17 lines
Quoted 5 lines
Quoted 4 lines

roll this into a zone_device_folio_init() type function (similar to zone_device_page_init()) that just deals with everything at allocation time?

Quoted 7 lines

I don’t think doing this at allocation actually works without a big lock per pgmap. Consider the case where a VRAM allocator allocates two distinct subsets of a large folio and you have a multi-threaded GPU page fault handler (Xe does). It’s possible two threads could call zone_device_folio_reinitialise at the same time, racing and causing all sorts of issues. My plan is to just call this function in the driver’s ->folio_free() prior to returning the VRAM allocation to my driver pool.

This doesn't make sense to me (at least as someone who doesn't know DRM SVM intimately) - the folio metadata initialisation should only happen after the VRAM allocation has occured.

Quoted 6 lines
Quoted 4 lines

IOW the VRAM allocator needs to deal with the locking, once you have the VRAM physical range you just initialise the folio/pages associated with that range with zone_device_folio_(re)initialise() and you're done.

Our VRAM allocator does have locking (via DRM buddy), but that layer

I mean I assumed it did :-)

Quoted 6 lines

doesn’t have visibility into the folio or its pages. By the time we handle the folio/pages in the GPU fault handler, there are no global locks preventing two GPU faults from each having, say, 16 pages from the same order-9 folio. I believe if both threads call zone_device_folio_reinitialise/init at the same time, bad things could happen.

Quoted 5 lines

This is confusing to me. If you are getting a GPU fault it implies no page is mapped at a particular virtual address. The normal process (or at least the process I'm familiar with) for handling this is to allocate and map a page at the faulting virtual address. So in the scenario of two GPUs faulting on the same VA each thread would allocate VRAM using DRM buddy, presumably getting

Quoted 8 lines

Different VAs.

Quoted 1 line

different physical pages, and so the zone_device_folio_init() call would be to

Yes, different physical pages but same folio which is possible if it hasn't been split yet (i.e., both threads a different subset of pages in the same folio, try to split at the same time and boom something bad happens).

So is you're concern something like this:

1) There is a free folio A of order 9, starting at physical address 0.
2) You have two GPU faults, both call into DRM Buddy to get a 4K page .
3) GPU 1 gets allocated physical address 0 (ie. folio_page(folio_A, 0))
4) GPU 2 gets allocated physical address 0x1000 (ie. folio_page(folio_A, 1))
5) Both call zone_device_folio_init() which splits the folio, meaning the previous step would touch folio_page(folio_A, 0) even though it has not been allocated physical address 0.

If that's the concern then what I'm saying (and what I think Jason was getting at) is that (5) above is wrong - the driver doesn't (and shouldn't) update the compound head (ie. folio_page(folio_a, 0)) - zone_device_folio_init() should just overwrite all the metadata in the struct pages it has been allocated. We're not really splitting folios, because it makes no sense to talk of splitting a free folio which I think is why some core-mm people took notice.

Also It doesn't matter that you are leaving the previous compound head struct pages in some weird state, the core-mm doesn't care about them anymore and the struct page/folio is only used by core-mm not drivers. They will get properly (re)initialised when needed for the core-mm in zone_device_folio_init() which in this case would happen in step 3.

- Alistair

Quoted 117 lines
Quoted 9 lines

different folios/pages.

Then eventually one thread would succeed in creating the mapping from VA->VRAM and the losing thread would free the VRAM allocation back to DRM buddy.

So I'm a bit confused by the above statement that two GPUs faults could each have the same pages or be calling zone_device_folio_init() on the same pages. How would that happen?

See above. I hope my above statements make this clear.

Matt

Quoted 103 lines
Quoted 6 lines
Quoted 2 lines

Is the concern that reinitialisation would touch pages outside of the allocated VRAM range if it was previously a large folio?

No just two threads call zone_device_folio_reinitialise/init at the same time, on the same folio.

Quoted 6 lines

If we call zone_device_folio_reinitialise in ->folio_free this problem goes away. We could solve this with split_lock or something but I'd prefer not to add lock for this (although some of prior revs did do this, maybe we will revist this later).

Anyways - this falls in driver detail / choice IMO.

Agreed.

- Alistair

Quoted 86 lines

Matt

Quoted 84 lines
Quoted 84 lines
Quoted 51 lines
Quoted 44 lines
Quoted 25 lines
Quoted 25 lines
mm/memremap.c +24 -0
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

Quoted 6 lines

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

Quoted 4 lines

I agree it's probably by coincidence but it is a perfectly valid design to always just (re)allocate at the same order and not worry about having to reinitialise things to different orders.

I would agree with this statement too — it’s perfectly valid if a driver always wants to (re)allocate at the same order.

Matt

Quoted 23 lines

- Alistair

Quoted 21 lines

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

maintainer
#37 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

Quoted 157 lines · Alistair Popple

On 2026-01-13 at 12:40 +1100, Matthew Brost <[email protected]> wrote...

Quoted 145 lines · Alistair Popple
Quoted 138 lines

On 2026-01-13 at 12:07 +1100, Matthew Brost <[email protected]> wrote...

Quoted 121 lines · Alistair Popple
Quoted 92 lines

On 2026-01-13 at 11:23 +1100, Matthew Brost <[email protected]> wrote...

Quoted 91 lines · Alistair Popple
Quoted 89 lines

On 2026-01-12 at 12:16 +1100, Matthew Brost <[email protected]> wrote...

Quoted 73 lines · Balbir Singh
Quoted 72 lines · Francois Dugast
Quoted 71 lines

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +13 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
Quoted 8 lines
Quoted 8 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 436

Quoted 8 lines
mm/memremap.c +8 -0
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)

I don't really like the naming here - we're not preparing a folio to be freed, from the core-mm perspective the folio is already free. This is just reinitialising the folio metadata ready for the driver to reuse it, which may actually involve just recreating a compound folio.

So maybe zone_device_folio_reinitialise()? Or would it be possible to

Quoted 8 lines
Quoted 2 lines

zone_device_folio_reinitialise - that works for me... but seem like everyone has a opinion.

Well of course :) There are only two hard problems in programming and I forget the other one. But I didn't want to just say I don't like free_zone_device_folio_prepare() without offering an alternative, I'd be open to others.

zone_device_folio_reinitialise is good with me.

Quoted 17 lines
Quoted 5 lines
Quoted 4 lines

roll this into a zone_device_folio_init() type function (similar to zone_device_page_init()) that just deals with everything at allocation time?

Quoted 7 lines

I don’t think doing this at allocation actually works without a big lock per pgmap. Consider the case where a VRAM allocator allocates two distinct subsets of a large folio and you have a multi-threaded GPU page fault handler (Xe does). It’s possible two threads could call zone_device_folio_reinitialise at the same time, racing and causing all sorts of issues. My plan is to just call this function in the driver’s ->folio_free() prior to returning the VRAM allocation to my driver pool.

This doesn't make sense to me (at least as someone who doesn't know DRM SVM intimately) - the folio metadata initialisation should only happen after the VRAM allocation has occured.

Quoted 6 lines
Quoted 4 lines

IOW the VRAM allocator needs to deal with the locking, once you have the VRAM physical range you just initialise the folio/pages associated with that range with zone_device_folio_(re)initialise() and you're done.

Our VRAM allocator does have locking (via DRM buddy), but that layer

I mean I assumed it did :-)

Quoted 6 lines

doesn’t have visibility into the folio or its pages. By the time we handle the folio/pages in the GPU fault handler, there are no global locks preventing two GPU faults from each having, say, 16 pages from the same order-9 folio. I believe if both threads call zone_device_folio_reinitialise/init at the same time, bad things could happen.

Quoted 5 lines

This is confusing to me. If you are getting a GPU fault it implies no page is mapped at a particular virtual address. The normal process (or at least the process I'm familiar with) for handling this is to allocate and map a page at the faulting virtual address. So in the scenario of two GPUs faulting on the same VA each thread would allocate VRAM using DRM buddy, presumably getting

Quoted 8 lines

Different VAs.

Quoted 1 line

different physical pages, and so the zone_device_folio_init() call would be to

Yes, different physical pages but same folio which is possible if it hasn't been split yet (i.e., both threads a different subset of pages in the same folio, try to split at the same time and boom something bad happens).

So is you're concern something like this:

Quoted 8 lines

1) There is a free folio A of order 9, starting at physical address 0.
2) You have two GPU faults, both call into DRM Buddy to get a 4K page .
3) GPU 1 gets allocated physical address 0 (ie. folio_page(folio_A, 0))
4) GPU 2 gets allocated physical address 0x1000 (ie. folio_page(folio_A, 1))
5) Both call zone_device_folio_init() which splits the folio, meaning the previous step would touch folio_page(folio_A, 0) even though it has not been allocated physical address 0.

Yes.

Quoted 7 lines

If that's the concern then what I'm saying (and what I think Jason was getting at) is that (5) above is wrong - the driver doesn't (and shouldn't) update the compound head (ie. folio_page(folio_a, 0)) - zone_device_folio_init() should just overwrite all the metadata in the struct pages it has been allocated. We're not really splitting folios, because it makes no sense to talk of splitting a free folio which I think is why some core-mm people took notice.

Quoted 6 lines

Also It doesn't matter that you are leaving the previous compound head struct pages in some weird state, the core-mm doesn't care about them anymore and the struct page/folio is only used by core-mm not drivers. They will get properly (re)initialised when needed for the core-mm in zone_device_folio_init() which in this case would happen in step 3.

Something like this should work too. I started implementing it on my side earlier today, but of course, I was hitting hangs. From an API point of view, zone_device_folio_init would need to be updated to accept a pgmap argument. In this example, folio_page(folio_A, 1) wouldn’t have a valid pgmap to retrieve. It could look at the folio’s pgmap, but that also seems like it could race under the right conditions.

Let me see what this looks like and whether I can get it working.

Matt

Quoted 119 lines

- Alistair

Quoted 117 lines
Quoted 9 lines

different folios/pages.

Then eventually one thread would succeed in creating the mapping from VA->VRAM and the losing thread would free the VRAM allocation back to DRM buddy.

So I'm a bit confused by the above statement that two GPUs faults could each have the same pages or be calling zone_device_folio_init() on the same pages. How would that happen?

See above. I hope my above statements make this clear.

Matt

Quoted 103 lines
Quoted 6 lines
Quoted 2 lines

Is the concern that reinitialisation would touch pages outside of the allocated VRAM range if it was previously a large folio?

No just two threads call zone_device_folio_reinitialise/init at the same time, on the same folio.

Quoted 6 lines

If we call zone_device_folio_reinitialise in ->folio_free this problem goes away. We could solve this with split_lock or something but I'd prefer not to add lock for this (although some of prior revs did do this, maybe we will revist this later).

Anyways - this falls in driver detail / choice IMO.

Agreed.

- Alistair

Quoted 86 lines

Matt

Quoted 84 lines
Quoted 84 lines
Quoted 51 lines
Quoted 44 lines
Quoted 25 lines
Quoted 25 lines
mm/memremap.c +24 -0
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

Quoted 6 lines

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

Quoted 4 lines

I agree it's probably by coincidence but it is a perfectly valid design to always just (re)allocate at the same order and not worry about having to reinitialise things to different orders.

I would agree with this statement too — it’s perfectly valid if a driver always wants to (re)allocate at the same order.

Matt

Quoted 23 lines

- Alistair

Quoted 21 lines

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

#38 lore raw

Re: [PATCH v4 2/7] mm/zone_device: Add free_zone_device_folio_prepare() helper

On 2026-01-13 at 13:16 +1100, Matthew Brost <[email protected]> wrote...

Quoted 183 lines · Alistair Popple
Quoted 157 lines

On 2026-01-13 at 12:40 +1100, Matthew Brost <[email protected]> wrote...

Quoted 145 lines · Alistair Popple
Quoted 138 lines

On 2026-01-13 at 12:07 +1100, Matthew Brost <[email protected]> wrote...

Quoted 121 lines · Alistair Popple
Quoted 92 lines

On 2026-01-13 at 11:23 +1100, Matthew Brost <[email protected]> wrote...

Quoted 91 lines · Alistair Popple
Quoted 89 lines

On 2026-01-12 at 12:16 +1100, Matthew Brost <[email protected]> wrote...

Quoted 73 lines · Balbir Singh
Quoted 72 lines · Francois Dugast
Quoted 71 lines

From: Matthew Brost <[email protected]>

Add free_zone_device_folio_prepare(), a helper that restores large ZONE_DEVICE folios to a sane, initial state before freeing them.

Compound ZONE_DEVICE folios overwrite per-page state (e.g. pgmap and compound metadata). Before returning such pages to the device pgmap allocator, each constituent page must be reset to a standalone ZONE_DEVICE folio with a valid pgmap and no compound state.

Use this helper prior to folio_free() for device-private and device-coherent folios to ensure consistent device page state for subsequent allocations.

Fixes d245f9b4ab80 ("mm/zone_device: support large zone device private folios")
Cc Zi Yan <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Alistair Popple <[email protected]>
---
 include/linux/memremap.h |  1 +
 mm/memremap.c            | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
include/linux/memremap.h +1 -0
index 97fcffeb1c1e..88e1d4707296 100644
@@ -230,6 +230,7 @@ static inline bool is_fsdax_page(const struct page *page)
 
 #ifdef CONFIG_ZONE_DEVICE
 void zone_device_page_init(struct page *page, unsigned int order);
+void free_zone_device_folio_prepare(struct folio *folio);
 void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 void memunmap_pages(struct dev_pagemap *pgmap);
 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
mm/memremap.c +13 -0
index 39dc4bd190d0..375a61e18858 100644
@@ -413,6 +413,60 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(get_dev_pagemap);
 
+/**
+ * free_zone_device_folio_prepare() - Prepare a ZONE_DEVICE folio for freeing.
+ * @folio: ZONE_DEVICE folio to prepare for release.
+ *
+ * ZONE_DEVICE pages/folios (e.g., device-private memory or fsdax-backed pages)
+ * can be compound. When freeing a compound ZONE_DEVICE folio, the tail pages
+ * must be restored to a sane ZONE_DEVICE state before they are released.
+ *
+ * This helper:
+ *   - Clears @folio->mapping and, for compound folios, clears each page's
+ *     compound-head state (ClearPageHead()/clear_compound_head()).
+ *   - Resets the compound order metadata (folio_reset_order()) and then
+ *     initializes each constituent page as a standalone ZONE_DEVICE folio:
Quoted 8 lines
Quoted 8 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 436

Quoted 8 lines
mm/memremap.c +8 -0
+ *       * clears ->mapping
+ *       * restores ->pgmap (prep_compound_page() overwrites it)
+ *       * clears ->share (only relevant for fsdax; unused for device-private)
+ *
+ * If @folio is order-0, only the mapping is cleared and no further work is
+ * required.
+ */
+void free_zone_device_folio_prepare(struct folio *folio)

I don't really like the naming here - we're not preparing a folio to be freed, from the core-mm perspective the folio is already free. This is just reinitialising the folio metadata ready for the driver to reuse it, which may actually involve just recreating a compound folio.

So maybe zone_device_folio_reinitialise()? Or would it be possible to

Quoted 8 lines
Quoted 2 lines

zone_device_folio_reinitialise - that works for me... but seem like everyone has a opinion.

Well of course :) There are only two hard problems in programming and I forget the other one. But I didn't want to just say I don't like free_zone_device_folio_prepare() without offering an alternative, I'd be open to others.

zone_device_folio_reinitialise is good with me.

Quoted 17 lines
Quoted 5 lines
Quoted 4 lines

roll this into a zone_device_folio_init() type function (similar to zone_device_page_init()) that just deals with everything at allocation time?

Quoted 7 lines

I don’t think doing this at allocation actually works without a big lock per pgmap. Consider the case where a VRAM allocator allocates two distinct subsets of a large folio and you have a multi-threaded GPU page fault handler (Xe does). It’s possible two threads could call zone_device_folio_reinitialise at the same time, racing and causing all sorts of issues. My plan is to just call this function in the driver’s ->folio_free() prior to returning the VRAM allocation to my driver pool.

This doesn't make sense to me (at least as someone who doesn't know DRM SVM intimately) - the folio metadata initialisation should only happen after the VRAM allocation has occured.

Quoted 6 lines
Quoted 4 lines

IOW the VRAM allocator needs to deal with the locking, once you have the VRAM physical range you just initialise the folio/pages associated with that range with zone_device_folio_(re)initialise() and you're done.

Our VRAM allocator does have locking (via DRM buddy), but that layer

I mean I assumed it did :-)

Quoted 6 lines

doesn’t have visibility into the folio or its pages. By the time we handle the folio/pages in the GPU fault handler, there are no global locks preventing two GPU faults from each having, say, 16 pages from the same order-9 folio. I believe if both threads call zone_device_folio_reinitialise/init at the same time, bad things could happen.

Quoted 5 lines

This is confusing to me. If you are getting a GPU fault it implies no page is mapped at a particular virtual address. The normal process (or at least the process I'm familiar with) for handling this is to allocate and map a page at the faulting virtual address. So in the scenario of two GPUs faulting on the same VA each thread would allocate VRAM using DRM buddy, presumably getting

Quoted 8 lines

Different VAs.

Quoted 1 line

different physical pages, and so the zone_device_folio_init() call would be to

Yes, different physical pages but same folio which is possible if it hasn't been split yet (i.e., both threads a different subset of pages in the same folio, try to split at the same time and boom something bad happens).

So is you're concern something like this:

Quoted 8 lines

1) There is a free folio A of order 9, starting at physical address 0.
2) You have two GPU faults, both call into DRM Buddy to get a 4K page .
3) GPU 1 gets allocated physical address 0 (ie. folio_page(folio_A, 0))
4) GPU 2 gets allocated physical address 0x1000 (ie. folio_page(folio_A, 1))
5) Both call zone_device_folio_init() which splits the folio, meaning the previous step would touch folio_page(folio_A, 0) even though it has not been allocated physical address 0.

Yes.

Quoted 7 lines

If that's the concern then what I'm saying (and what I think Jason was getting at) is that (5) above is wrong - the driver doesn't (and shouldn't) update the compound head (ie. folio_page(folio_a, 0)) - zone_device_folio_init() should just overwrite all the metadata in the struct pages it has been allocated. We're not really splitting folios, because it makes no sense to talk of splitting a free folio which I think is why some core-mm people took notice.

Quoted 6 lines

Also It doesn't matter that you are leaving the previous compound head struct pages in some weird state, the core-mm doesn't care about them anymore and the struct page/folio is only used by core-mm not drivers. They will get properly (re)initialised when needed for the core-mm in zone_device_folio_init() which in this case would happen in step 3.

Quoted 6 lines

Something like this should work too. I started implementing it on my side earlier today, but of course, I was hitting hangs. From an API point of view, zone_device_folio_init would need to be updated to accept a pgmap argument. In this example, folio_page(folio_A, 1) wouldn’t have a valid pgmap to retrieve. It could look at the folio’s pgmap, but that also seems like it could race under the right conditions.

I think passing a pgmap argument in would be fine - it allows us to maintain the concept that zone_device_folio_init() does exactly what it says on the tin. That is it initialises a ZONE_DEVICE folio ready for use by the core-mm without placing any assumptions or restrictions on the current state of the folio/page structs.

Quoted 123 lines

Let me see what this looks like and whether I can get it working.

Matt

Quoted 119 lines

- Alistair

Quoted 117 lines
Quoted 9 lines

different folios/pages.

Then eventually one thread would succeed in creating the mapping from VA->VRAM and the losing thread would free the VRAM allocation back to DRM buddy.

So I'm a bit confused by the above statement that two GPUs faults could each have the same pages or be calling zone_device_folio_init() on the same pages. How would that happen?

See above. I hope my above statements make this clear.

Matt

Quoted 103 lines
Quoted 6 lines
Quoted 2 lines

Is the concern that reinitialisation would touch pages outside of the allocated VRAM range if it was previously a large folio?

No just two threads call zone_device_folio_reinitialise/init at the same time, on the same folio.

Quoted 6 lines

If we call zone_device_folio_reinitialise in ->folio_free this problem goes away. We could solve this with split_lock or something but I'd prefer not to add lock for this (although some of prior revs did do this, maybe we will revist this later).

Anyways - this falls in driver detail / choice IMO.

Agreed.

- Alistair

Quoted 86 lines

Matt

Quoted 84 lines
Quoted 84 lines
Quoted 51 lines
Quoted 44 lines
Quoted 25 lines
Quoted 25 lines
mm/memremap.c +24 -0
+{
+	struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+	int order, i;
+
+	VM_WARN_ON_FOLIO(!folio_is_zone_device(folio), folio);
+
+	folio->mapping = NULL;
+	order = folio_order(folio);
+	if (!order)
+		return;
+
+	folio_reset_order(folio);
+
+	for (i = 0; i < (1UL << order); i++) {
+		struct page *page = folio_page(folio, i);
+		struct folio *new_folio = (struct folio *)page;
+
+		ClearPageHead(page);
+		clear_compound_head(page);
+
+		new_folio->mapping = NULL;
+		/*
+		 * Reset pgmap which was over-written by
+		 * prep_compound_page().
Quoted 9 lines

mm/memremap.c struct dev_pagemap *get_dev_pagemap(unsigned long pfn) · line 465

Quoted 5 lines
mm/memremap.c +5 -0
+		 */
+		new_folio->pgmap = pgmap;
+		new_folio->share = 0;	/* fsdax only, unused for device private */
+		VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio);
+		VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio);

Does calling the free_folio() callback on new_folio solve the issue you are facing, or is that PMD_ORDER more frees than we'd like?

No, calling free_folio() more often doesn’t solve anything—in fact, that would make my implementation explode. I explained this in detail here [1] to Zi.

To recap [1], my memory allocator has no visibility into individual pages or folios; it is DRM Buddy layered on top of TTM BO. This design allows VRAM to be allocated or evicted for both traditional GPU allocations (GEMs) and SVM allocations.

Quoted 6 lines

Now, to recap the actual issue: if device folios are not split upon free and are later reallocated with a different order in zone_device_page_init, the implementation breaks. This problem is not specific to Xe—Nouveau happens to always allocate at the same order, so it works by coincidence. Reallocating at a different order is valid behavior and must be supported.

Quoted 4 lines

I agree it's probably by coincidence but it is a perfectly valid design to always just (re)allocate at the same order and not worry about having to reinitialise things to different orders.

I would agree with this statement too — it’s perfectly valid if a driver always wants to (re)allocate at the same order.

Matt

Quoted 23 lines

- Alistair

Quoted 21 lines

Matt

[1] https://patchwork.freedesktop.org/patch/697710/?series=159119&rev=3#comment_1282413

Quoted 17 lines
Quoted 8 lines
mm/memremap.c +4 -0
+	}
+}
+EXPORT_SYMBOL_GPL(free_zone_device_folio_prepare);
+
 void free_zone_device_folio(struct folio *folio)
 {
 	struct dev_pagemap *pgmap = folio->pgmap;

mm/memremap.c void free_zone_device_folio(struct folio *folio) · line 514

Quoted 7 lines
mm/memremap.c +1 -0
@@ -454,6 +508,7 @@ void free_zone_device_folio(struct folio *folio)
 	case MEMORY_DEVICE_COHERENT:
 		if (WARN_ON_ONCE(!pgmap->ops || !pgmap->ops->folio_free))
 			break;
+		free_zone_device_folio_prepare(folio);
 		pgmap->ops->folio_free(folio, order);
 		percpu_ref_put_many(&folio->pgmap->ref, nr);
 		break;

Balbir

#39 lore raw

PATCH v4 3/7 fs/dax: Use free_zone_device_folio_prepare() helper

In reply to Francois Dugast

From: Matthew Brost <[email protected]>

Use free_zone_device_folio_prepare() to restore fsdax ZONE_DEVICE folios to a sane initial state upon the final put.

Cc Dan Williams <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Jan Kara <[email protected]>
Cc Alexander Viro <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Andrew Morton <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Zi Yan <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Balbir Singh <[email protected]>
---
 fs/dax.c | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)
fs/dax.c +1 -23
index 289e6254aa30..d998f7615abb 100644
@@ -391,29 +391,7 @@ static inline unsigned long dax_folio_put(struct folio *folio)
 	if (ref)
 		return ref;
 
-	folio->mapping = NULL;
-	order = folio_order(folio);
-	if (!order)
-		return 0;
-	folio_reset_order(folio);
-
-	for (i = 0; i < (1UL << order); i++) {
-		struct dev_pagemap *pgmap = page_pgmap(&folio->page);
-		struct page *page = folio_page(folio, i);
-		struct folio *new_folio = (struct folio *)page;
-
-		ClearPageHead(page);
-		clear_compound_head(page);
-
-		new_folio->mapping = NULL;
-		/*
-		 * Reset pgmap which was over-written by
-		 * prep_compound_page().
-		 */
-		new_folio->pgmap = pgmap;
-		new_folio->share = 0;
-		WARN_ON_ONCE(folio_ref_count(new_folio));
-	}
+	free_zone_device_folio_prepare(folio);
 
 	return ref;
 }
Signature · 1 line
2.43.0
#40 lore raw

Re: [PATCH v4 3/7] fs/dax: Use free_zone_device_folio_prepare() helper

kernel test robot noticed the following build warnings:

Hi Francois,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-tip/drm-tip]
[also build test WARNING on linus/master v6.19-rc4 next-20260109]
[cannot apply to drm-misc/drm-misc-next akpm-mm/mm-everything powerpc/topic/ppc-kvm pci/next pci/for-linus akpm-mm/mm-nonmm-unstable brauner-vfs/vfs.all daeinki-drm-exynos/exynos-drm-next drm/drm-next drm-i915/for-linux-next drm-i915/for-linux-next-fixes] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Francois-Dugast/mm-zone_device-Add-order-argument-to-folio_free-callback/20260112-050347
base:   https://gitlab.freedesktop.org/drm/tip.git drm-tip
patch link:    https://lore.kernel.org/r/20260111205820.830410-4-francois.dugast%40intel.com
patch subject: [PATCH v4 3/7] fs/dax: Use free_zone_device_folio_prepare() helper
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20260112/[email protected]/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260112/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> fs/dax.c:384:6: warning: unused variable 'order' [-Wunused-variable]
     384 |         int order, i;
         |             ^~~~~
>> fs/dax.c:384:13: warning: unused variable 'i' [-Wunused-variable]
     384 |         int order, i;
         |                    ^

2 warnings generated.

vim +/order +384 fs/dax.c

38607c62b34b46 Alistair Popple 2025-02-28  380  
38607c62b34b46 Alistair Popple 2025-02-28  381  static inline unsigned long dax_folio_put(struct folio *folio)
6061b69b9a550a Shiyang Ruan    2022-06-03  382  {
38607c62b34b46 Alistair Popple 2025-02-28  383  	unsigned long ref;
38607c62b34b46 Alistair Popple 2025-02-28 @384  	int order, i;
38607c62b34b46 Alistair Popple 2025-02-28  385  
38607c62b34b46 Alistair Popple 2025-02-28  386  	if (!dax_folio_is_shared(folio))
38607c62b34b46 Alistair Popple 2025-02-28  387  		ref = 0;
38607c62b34b46 Alistair Popple 2025-02-28  388  	else
38607c62b34b46 Alistair Popple 2025-02-28  389  		ref = --folio->share;
38607c62b34b46 Alistair Popple 2025-02-28  390  
38607c62b34b46 Alistair Popple 2025-02-28  391  	if (ref)
38607c62b34b46 Alistair Popple 2025-02-28  392  		return ref;
38607c62b34b46 Alistair Popple 2025-02-28  393  
ae869c69ed0719 Matthew Brost   2026-01-11  394  	free_zone_device_folio_prepare(folio);
16900426586032 Shiyang Ruan    2022-12-01  395  
38607c62b34b46 Alistair Popple 2025-02-28  396  	return ref;
16900426586032 Shiyang Ruan    2022-12-01  397  }
16900426586032 Shiyang Ruan    2022-12-01  398  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#41 lore raw

PATCH v4 4/7 drm/pagemap: Unlock and put folios when possible

In reply to Francois Dugast

If the page is part of a folio, unlock and put the whole folio at once instead of individual pages one after the other. This will reduce the amount of operations once device THP are in use.

Cc Andrew Morton <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Zi Yan <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Balbir Singh <[email protected]>
---
 drivers/gpu/drm/drm_pagemap.c | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)
drivers/gpu/drm/drm_pagemap.c +17 -9
index df253b13cf85..bd9a4703fbce 100644
@@ -154,15 +154,15 @@ static void drm_pagemap_zdd_put(struct drm_pagemap_zdd *zdd)
 }
 
 /**
- * drm_pagemap_migration_unlock_put_page() - Put a migration page
- * @page: Pointer to the page to put
+ * drm_pagemap_migration_unlock_put_folio() - Put a migration folio
+ * @folio: Pointer to the folio to put
  *
- * This function unlocks and puts a page.
+ * This function unlocks and puts a folio.
  */
-static void drm_pagemap_migration_unlock_put_page(struct page *page)
+static void drm_pagemap_migration_unlock_put_folio(struct folio *folio)
 {
-	unlock_page(page);
-	put_page(page);
+	folio_unlock(folio);
+	folio_put(folio);
 }
 
 /**
@@ -177,15 +177,23 @@ static void drm_pagemap_migration_unlock_put_pages(unsigned long npages,
 {
 	unsigned long i;
 
-	for (i = 0; i < npages; ++i) {
+	for (i = 0; i < npages;) {
 		struct page *page;
+		struct folio *folio;
+		unsigned int order = 0;
 
 		if (!migrate_pfn[i])
-			continue;
+			goto next;
 
 		page = migrate_pfn_to_page(migrate_pfn[i]);
-		drm_pagemap_migration_unlock_put_page(page);
+		folio = page_folio(page);
+		order = folio_order(folio);
+
+		drm_pagemap_migration_unlock_put_folio(folio);
 		migrate_pfn[i] = 0;
+
+next:
+		i += NR_PAGES(order);
 	}
 }
 
Signature · 1 line
2.43.0
#42 lore raw

PATCH v4 5/7 drm/pagemap: Add helper to access zone_device_data

In reply to Francois Dugast

This new helper helps ensure all accesses to zone_device_data use the correct API whether the page is part of a folio or not.

v2:
- Move to drm_pagemap.h, stick to folio_zone_device_data (Matthew Brost)
- Return struct drm_pagemap_zdd * (Matthew Brost)

Cc Andrew Morton <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Zi Yan <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Balbir Singh <[email protected]>
---
 drivers/gpu/drm/drm_gpusvm.c  |  7 +++++--
 drivers/gpu/drm/drm_pagemap.c | 21 ++++++++++++---------
 include/drm/drm_pagemap.h     | 15 +++++++++++++++
 3 files changed, 32 insertions(+), 11 deletions(-)
drivers/gpu/drm/drm_gpusvm.c +5 -2
index aa9a0b60e727..585d913d3d19 100644
@@ -1488,12 +1488,15 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
 		order = drm_gpusvm_hmm_pfn_to_order(pfns[i], i, npages);
 		if (is_device_private_page(page) ||
 		    is_device_coherent_page(page)) {
+			struct drm_pagemap_zdd *__zdd =
+				drm_pagemap_page_zone_device_data(page);
+
 			if (!ctx->allow_mixed &&
-			    zdd != page->zone_device_data && i > 0) {
+			    zdd != __zdd && i > 0) {
 				err = -EOPNOTSUPP;
 				goto err_unmap;
 			}
-			zdd = page->zone_device_data;
+			zdd = __zdd;
 			if (pagemap != page_pgmap(page)) {
 				if (i > 0) {
 					err = -EOPNOTSUPP;
drivers/gpu/drm/drm_pagemap.c +12 -9
index bd9a4703fbce..308c14291eba 100644
@@ -252,7 +252,7 @@ static int drm_pagemap_migrate_map_pages(struct device *dev,
 		order = folio_order(folio);
 
 		if (is_device_private_page(page)) {
-			struct drm_pagemap_zdd *zdd = page->zone_device_data;
+			struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(page);
 			struct drm_pagemap *dpagemap = zdd->dpagemap;
 			struct drm_pagemap_addr addr;
 
@@ -323,7 +323,7 @@ static void drm_pagemap_migrate_unmap_pages(struct device *dev,
 			goto next;
 
 		if (is_zone_device_page(page)) {
-			struct drm_pagemap_zdd *zdd = page->zone_device_data;
+			struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(page);
 			struct drm_pagemap *dpagemap = zdd->dpagemap;
 
 			dpagemap->ops->device_unmap(dpagemap, dev, pagemap_addr[i]);
@@ -611,7 +611,8 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 
 		pages[i] = NULL;
 		if (src_page && is_device_private_page(src_page)) {
-			struct drm_pagemap_zdd *src_zdd = src_page->zone_device_data;
+			struct drm_pagemap_zdd *src_zdd =
+				drm_pagemap_page_zone_device_data(src_page);
 
 			if (page_pgmap(src_page) == pagemap &&
 			    !mdetails->can_migrate_same_pagemap) {
@@ -733,8 +734,8 @@ static int drm_pagemap_migrate_populate_ram_pfn(struct vm_area_struct *vas,
 			goto next;
 
 		if (fault_page) {
-			if (src_page->zone_device_data !=
-			    fault_page->zone_device_data)
+			if (drm_pagemap_page_zone_device_data(src_page) !=
+			    drm_pagemap_page_zone_device_data(fault_page))
 				goto next;
 		}
 
@@ -1075,7 +1076,7 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 	void *buf;
 	int i, err = 0;
 
-	zdd = page->zone_device_data;
+	zdd = drm_pagemap_page_zone_device_data(page);
 	if (time_before64(get_jiffies_64(), zdd->devmem_allocation->timeslice_expiration))
 		return 0;
 
@@ -1159,7 +1160,9 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
  */
 static void drm_pagemap_folio_free(struct folio *folio, unsigned int order)
 {
-	drm_pagemap_zdd_put(folio->page.zone_device_data);
+	struct page *page = folio_page(folio, 0);
+
+	drm_pagemap_zdd_put(drm_pagemap_page_zone_device_data(page));
 }
 
 /**
@@ -1175,7 +1178,7 @@ static void drm_pagemap_folio_free(struct folio *folio, unsigned int order)
  */
 static vm_fault_t drm_pagemap_migrate_to_ram(struct vm_fault *vmf)
 {
-	struct drm_pagemap_zdd *zdd = vmf->page->zone_device_data;
+	struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(vmf->page);
 	int err;
 
 	err = __drm_pagemap_migrate_to_ram(vmf->vma,
@@ -1241,7 +1244,7 @@ EXPORT_SYMBOL_GPL(drm_pagemap_devmem_init);
  */
 struct drm_pagemap *drm_pagemap_page_to_dpagemap(struct page *page)
 {
-	struct drm_pagemap_zdd *zdd = page->zone_device_data;
+	struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(page);
 
 	return zdd->devmem_allocation->dpagemap;
 }
include/drm/drm_pagemap.h +15 -0
index 46e9c58f09e0..736fb6cb7b33 100644
@@ -4,6 +4,7 @@
 
 #include <linux/dma-direction.h>
 #include <linux/hmm.h>
+#include <linux/memremap.h>
 #include <linux/types.h>
 
 #define NR_PAGES(order) (1U << (order))
@@ -359,4 +360,18 @@ int drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
 void drm_pagemap_destroy(struct drm_pagemap *dpagemap, bool is_atomic_or_reclaim);
 
 int drm_pagemap_reinit(struct drm_pagemap *dpagemap);
+
+/**
+ * drm_pagemap_page_zone_device_data() - Page to zone_device_data
+ * @page: Pointer to the page
+ *
+ * Return: Page's zone_device_data
+ */
+static inline struct drm_pagemap_zdd *drm_pagemap_page_zone_device_data(struct page *page)
+{
+	struct folio *folio = page_folio(page);
+
+	return folio_zone_device_data(folio);
+}
+
 #endif
Signature · 1 line
2.43.0
#43 lore raw

PATCH v4 6/7 drm/pagemap: Correct cpages calculation for migrate_vma_setup

In reply to Francois Dugast

From: Matthew Brost <[email protected]>

cpages returned from migrate_vma_setup represents the total number of individual pages found, not the number of 4K pages. The math in drm_pagemap_migrate_to_devmem for npages is based on the number of 4K pages, so cpages != npages can fail even if the entire memory range is found in migrate_vma_setup (e.g., when a single 2M page is found). Add drm_pagemap_cpages, which converts cpages to the number of 4K pages found.

Cc Andrew Morton <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Zi Yan <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Balbir Singh <[email protected]>
---
 drivers/gpu/drm/drm_pagemap.c | 38 ++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_pagemap.c +37 -1
index 308c14291eba..af2c8f4da00e 100644
@@ -452,6 +452,41 @@ static int drm_pagemap_migrate_range(struct drm_pagemap_devmem *devmem,
 	return ret;
 }
 
+/**
+ * drm_pagemap_cpages() - Count collected pages
+ * @migrate_pfn: Array of migrate_pfn entries to account
+ * @npages: Number of entries in @migrate_pfn
+ *
+ * Compute the total number of minimum-sized pages represented by the
+ * collected entries in @migrate_pfn. The total is derived from the
+ * order encoded in each entry.
+ *
+ * Return: Total number of minimum-sized pages.
+ */
+static int drm_pagemap_cpages(unsigned long *migrate_pfn, unsigned long npages)
+{
+	unsigned long i, cpages = 0;
+
+	for (i = 0; i < npages;) {
+		struct page *page = migrate_pfn_to_page(migrate_pfn[i]);
+		struct folio *folio;
+		unsigned int order = 0;
+
+		if (page) {
+			folio = page_folio(page);
+			order = folio_order(folio);
+			cpages += NR_PAGES(order);
+		} else if (migrate_pfn[i] & MIGRATE_PFN_COMPOUND) {
+			order = HPAGE_PMD_ORDER;
+			cpages += NR_PAGES(order);
+		}
+
+		i += NR_PAGES(order);
+	}
+
+	return cpages;
+}
+
 /**
  * drm_pagemap_migrate_to_devmem() - Migrate a struct mm_struct range to device memory
  * @devmem_allocation: The device memory allocation to migrate to.
@@ -564,7 +599,8 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 		goto err_free;
 	}
 
-	if (migrate.cpages != npages) {
+	if (migrate.cpages != npages &&
+	    drm_pagemap_cpages(migrate.src, npages) != npages) {
 		/*
 		 * Some pages to migrate. But we want to migrate all or
 		 * nothing. Raced or unknown device pages.
Signature · 1 line
2.43.0
author Reviewed-by on v4 6/7
#44 lore raw

Re: [PATCH v4 6/7] drm/pagemap: Correct cpages calculation for migrate_vma_setup

Quoted 10 lines · Francois Dugast

From: Matthew Brost <[email protected]>

cpages returned from migrate_vma_setup represents the total number of individual pages found, not the number of 4K pages. The math in drm_pagemap_migrate_to_devmem for npages is based on the number of 4K pages, so cpages != npages can fail even if the entire memory range is found in migrate_vma_setup (e.g., when a single 2M page is found). Add drm_pagemap_cpages, which converts cpages to the number of 4K pages found.

Quoted 14 lines
Cc Andrew Morton <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Zi Yan <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Balbir Singh <[email protected]>
Quoted 63 lines
---
 drivers/gpu/drm/drm_pagemap.c | 38 ++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_pagemap.c +37 -1
index 308c14291eba..af2c8f4da00e 100644
@@ -452,6 +452,41 @@ static int drm_pagemap_migrate_range(struct drm_pagemap_devmem *devmem,
 	return ret;
 }
 
+/**
+ * drm_pagemap_cpages() - Count collected pages
+ * @migrate_pfn: Array of migrate_pfn entries to account
+ * @npages: Number of entries in @migrate_pfn
+ *
+ * Compute the total number of minimum-sized pages represented by the
+ * collected entries in @migrate_pfn. The total is derived from the
+ * order encoded in each entry.
+ *
+ * Return: Total number of minimum-sized pages.
+ */
+static int drm_pagemap_cpages(unsigned long *migrate_pfn, unsigned long npages)
+{
+	unsigned long i, cpages = 0;
+
+	for (i = 0; i < npages;) {
+		struct page *page = migrate_pfn_to_page(migrate_pfn[i]);
+		struct folio *folio;
+		unsigned int order = 0;
+
+		if (page) {
+			folio = page_folio(page);
+			order = folio_order(folio);
+			cpages += NR_PAGES(order);
+		} else if (migrate_pfn[i] & MIGRATE_PFN_COMPOUND) {
+			order = HPAGE_PMD_ORDER;
+			cpages += NR_PAGES(order);
+		}
+
+		i += NR_PAGES(order);
+	}
+
+	return cpages;
+}
+
 /**
  * drm_pagemap_migrate_to_devmem() - Migrate a struct mm_struct range to device memory
  * @devmem_allocation: The device memory allocation to migrate to.
@@ -564,7 +599,8 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 		goto err_free;
 	}
 
-	if (migrate.cpages != npages) {
+	if (migrate.cpages != npages &&
+	    drm_pagemap_cpages(migrate.src, npages) != npages) {
 		/*
 		 * Some pages to migrate. But we want to migrate all or
 		 * nothing. Raced or unknown device pages.
Signature · 1 line
2.43.0
#45 lore raw

PATCH v4 7/7 drm/pagemap: Enable THP support for GPU memory migration

In reply to Francois Dugast

This enables support for Transparent Huge Pages (THP) for device pages by using MIGRATE_VMA_SELECT_COMPOUND during migration. It removes the need to split folios and loop multiple times over all pages to perform required operations at page level. Instead, we rely on newly introduced support for higher orders in drm_pagemap and folio-level API.

In Xe, this drastically improves performance when using SVM. The GT stats below collected after a 2MB page fault show overall servicing is more than 7 times faster, and thanks to reduced CPU overhead the time spent on the actual copy goes from 23% without THP to 80% with THP:

Without THP:

    svm_2M_pagefault_us: 966
    svm_2M_migrate_us: 942
    svm_2M_device_copy_us: 223
    svm_2M_get_pages_us: 9
    svm_2M_bind_us: 10

With THP:

    svm_2M_pagefault_us: 132
    svm_2M_migrate_us: 128
    svm_2M_device_copy_us: 106
    svm_2M_get_pages_us: 1
    svm_2M_bind_us: 2

v2:
- Fix one occurrence of drm_pagemap_get_devmem_page() (Matthew Brost)

v3:
- Remove migrate_device_split_page() and folio_split_lock, instead rely on free_zone_device_folio() to split folios before freeing (Matthew Brost)
- Assert folio order is HPAGE_PMD_ORDER (Matthew Brost)
- Always use folio_set_zone_device_data() in split (Matthew Brost)

v4:
- Warn on compound device page, s/continue/goto next/ (Matthew Brost)

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Michal Mrozek <[email protected]>
Cc Andrew Morton <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Zi Yan <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Balbir Singh <[email protected]>
---
 drivers/gpu/drm/drm_pagemap.c | 77 ++++++++++++++++++++++++++++++-----
 1 file changed, 67 insertions(+), 10 deletions(-)
drivers/gpu/drm/drm_pagemap.c +67 -10
index af2c8f4da00e..bd2c9af51564 100644
@@ -200,16 +200,20 @@ static void drm_pagemap_migration_unlock_put_pages(unsigned long npages,
 /**
  * drm_pagemap_get_devmem_page() - Get a reference to a device memory page
  * @page: Pointer to the page
+ * @order: Order
  * @zdd: Pointer to the GPU SVM zone device data
  *
  * This function associates the given page with the specified GPU SVM zone
  * device data and initializes it for zone device usage.
  */
 static void drm_pagemap_get_devmem_page(struct page *page,
+					unsigned int order,
 					struct drm_pagemap_zdd *zdd)
 {
-	page->zone_device_data = drm_pagemap_zdd_get(zdd);
-	zone_device_page_init(page, 0);
+	struct folio *folio = page_folio(page);
+
+	folio_set_zone_device_data(folio, drm_pagemap_zdd_get(zdd));
+	zone_device_page_init(page, order);
 }
 
 /**
@@ -534,7 +538,8 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 		 * rare and only occur when the madvise attributes of memory are
 		 * changed or atomics are being used.
 		 */
-		.flags		= MIGRATE_VMA_SELECT_SYSTEM | MIGRATE_VMA_SELECT_DEVICE_COHERENT,
+		.flags		= MIGRATE_VMA_SELECT_SYSTEM | MIGRATE_VMA_SELECT_DEVICE_COHERENT |
+				  MIGRATE_VMA_SELECT_COMPOUND,
 	};
 	unsigned long i, npages = npages_in_range(start, end);
 	unsigned long own_pages = 0, migrated_pages = 0;
@@ -640,11 +645,16 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 
 	own_pages = 0;
 
-	for (i = 0; i < npages; ++i) {
+	for (i = 0; i < npages;) {
+		unsigned long j;
 		struct page *page = pfn_to_page(migrate.dst[i]);
 		struct page *src_page = migrate_pfn_to_page(migrate.src[i]);
-		cur.start = i;
+		unsigned int order = 0;
+
+		drm_WARN_ONCE(dpagemap->drm, folio_order(page_folio(page)),
+			      "Unexpected compound device page found\n");
 
+		cur.start = i;
 		pages[i] = NULL;
 		if (src_page && is_device_private_page(src_page)) {
 			struct drm_pagemap_zdd *src_zdd =
@@ -654,7 +664,7 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 			    !mdetails->can_migrate_same_pagemap) {
 				migrate.dst[i] = 0;
 				own_pages++;
-				continue;
+				goto next;
 			}
 			if (mdetails->source_peer_migrates) {
 				cur.dpagemap = src_zdd->dpagemap;
@@ -670,7 +680,20 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 			pages[i] = page;
 		}
 		migrate.dst[i] = migrate_pfn(migrate.dst[i]);
-		drm_pagemap_get_devmem_page(page, zdd);
+
+		if (migrate.src[i] & MIGRATE_PFN_COMPOUND) {
+			drm_WARN_ONCE(dpagemap->drm, src_page &&
+				      folio_order(page_folio(src_page)) != HPAGE_PMD_ORDER,
+				      "Unexpected folio order\n");
+
+			order = HPAGE_PMD_ORDER;
+			migrate.dst[i] |= MIGRATE_PFN_COMPOUND;
+
+			for (j = 1; j < NR_PAGES(order) && i + j < npages; j++)
+				migrate.dst[i + j] = 0;
+		}
+
+		drm_pagemap_get_devmem_page(page, order, zdd);
 
 		/* If we switched the migrating drm_pagemap, migrate previous pages now */
 		err = drm_pagemap_migrate_range(devmem_allocation, migrate.src, migrate.dst,
@@ -680,7 +703,11 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 			npages = i + 1;
 			goto err_finalize;
 		}
+
+next:
+		i += NR_PAGES(order);
 	}
+
 	cur.start = npages;
 	cur.ops = NULL; /* Force migration */
 	err = drm_pagemap_migrate_range(devmem_allocation, migrate.src, migrate.dst,
@@ -789,6 +816,8 @@ static int drm_pagemap_migrate_populate_ram_pfn(struct vm_area_struct *vas,
 		page = folio_page(folio, 0);
 		mpfn[i] = migrate_pfn(page_to_pfn(page));
 
+		if (order)
+			mpfn[i] |= MIGRATE_PFN_COMPOUND;
 next:
 		if (page)
 			addr += page_size(page);
@@ -1044,8 +1073,15 @@ int drm_pagemap_evict_to_ram(struct drm_pagemap_devmem *devmem_allocation)
 	if (err)
 		goto err_finalize;
 
-	for (i = 0; i < npages; ++i)
+	for (i = 0; i < npages;) {
+		unsigned int order = 0;
+
 		pages[i] = migrate_pfn_to_page(src[i]);
+		if (pages[i])
+			order = folio_order(page_folio(pages[i]));
+
+		i += NR_PAGES(order);
+	}
 
 	err = ops->copy_to_ram(pages, pagemap_addr, npages, NULL);
 	if (err)
@@ -1098,7 +1134,8 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 		.vma		= vas,
 		.pgmap_owner	= page_pgmap(page)->owner,
 		.flags		= MIGRATE_VMA_SELECT_DEVICE_PRIVATE |
-		MIGRATE_VMA_SELECT_DEVICE_COHERENT,
+				  MIGRATE_VMA_SELECT_DEVICE_COHERENT |
+				  MIGRATE_VMA_SELECT_COMPOUND,
 		.fault_page	= page,
 	};
 	struct drm_pagemap_migrate_details mdetails = {};
@@ -1164,8 +1201,15 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 	if (err)
 		goto err_finalize;
 
-	for (i = 0; i < npages; ++i)
+	for (i = 0; i < npages;) {
+		unsigned int order = 0;
+
 		pages[i] = migrate_pfn_to_page(migrate.src[i]);
+		if (pages[i])
+			order = folio_order(page_folio(pages[i]));
+
+		i += NR_PAGES(order);
+	}
 
 	err = ops->copy_to_ram(pages, pagemap_addr, npages, NULL);
 	if (err)
@@ -1224,9 +1268,22 @@ static vm_fault_t drm_pagemap_migrate_to_ram(struct vm_fault *vmf)
 	return err ? VM_FAULT_SIGBUS : 0;
 }
 
+static void drm_pagemap_folio_split(struct folio *orig_folio, struct folio *new_folio)
+{
+	struct drm_pagemap_zdd *zdd;
+
+	if (!new_folio)
+		return;
+
+	new_folio->pgmap = orig_folio->pgmap;
+	zdd = folio_zone_device_data(orig_folio);
+	folio_set_zone_device_data(new_folio, drm_pagemap_zdd_get(zdd));
+}
+
 static const struct dev_pagemap_ops drm_pagemap_pagemap_ops = {
 	.folio_free = drm_pagemap_folio_free,
 	.migrate_to_ram = drm_pagemap_migrate_to_ram,
+	.folio_split = drm_pagemap_folio_split,
 };
 
 /**
Signature · 1 line
2.43.0
maintainer Reviewed-by on v4 7/7
#46 lore raw

Re: [PATCH v4 7/7] drm/pagemap: Enable THP support for GPU memory migration

Quoted 36 lines · Francois Dugast

This enables support for Transparent Huge Pages (THP) for device pages by using MIGRATE_VMA_SELECT_COMPOUND during migration. It removes the need to split folios and loop multiple times over all pages to perform required operations at page level. Instead, we rely on newly introduced support for higher orders in drm_pagemap and folio-level API.

In Xe, this drastically improves performance when using SVM. The GT stats below collected after a 2MB page fault show overall servicing is more than 7 times faster, and thanks to reduced CPU overhead the time spent on the actual copy goes from 23% without THP to 80% with THP:

Without THP:

    svm_2M_pagefault_us: 966
    svm_2M_migrate_us: 942
    svm_2M_device_copy_us: 223
    svm_2M_get_pages_us: 9
    svm_2M_bind_us: 10

With THP:

    svm_2M_pagefault_us: 132
    svm_2M_migrate_us: 128
    svm_2M_device_copy_us: 106
    svm_2M_get_pages_us: 1
    svm_2M_bind_us: 2

v2:
- Fix one occurrence of drm_pagemap_get_devmem_page() (Matthew Brost)

v3:
- Remove migrate_device_split_page() and folio_split_lock, instead rely on free_zone_device_folio() to split folios before freeing (Matthew Brost)
- Assert folio order is HPAGE_PMD_ORDER (Matthew Brost)
- Always use folio_set_zone_device_data() in split (Matthew Brost)

Quoted 4 lines

v4:
- Warn on compound device page, s/continue/goto next/ (Matthew Brost)

Cc Matthew Brost <[email protected]>
Quoted 197 lines
Cc Thomas Hellström <[email protected]>
Cc Michal Mrozek <[email protected]>
Cc Andrew Morton <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Zi Yan <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Balbir Singh <[email protected]>
---
 drivers/gpu/drm/drm_pagemap.c | 77 ++++++++++++++++++++++++++++++-----
 1 file changed, 67 insertions(+), 10 deletions(-)
drivers/gpu/drm/drm_pagemap.c +67 -10
index af2c8f4da00e..bd2c9af51564 100644
@@ -200,16 +200,20 @@ static void drm_pagemap_migration_unlock_put_pages(unsigned long npages,
 /**
  * drm_pagemap_get_devmem_page() - Get a reference to a device memory page
  * @page: Pointer to the page
+ * @order: Order
  * @zdd: Pointer to the GPU SVM zone device data
  *
  * This function associates the given page with the specified GPU SVM zone
  * device data and initializes it for zone device usage.
  */
 static void drm_pagemap_get_devmem_page(struct page *page,
+					unsigned int order,
 					struct drm_pagemap_zdd *zdd)
 {
-	page->zone_device_data = drm_pagemap_zdd_get(zdd);
-	zone_device_page_init(page, 0);
+	struct folio *folio = page_folio(page);
+
+	folio_set_zone_device_data(folio, drm_pagemap_zdd_get(zdd));
+	zone_device_page_init(page, order);
 }
 
 /**
@@ -534,7 +538,8 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 		 * rare and only occur when the madvise attributes of memory are
 		 * changed or atomics are being used.
 		 */
-		.flags		= MIGRATE_VMA_SELECT_SYSTEM | MIGRATE_VMA_SELECT_DEVICE_COHERENT,
+		.flags		= MIGRATE_VMA_SELECT_SYSTEM | MIGRATE_VMA_SELECT_DEVICE_COHERENT |
+				  MIGRATE_VMA_SELECT_COMPOUND,
 	};
 	unsigned long i, npages = npages_in_range(start, end);
 	unsigned long own_pages = 0, migrated_pages = 0;
@@ -640,11 +645,16 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 
 	own_pages = 0;
 
-	for (i = 0; i < npages; ++i) {
+	for (i = 0; i < npages;) {
+		unsigned long j;
 		struct page *page = pfn_to_page(migrate.dst[i]);
 		struct page *src_page = migrate_pfn_to_page(migrate.src[i]);
-		cur.start = i;
+		unsigned int order = 0;
+
+		drm_WARN_ONCE(dpagemap->drm, folio_order(page_folio(page)),
+			      "Unexpected compound device page found\n");
 
+		cur.start = i;
 		pages[i] = NULL;
 		if (src_page && is_device_private_page(src_page)) {
 			struct drm_pagemap_zdd *src_zdd =
@@ -654,7 +664,7 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 			    !mdetails->can_migrate_same_pagemap) {
 				migrate.dst[i] = 0;
 				own_pages++;
-				continue;
+				goto next;
 			}
 			if (mdetails->source_peer_migrates) {
 				cur.dpagemap = src_zdd->dpagemap;
@@ -670,7 +680,20 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 			pages[i] = page;
 		}
 		migrate.dst[i] = migrate_pfn(migrate.dst[i]);
-		drm_pagemap_get_devmem_page(page, zdd);
+
+		if (migrate.src[i] & MIGRATE_PFN_COMPOUND) {
+			drm_WARN_ONCE(dpagemap->drm, src_page &&
+				      folio_order(page_folio(src_page)) != HPAGE_PMD_ORDER,
+				      "Unexpected folio order\n");
+
+			order = HPAGE_PMD_ORDER;
+			migrate.dst[i] |= MIGRATE_PFN_COMPOUND;
+
+			for (j = 1; j < NR_PAGES(order) && i + j < npages; j++)
+				migrate.dst[i + j] = 0;
+		}
+
+		drm_pagemap_get_devmem_page(page, order, zdd);
 
 		/* If we switched the migrating drm_pagemap, migrate previous pages now */
 		err = drm_pagemap_migrate_range(devmem_allocation, migrate.src, migrate.dst,
@@ -680,7 +703,11 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 			npages = i + 1;
 			goto err_finalize;
 		}
+
+next:
+		i += NR_PAGES(order);
 	}
+
 	cur.start = npages;
 	cur.ops = NULL; /* Force migration */
 	err = drm_pagemap_migrate_range(devmem_allocation, migrate.src, migrate.dst,
@@ -789,6 +816,8 @@ static int drm_pagemap_migrate_populate_ram_pfn(struct vm_area_struct *vas,
 		page = folio_page(folio, 0);
 		mpfn[i] = migrate_pfn(page_to_pfn(page));
 
+		if (order)
+			mpfn[i] |= MIGRATE_PFN_COMPOUND;
 next:
 		if (page)
 			addr += page_size(page);
@@ -1044,8 +1073,15 @@ int drm_pagemap_evict_to_ram(struct drm_pagemap_devmem *devmem_allocation)
 	if (err)
 		goto err_finalize;
 
-	for (i = 0; i < npages; ++i)
+	for (i = 0; i < npages;) {
+		unsigned int order = 0;
+
 		pages[i] = migrate_pfn_to_page(src[i]);
+		if (pages[i])
+			order = folio_order(page_folio(pages[i]));
+
+		i += NR_PAGES(order);
+	}
 
 	err = ops->copy_to_ram(pages, pagemap_addr, npages, NULL);
 	if (err)
@@ -1098,7 +1134,8 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 		.vma		= vas,
 		.pgmap_owner	= page_pgmap(page)->owner,
 		.flags		= MIGRATE_VMA_SELECT_DEVICE_PRIVATE |
-		MIGRATE_VMA_SELECT_DEVICE_COHERENT,
+				  MIGRATE_VMA_SELECT_DEVICE_COHERENT |
+				  MIGRATE_VMA_SELECT_COMPOUND,
 		.fault_page	= page,
 	};
 	struct drm_pagemap_migrate_details mdetails = {};
@@ -1164,8 +1201,15 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 	if (err)
 		goto err_finalize;
 
-	for (i = 0; i < npages; ++i)
+	for (i = 0; i < npages;) {
+		unsigned int order = 0;
+
 		pages[i] = migrate_pfn_to_page(migrate.src[i]);
+		if (pages[i])
+			order = folio_order(page_folio(pages[i]));
+
+		i += NR_PAGES(order);
+	}
 
 	err = ops->copy_to_ram(pages, pagemap_addr, npages, NULL);
 	if (err)
@@ -1224,9 +1268,22 @@ static vm_fault_t drm_pagemap_migrate_to_ram(struct vm_fault *vmf)
 	return err ? VM_FAULT_SIGBUS : 0;
 }
 
+static void drm_pagemap_folio_split(struct folio *orig_folio, struct folio *new_folio)
+{
+	struct drm_pagemap_zdd *zdd;
+
+	if (!new_folio)
+		return;
+
+	new_folio->pgmap = orig_folio->pgmap;
+	zdd = folio_zone_device_data(orig_folio);
+	folio_set_zone_device_data(new_folio, drm_pagemap_zdd_get(zdd));
+}
+
 static const struct dev_pagemap_ops drm_pagemap_pagemap_ops = {
 	.folio_free = drm_pagemap_folio_free,
 	.migrate_to_ram = drm_pagemap_migrate_to_ram,
+	.folio_split = drm_pagemap_folio_split,
 };
 
 /**
Signature · 1 line
2.43.0
maintainer
#47 lore raw

Re: [PATCH v4 7/7] drm/pagemap: Enable THP support for GPU memory migration

In reply to Francois Dugast
Quoted 73 lines · Francois Dugast

This enables support for Transparent Huge Pages (THP) for device pages by using MIGRATE_VMA_SELECT_COMPOUND during migration. It removes the need to split folios and loop multiple times over all pages to perform required operations at page level. Instead, we rely on newly introduced support for higher orders in drm_pagemap and folio-level API.

In Xe, this drastically improves performance when using SVM. The GT stats below collected after a 2MB page fault show overall servicing is more than 7 times faster, and thanks to reduced CPU overhead the time spent on the actual copy goes from 23% without THP to 80% with THP:

Without THP:

    svm_2M_pagefault_us: 966
    svm_2M_migrate_us: 942
    svm_2M_device_copy_us: 223
    svm_2M_get_pages_us: 9
    svm_2M_bind_us: 10

With THP:

    svm_2M_pagefault_us: 132
    svm_2M_migrate_us: 128
    svm_2M_device_copy_us: 106
    svm_2M_get_pages_us: 1
    svm_2M_bind_us: 2

v2:
- Fix one occurrence of drm_pagemap_get_devmem_page() (Matthew Brost)

v3:
- Remove migrate_device_split_page() and folio_split_lock, instead rely on free_zone_device_folio() to split folios before freeing (Matthew Brost)
- Assert folio order is HPAGE_PMD_ORDER (Matthew Brost)
- Always use folio_set_zone_device_data() in split (Matthew Brost)

v4:
- Warn on compound device page, s/continue/goto next/ (Matthew Brost)

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Michal Mrozek <[email protected]>
Cc Andrew Morton <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Zi Yan <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Balbir Singh <[email protected]>
---
 drivers/gpu/drm/drm_pagemap.c | 77 ++++++++++++++++++++++++++++++-----
 1 file changed, 67 insertions(+), 10 deletions(-)
drivers/gpu/drm/drm_pagemap.c +1 -0
index af2c8f4da00e..bd2c9af51564 100644
@@ -200,16 +200,20 @@ static void drm_pagemap_migration_unlock_put_pages(unsigned long npages,
 /**
  * drm_pagemap_get_devmem_page() - Get a reference to a device memory page
  * @page: Pointer to the page
+ * @order: Order
  * @zdd: Pointer to the GPU SVM zone device data
  *
  * This function associates the given page with the specified GPU SVM zone
  * device data and initializes it for zone device usage.
  */

drivers/gpu/drm/drm_pagemap.c static void drm_pagemap_migration_unlock_put_pages(unsigned long npages, · line 216

Quoted 10 lines
drivers/gpu/drm/drm_pagemap.c +5 -2
 static void drm_pagemap_get_devmem_page(struct page *page,
+					unsigned int order,
 					struct drm_pagemap_zdd *zdd)
 {
-	page->zone_device_data = drm_pagemap_zdd_get(zdd);
-	zone_device_page_init(page, 0);
+	struct folio *folio = page_folio(page);
+
+	folio_set_zone_device_data(folio, drm_pagemap_zdd_get(zdd));
+	zone_device_page_init(page, order);

Just noticed this:

s/zone_device_page_init/zone_device_folio_init/

Matt

Quoted 154 lines
drivers/gpu/drm/drm_pagemap.c +61 -8
 }
 
 /**
@@ -534,7 +538,8 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 		 * rare and only occur when the madvise attributes of memory are
 		 * changed or atomics are being used.
 		 */
-		.flags		= MIGRATE_VMA_SELECT_SYSTEM | MIGRATE_VMA_SELECT_DEVICE_COHERENT,
+		.flags		= MIGRATE_VMA_SELECT_SYSTEM | MIGRATE_VMA_SELECT_DEVICE_COHERENT |
+				  MIGRATE_VMA_SELECT_COMPOUND,
 	};
 	unsigned long i, npages = npages_in_range(start, end);
 	unsigned long own_pages = 0, migrated_pages = 0;
@@ -640,11 +645,16 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 
 	own_pages = 0;
 
-	for (i = 0; i < npages; ++i) {
+	for (i = 0; i < npages;) {
+		unsigned long j;
 		struct page *page = pfn_to_page(migrate.dst[i]);
 		struct page *src_page = migrate_pfn_to_page(migrate.src[i]);
-		cur.start = i;
+		unsigned int order = 0;
+
+		drm_WARN_ONCE(dpagemap->drm, folio_order(page_folio(page)),
+			      "Unexpected compound device page found\n");
 
+		cur.start = i;
 		pages[i] = NULL;
 		if (src_page && is_device_private_page(src_page)) {
 			struct drm_pagemap_zdd *src_zdd =
@@ -654,7 +664,7 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 			    !mdetails->can_migrate_same_pagemap) {
 				migrate.dst[i] = 0;
 				own_pages++;
-				continue;
+				goto next;
 			}
 			if (mdetails->source_peer_migrates) {
 				cur.dpagemap = src_zdd->dpagemap;
@@ -670,7 +680,20 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 			pages[i] = page;
 		}
 		migrate.dst[i] = migrate_pfn(migrate.dst[i]);
-		drm_pagemap_get_devmem_page(page, zdd);
+
+		if (migrate.src[i] & MIGRATE_PFN_COMPOUND) {
+			drm_WARN_ONCE(dpagemap->drm, src_page &&
+				      folio_order(page_folio(src_page)) != HPAGE_PMD_ORDER,
+				      "Unexpected folio order\n");
+
+			order = HPAGE_PMD_ORDER;
+			migrate.dst[i] |= MIGRATE_PFN_COMPOUND;
+
+			for (j = 1; j < NR_PAGES(order) && i + j < npages; j++)
+				migrate.dst[i + j] = 0;
+		}
+
+		drm_pagemap_get_devmem_page(page, order, zdd);
 
 		/* If we switched the migrating drm_pagemap, migrate previous pages now */
 		err = drm_pagemap_migrate_range(devmem_allocation, migrate.src, migrate.dst,
@@ -680,7 +703,11 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 			npages = i + 1;
 			goto err_finalize;
 		}
+
+next:
+		i += NR_PAGES(order);
 	}
+
 	cur.start = npages;
 	cur.ops = NULL; /* Force migration */
 	err = drm_pagemap_migrate_range(devmem_allocation, migrate.src, migrate.dst,
@@ -789,6 +816,8 @@ static int drm_pagemap_migrate_populate_ram_pfn(struct vm_area_struct *vas,
 		page = folio_page(folio, 0);
 		mpfn[i] = migrate_pfn(page_to_pfn(page));
 
+		if (order)
+			mpfn[i] |= MIGRATE_PFN_COMPOUND;
 next:
 		if (page)
 			addr += page_size(page);
@@ -1044,8 +1073,15 @@ int drm_pagemap_evict_to_ram(struct drm_pagemap_devmem *devmem_allocation)
 	if (err)
 		goto err_finalize;
 
-	for (i = 0; i < npages; ++i)
+	for (i = 0; i < npages;) {
+		unsigned int order = 0;
+
 		pages[i] = migrate_pfn_to_page(src[i]);
+		if (pages[i])
+			order = folio_order(page_folio(pages[i]));
+
+		i += NR_PAGES(order);
+	}
 
 	err = ops->copy_to_ram(pages, pagemap_addr, npages, NULL);
 	if (err)
@@ -1098,7 +1134,8 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 		.vma		= vas,
 		.pgmap_owner	= page_pgmap(page)->owner,
 		.flags		= MIGRATE_VMA_SELECT_DEVICE_PRIVATE |
-		MIGRATE_VMA_SELECT_DEVICE_COHERENT,
+				  MIGRATE_VMA_SELECT_DEVICE_COHERENT |
+				  MIGRATE_VMA_SELECT_COMPOUND,
 		.fault_page	= page,
 	};
 	struct drm_pagemap_migrate_details mdetails = {};
@@ -1164,8 +1201,15 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 	if (err)
 		goto err_finalize;
 
-	for (i = 0; i < npages; ++i)
+	for (i = 0; i < npages;) {
+		unsigned int order = 0;
+
 		pages[i] = migrate_pfn_to_page(migrate.src[i]);
+		if (pages[i])
+			order = folio_order(page_folio(pages[i]));
+
+		i += NR_PAGES(order);
+	}
 
 	err = ops->copy_to_ram(pages, pagemap_addr, npages, NULL);
 	if (err)
@@ -1224,9 +1268,22 @@ static vm_fault_t drm_pagemap_migrate_to_ram(struct vm_fault *vmf)
 	return err ? VM_FAULT_SIGBUS : 0;
 }
 
+static void drm_pagemap_folio_split(struct folio *orig_folio, struct folio *new_folio)
+{
+	struct drm_pagemap_zdd *zdd;
+
+	if (!new_folio)
+		return;
+
+	new_folio->pgmap = orig_folio->pgmap;
+	zdd = folio_zone_device_data(orig_folio);
+	folio_set_zone_device_data(new_folio, drm_pagemap_zdd_get(zdd));
+}
+
 static const struct dev_pagemap_ops drm_pagemap_pagemap_ops = {
 	.folio_free = drm_pagemap_folio_free,
 	.migrate_to_ram = drm_pagemap_migrate_to_ram,
+	.folio_split = drm_pagemap_folio_split,
 };
 
 /**
Signature · 1 line
2.43.0
#48 lore raw

✓ CI.KUnit: success for Enable THP support in drm_pagemap (rev5)

In reply to Francois Dugast
== Series Details ==

== Series Details ==

Series: Enable THP support in drm_pagemap (rev5)
URL : https://patchwork.freedesktop.org/series/159119/
State : success

== Summary ==

+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig [21:08:18] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:

$ make ARCH=um O=.kunit olddefconfig
[21:08:22] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[21:08:54] Starting KUnit Kernel (1/1)...
[21:08:54] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[21:08:54] ================== guc_buf (11 subtests) ===================
[21:08:54] [PASSED] test_smallest
[21:08:54] [PASSED] test_largest
[21:08:54] [PASSED] test_granular
[21:08:54] [PASSED] test_unique
[21:08:54] [PASSED] test_overlap
[21:08:54] [PASSED] test_reusable
[21:08:54] [PASSED] test_too_big
[21:08:54] [PASSED] test_flush
[21:08:54] [PASSED] test_lookup
[21:08:54] [PASSED] test_data
[21:08:54] [PASSED] test_class
[21:08:54] ===================== [PASSED] guc_buf =====================
[21:08:54] =================== guc_dbm (7 subtests) ===================
[21:08:54] [PASSED] test_empty
[21:08:54] [PASSED] test_default
[21:08:54] ======================== test_size  ========================
[21:08:54] [PASSED] 4
[21:08:54] [PASSED] 8
[21:08:54] [PASSED] 32
[21:08:54] [PASSED] 256
[21:08:54] ==================== [PASSED] test_size ====================
[21:08:54] ======================= test_reuse  ========================
[21:08:54] [PASSED] 4
[21:08:54] [PASSED] 8
[21:08:54] [PASSED] 32
[21:08:54] [PASSED] 256
[21:08:54] =================== [PASSED] test_reuse ====================
[21:08:54] =================== test_range_overlap  ====================
[21:08:54] [PASSED] 4
[21:08:54] [PASSED] 8
[21:08:54] [PASSED] 32
[21:08:54] [PASSED] 256
[21:08:54] =============== [PASSED] test_range_overlap ================
[21:08:54] =================== test_range_compact  ====================
[21:08:54] [PASSED] 4
[21:08:54] [PASSED] 8
[21:08:54] [PASSED] 32
[21:08:54] [PASSED] 256
[21:08:54] =============== [PASSED] test_range_compact ================
[21:08:54] ==================== test_range_spare  =====================
[21:08:54] [PASSED] 4
[21:08:54] [PASSED] 8
[21:08:54] [PASSED] 32
[21:08:54] [PASSED] 256
[21:08:54] ================ [PASSED] test_range_spare =================
[21:08:54] ===================== [PASSED] guc_dbm =====================
[21:08:54] =================== guc_idm (6 subtests) ===================
[21:08:54] [PASSED] bad_init
[21:08:54] [PASSED] no_init
[21:08:54] [PASSED] init_fini
[21:08:54] [PASSED] check_used
[21:08:54] [PASSED] check_quota
[21:08:54] [PASSED] check_all
[21:08:54] ===================== [PASSED] guc_idm =====================
[21:08:54] ================== no_relay (3 subtests) ===================
[21:08:54] [PASSED] xe_drops_guc2pf_if_not_ready
[21:08:54] [PASSED] xe_drops_guc2vf_if_not_ready
[21:08:54] [PASSED] xe_rejects_send_if_not_ready
[21:08:54] ==================== [PASSED] no_relay =====================
[21:08:54] ================== pf_relay (14 subtests) ==================
[21:08:54] [PASSED] pf_rejects_guc2pf_too_short
[21:08:54] [PASSED] pf_rejects_guc2pf_too_long
[21:08:54] [PASSED] pf_rejects_guc2pf_no_payload
[21:08:54] [PASSED] pf_fails_no_payload
[21:08:54] [PASSED] pf_fails_bad_origin
[21:08:54] [PASSED] pf_fails_bad_type
[21:08:54] [PASSED] pf_txn_reports_error
[21:08:54] [PASSED] pf_txn_sends_pf2guc
[21:08:54] [PASSED] pf_sends_pf2guc
[21:08:54] [SKIPPED] pf_loopback_nop
[21:08:54] [SKIPPED] pf_loopback_echo
[21:08:54] [SKIPPED] pf_loopback_fail
[21:08:54] [SKIPPED] pf_loopback_busy
[21:08:54] [SKIPPED] pf_loopback_retry
[21:08:54] ==================== [PASSED] pf_relay =====================
[21:08:54] ================== vf_relay (3 subtests) ===================
[21:08:54] [PASSED] vf_rejects_guc2vf_too_short
[21:08:54] [PASSED] vf_rejects_guc2vf_too_long
[21:08:54] [PASSED] vf_rejects_guc2vf_no_payload
[21:08:54] ==================== [PASSED] vf_relay =====================
[21:08:54] ================ pf_gt_config (6 subtests) =================
[21:08:54] [PASSED] fair_contexts_1vf
[21:08:54] [PASSED] fair_doorbells_1vf
[21:08:54] [PASSED] fair_ggtt_1vf
[21:08:54] ====================== fair_contexts  ======================
[21:08:54] [PASSED] 1 VF
[21:08:54] [PASSED] 2 VFs
[21:08:54] [PASSED] 3 VFs
[21:08:54] [PASSED] 4 VFs
[21:08:54] [PASSED] 5 VFs
[21:08:54] [PASSED] 6 VFs
[21:08:54] [PASSED] 7 VFs
[21:08:54] [PASSED] 8 VFs
[21:08:54] [PASSED] 9 VFs
[21:08:54] [PASSED] 10 VFs
[21:08:54] [PASSED] 11 VFs
[21:08:54] [PASSED] 12 VFs
[21:08:54] [PASSED] 13 VFs
[21:08:54] [PASSED] 14 VFs
[21:08:54] [PASSED] 15 VFs
[21:08:54] [PASSED] 16 VFs
[21:08:54] [PASSED] 17 VFs
[21:08:54] [PASSED] 18 VFs
[21:08:54] [PASSED] 19 VFs
[21:08:54] [PASSED] 20 VFs
[21:08:54] [PASSED] 21 VFs
[21:08:54] [PASSED] 22 VFs
[21:08:54] [PASSED] 23 VFs
[21:08:54] [PASSED] 24 VFs
[21:08:54] [PASSED] 25 VFs
[21:08:54] [PASSED] 26 VFs
[21:08:54] [PASSED] 27 VFs
[21:08:54] [PASSED] 28 VFs
[21:08:54] [PASSED] 29 VFs
[21:08:54] [PASSED] 30 VFs
[21:08:54] [PASSED] 31 VFs
[21:08:54] [PASSED] 32 VFs
[21:08:54] [PASSED] 33 VFs
[21:08:54] [PASSED] 34 VFs
[21:08:54] [PASSED] 35 VFs
[21:08:54] [PASSED] 36 VFs
[21:08:54] [PASSED] 37 VFs
[21:08:54] [PASSED] 38 VFs
[21:08:54] [PASSED] 39 VFs
[21:08:54] [PASSED] 40 VFs
[21:08:54] [PASSED] 41 VFs
[21:08:54] [PASSED] 42 VFs
[21:08:54] [PASSED] 43 VFs
[21:08:54] [PASSED] 44 VFs
[21:08:54] [PASSED] 45 VFs
[21:08:54] [PASSED] 46 VFs
[21:08:54] [PASSED] 47 VFs
[21:08:54] [PASSED] 48 VFs
[21:08:54] [PASSED] 49 VFs
[21:08:54] [PASSED] 50 VFs
[21:08:54] [PASSED] 51 VFs
[21:08:54] [PASSED] 52 VFs
[21:08:54] [PASSED] 53 VFs
[21:08:54] [PASSED] 54 VFs
[21:08:54] [PASSED] 55 VFs
[21:08:54] [PASSED] 56 VFs
[21:08:54] [PASSED] 57 VFs
[21:08:54] [PASSED] 58 VFs
[21:08:54] [PASSED] 59 VFs
[21:08:54] [PASSED] 60 VFs
[21:08:54] [PASSED] 61 VFs
[21:08:54] [PASSED] 62 VFs
[21:08:54] [PASSED] 63 VFs
[21:08:54] ================== [PASSED] fair_contexts ==================
[21:08:54] ===================== fair_doorbells  ======================
[21:08:54] [PASSED] 1 VF
[21:08:54] [PASSED] 2 VFs
[21:08:54] [PASSED] 3 VFs
[21:08:54] [PASSED] 4 VFs
[21:08:54] [PASSED] 5 VFs
[21:08:54] [PASSED] 6 VFs
[21:08:54] [PASSED] 7 VFs
[21:08:54] [PASSED] 8 VFs
[21:08:54] [PASSED] 9 VFs
[21:08:54] [PASSED] 10 VFs
[21:08:54] [PASSED] 11 VFs
[21:08:54] [PASSED] 12 VFs
[21:08:54] [PASSED] 13 VFs
[21:08:54] [PASSED] 14 VFs
[21:08:54] [PASSED] 15 VFs
[21:08:54] [PASSED] 16 VFs
[21:08:54] [PASSED] 17 VFs
[21:08:54] [PASSED] 18 VFs
[21:08:54] [PASSED] 19 VFs
[21:08:54] [PASSED] 20 VFs
[21:08:54] [PASSED] 21 VFs
[21:08:54] [PASSED] 22 VFs
[21:08:54] [PASSED] 23 VFs
[21:08:54] [PASSED] 24 VFs
[21:08:54] [PASSED] 25 VFs
[21:08:54] [PASSED] 26 VFs
[21:08:54] [PASSED] 27 VFs
[21:08:54] [PASSED] 28 VFs
[21:08:54] [PASSED] 29 VFs
[21:08:54] [PASSED] 30 VFs
[21:08:54] [PASSED] 31 VFs
[21:08:54] [PASSED] 32 VFs
[21:08:54] [PASSED] 33 VFs
[21:08:54] [PASSED] 34 VFs
[21:08:54] [PASSED] 35 VFs
[21:08:54] [PASSED] 36 VFs
[21:08:54] [PASSED] 37 VFs
[21:08:54] [PASSED] 38 VFs
[21:08:54] [PASSED] 39 VFs
[21:08:54] [PASSED] 40 VFs
[21:08:54] [PASSED] 41 VFs
[21:08:54] [PASSED] 42 VFs
[21:08:54] [PASSED] 43 VFs
[21:08:54] [PASSED] 44 VFs
[21:08:54] [PASSED] 45 VFs
[21:08:54] [PASSED] 46 VFs
[21:08:54] [PASSED] 47 VFs
[21:08:54] [PASSED] 48 VFs
[21:08:54] [PASSED] 49 VFs
[21:08:54] [PASSED] 50 VFs
[21:08:54] [PASSED] 51 VFs
[21:08:54] [PASSED] 52 VFs
[21:08:54] [PASSED] 53 VFs
[21:08:54] [PASSED] 54 VFs
[21:08:54] [PASSED] 55 VFs
[21:08:54] [PASSED] 56 VFs
[21:08:54] [PASSED] 57 VFs
[21:08:54] [PASSED] 58 VFs
[21:08:54] [PASSED] 59 VFs
[21:08:54] [PASSED] 60 VFs
[21:08:54] [PASSED] 61 VFs
[21:08:54] [PASSED] 62 VFs
[21:08:54] [PASSED] 63 VFs
[21:08:54] ================= [PASSED] fair_doorbells ==================
[21:08:54] ======================== fair_ggtt  ========================
[21:08:54] [PASSED] 1 VF
[21:08:54] [PASSED] 2 VFs
[21:08:54] [PASSED] 3 VFs
[21:08:54] [PASSED] 4 VFs
[21:08:54] [PASSED] 5 VFs
[21:08:54] [PASSED] 6 VFs
[21:08:54] [PASSED] 7 VFs
[21:08:54] [PASSED] 8 VFs
[21:08:54] [PASSED] 9 VFs
[21:08:54] [PASSED] 10 VFs
[21:08:54] [PASSED] 11 VFs
[21:08:54] [PASSED] 12 VFs
[21:08:54] [PASSED] 13 VFs
[21:08:54] [PASSED] 14 VFs
[21:08:54] [PASSED] 15 VFs
[21:08:54] [PASSED] 16 VFs
[21:08:54] [PASSED] 17 VFs
[21:08:54] [PASSED] 18 VFs
[21:08:54] [PASSED] 19 VFs
[21:08:54] [PASSED] 20 VFs
[21:08:54] [PASSED] 21 VFs
[21:08:54] [PASSED] 22 VFs
[21:08:54] [PASSED] 23 VFs
[21:08:54] [PASSED] 24 VFs
[21:08:54] [PASSED] 25 VFs
[21:08:54] [PASSED] 26 VFs
[21:08:54] [PASSED] 27 VFs
[21:08:54] [PASSED] 28 VFs
[21:08:54] [PASSED] 29 VFs
[21:08:54] [PASSED] 30 VFs
[21:08:54] [PASSED] 31 VFs
[21:08:54] [PASSED] 32 VFs
[21:08:54] [PASSED] 33 VFs
[21:08:54] [PASSED] 34 VFs
[21:08:54] [PASSED] 35 VFs
[21:08:54] [PASSED] 36 VFs
[21:08:54] [PASSED] 37 VFs
[21:08:54] [PASSED] 38 VFs
[21:08:54] [PASSED] 39 VFs
[21:08:54] [PASSED] 40 VFs
[21:08:54] [PASSED] 41 VFs
[21:08:54] [PASSED] 42 VFs
[21:08:54] [PASSED] 43 VFs
[21:08:54] [PASSED] 44 VFs
[21:08:54] [PASSED] 45 VFs
[21:08:54] [PASSED] 46 VFs
[21:08:54] [PASSED] 47 VFs
[21:08:54] [PASSED] 48 VFs
[21:08:54] [PASSED] 49 VFs
[21:08:54] [PASSED] 50 VFs
[21:08:54] [PASSED] 51 VFs
[21:08:54] [PASSED] 52 VFs
[21:08:54] [PASSED] 53 VFs
[21:08:54] [PASSED] 54 VFs
[21:08:54] [PASSED] 55 VFs
[21:08:54] [PASSED] 56 VFs
[21:08:54] [PASSED] 57 VFs
[21:08:54] [PASSED] 58 VFs
[21:08:54] [PASSED] 59 VFs
[21:08:54] [PASSED] 60 VFs
[21:08:54] [PASSED] 61 VFs
[21:08:54] [PASSED] 62 VFs
[21:08:54] [PASSED] 63 VFs
[21:08:54] ==================== [PASSED] fair_ggtt ====================
[21:08:54] ================== [PASSED] pf_gt_config ===================
[21:08:54] ===================== lmtt (1 subtest) =====================
[21:08:54] ======================== test_ops  =========================
[21:08:54] [PASSED] 2-level
[21:08:54] [PASSED] multi-level
[21:08:54] ==================== [PASSED] test_ops =====================
[21:08:54] ====================== [PASSED] lmtt =======================
[21:08:54] ================= pf_service (11 subtests) =================
[21:08:54] [PASSED] pf_negotiate_any
[21:08:54] [PASSED] pf_negotiate_base_match
[21:08:54] [PASSED] pf_negotiate_base_newer
[21:08:54] [PASSED] pf_negotiate_base_next
[21:08:54] [SKIPPED] pf_negotiate_base_older
[21:08:54] [PASSED] pf_negotiate_base_prev
[21:08:54] [PASSED] pf_negotiate_latest_match
[21:08:54] [PASSED] pf_negotiate_latest_newer
[21:08:54] [PASSED] pf_negotiate_latest_next
[21:08:54] [SKIPPED] pf_negotiate_latest_older
[21:08:54] [SKIPPED] pf_negotiate_latest_prev
[21:08:54] =================== [PASSED] pf_service ====================
[21:08:54] ================= xe_guc_g2g (2 subtests) ==================
[21:08:54] ============== xe_live_guc_g2g_kunit_default  ==============
[21:08:54] ========= [SKIPPED] xe_live_guc_g2g_kunit_default ==========
[21:08:54] ============== xe_live_guc_g2g_kunit_allmem  ===============
[21:08:54] ========== [SKIPPED] xe_live_guc_g2g_kunit_allmem ==========
[21:08:54] =================== [SKIPPED] xe_guc_g2g ===================
[21:08:54] =================== xe_mocs (2 subtests) ===================
[21:08:54] ================ xe_live_mocs_kernel_kunit  ================
[21:08:54] =========== [SKIPPED] xe_live_mocs_kernel_kunit ============
[21:08:54] ================ xe_live_mocs_reset_kunit  =================
[21:08:54] ============ [SKIPPED] xe_live_mocs_reset_kunit ============
[21:08:54] ==================== [SKIPPED] xe_mocs =====================
[21:08:54] ================= xe_migrate (2 subtests) ==================
[21:08:54] ================= xe_migrate_sanity_kunit  =================
[21:08:54] ============ [SKIPPED] xe_migrate_sanity_kunit =============
[21:08:54] ================== xe_validate_ccs_kunit  ==================
[21:08:54] ============= [SKIPPED] xe_validate_ccs_kunit ==============
[21:08:54] =================== [SKIPPED] xe_migrate ===================
[21:08:54] ================== xe_dma_buf (1 subtest) ==================
[21:08:54] ==================== xe_dma_buf_kunit  =====================
[21:08:54] ================ [SKIPPED] xe_dma_buf_kunit ================
[21:08:54] =================== [SKIPPED] xe_dma_buf ===================
[21:08:54] ================= xe_bo_shrink (1 subtest) =================
[21:08:54] =================== xe_bo_shrink_kunit  ====================
[21:08:54] =============== [SKIPPED] xe_bo_shrink_kunit ===============
[21:08:54] ================== [SKIPPED] xe_bo_shrink ==================
[21:08:54] ==================== xe_bo (2 subtests) ====================
[21:08:54] ================== xe_ccs_migrate_kunit  ===================
[21:08:54] ============== [SKIPPED] xe_ccs_migrate_kunit ==============
[21:08:54] ==================== xe_bo_evict_kunit  ====================
[21:08:54] =============== [SKIPPED] xe_bo_evict_kunit ================
[21:08:54] ===================== [SKIPPED] xe_bo ======================
[21:08:54] ==================== args (13 subtests) ====================
[21:08:54] [PASSED] count_args_test
[21:08:54] [PASSED] call_args_example
[21:08:54] [PASSED] call_args_test
[21:08:54] [PASSED] drop_first_arg_example
[21:08:54] [PASSED] drop_first_arg_test
[21:08:54] [PASSED] first_arg_example
[21:08:54] [PASSED] first_arg_test
[21:08:54] [PASSED] last_arg_example
[21:08:54] [PASSED] last_arg_test
[21:08:54] [PASSED] pick_arg_example
[21:08:54] [PASSED] if_args_example
[21:08:54] [PASSED] if_args_test
[21:08:54] [PASSED] sep_comma_example
[21:08:54] ====================== [PASSED] args =======================
[21:08:54] =================== xe_pci (3 subtests) ====================
[21:08:54] ==================== check_graphics_ip  ====================
[21:08:54] [PASSED] 12.00 Xe_LP
[21:08:54] [PASSED] 12.10 Xe_LP+
[21:08:54] [PASSED] 12.55 Xe_HPG
[21:08:54] [PASSED] 12.60 Xe_HPC
[21:08:54] [PASSED] 12.70 Xe_LPG
[21:08:54] [PASSED] 12.71 Xe_LPG
[21:08:54] [PASSED] 12.74 Xe_LPG+
[21:08:54] [PASSED] 20.01 Xe2_HPG
[21:08:54] [PASSED] 20.02 Xe2_HPG
[21:08:54] [PASSED] 20.04 Xe2_LPG
[21:08:54] [PASSED] 30.00 Xe3_LPG
[21:08:54] [PASSED] 30.01 Xe3_LPG
[21:08:54] [PASSED] 30.03 Xe3_LPG
[21:08:54] [PASSED] 30.04 Xe3_LPG
[21:08:54] [PASSED] 30.05 Xe3_LPG
[21:08:54] [PASSED] 35.11 Xe3p_XPC
[21:08:54] ================ [PASSED] check_graphics_ip ================
[21:08:54] ===================== check_media_ip  ======================
[21:08:54] [PASSED] 12.00 Xe_M
[21:08:54] [PASSED] 12.55 Xe_HPM
[21:08:54] [PASSED] 13.00 Xe_LPM+
[21:08:54] [PASSED] 13.01 Xe2_HPM
[21:08:54] [PASSED] 20.00 Xe2_LPM
[21:08:54] [PASSED] 30.00 Xe3_LPM
[21:08:54] [PASSED] 30.02 Xe3_LPM
[21:08:54] [PASSED] 35.00 Xe3p_LPM
[21:08:54] [PASSED] 35.03 Xe3p_HPM
[21:08:54] ================= [PASSED] check_media_ip ==================
[21:08:54] =================== check_platform_desc  ===================
[21:08:54] [PASSED] 0x9A60 (TIGERLAKE)
[21:08:54] [PASSED] 0x9A68 (TIGERLAKE)
[21:08:54] [PASSED] 0x9A70 (TIGERLAKE)
[21:08:54] [PASSED] 0x9A40 (TIGERLAKE)
[21:08:54] [PASSED] 0x9A49 (TIGERLAKE)
[21:08:54] [PASSED] 0x9A59 (TIGERLAKE)
[21:08:54] [PASSED] 0x9A78 (TIGERLAKE)
[21:08:54] [PASSED] 0x9AC0 (TIGERLAKE)
[21:08:54] [PASSED] 0x9AC9 (TIGERLAKE)
[21:08:54] [PASSED] 0x9AD9 (TIGERLAKE)
[21:08:54] [PASSED] 0x9AF8 (TIGERLAKE)
[21:08:54] [PASSED] 0x4C80 (ROCKETLAKE)
[21:08:54] [PASSED] 0x4C8A (ROCKETLAKE)
[21:08:54] [PASSED] 0x4C8B (ROCKETLAKE)
[21:08:54] [PASSED] 0x4C8C (ROCKETLAKE)
[21:08:54] [PASSED] 0x4C90 (ROCKETLAKE)
[21:08:54] [PASSED] 0x4C9A (ROCKETLAKE)
[21:08:54] [PASSED] 0x4680 (ALDERLAKE_S)
[21:08:54] [PASSED] 0x4682 (ALDERLAKE_S)
[21:08:54] [PASSED] 0x4688 (ALDERLAKE_S)
[21:08:54] [PASSED] 0x468A (ALDERLAKE_S)
[21:08:54] [PASSED] 0x468B (ALDERLAKE_S)
[21:08:54] [PASSED] 0x4690 (ALDERLAKE_S)
[21:08:54] [PASSED] 0x4692 (ALDERLAKE_S)
[21:08:54] [PASSED] 0x4693 (ALDERLAKE_S)
[21:08:54] [PASSED] 0x46A0 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46A1 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46A2 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46A3 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46A6 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46A8 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46AA (ALDERLAKE_P)
[21:08:54] [PASSED] 0x462A (ALDERLAKE_P)
[21:08:54] [PASSED] 0x4626 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x4628 (ALDERLAKE_P)
stty: 'standard input': Inappropriate ioctl for device
[21:08:54] [PASSED] 0x46B0 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46B1 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46B2 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46B3 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46C0 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46C1 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46C2 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46C3 (ALDERLAKE_P)
[21:08:54] [PASSED] 0x46D0 (ALDERLAKE_N)
[21:08:54] [PASSED] 0x46D1 (ALDERLAKE_N)
[21:08:54] [PASSED] 0x46D2 (ALDERLAKE_N)
[21:08:54] [PASSED] 0x46D3 (ALDERLAKE_N)
[21:08:54] [PASSED] 0x46D4 (ALDERLAKE_N)
[21:08:54] [PASSED] 0xA721 (ALDERLAKE_P)
[21:08:54] [PASSED] 0xA7A1 (ALDERLAKE_P)
[21:08:54] [PASSED] 0xA7A9 (ALDERLAKE_P)
[21:08:54] [PASSED] 0xA7AC (ALDERLAKE_P)
[21:08:54] [PASSED] 0xA7AD (ALDERLAKE_P)
[21:08:54] [PASSED] 0xA720 (ALDERLAKE_P)
[21:08:54] [PASSED] 0xA7A0 (ALDERLAKE_P)
[21:08:54] [PASSED] 0xA7A8 (ALDERLAKE_P)
[21:08:54] [PASSED] 0xA7AA (ALDERLAKE_P)
[21:08:54] [PASSED] 0xA7AB (ALDERLAKE_P)
[21:08:54] [PASSED] 0xA780 (ALDERLAKE_S)
[21:08:54] [PASSED] 0xA781 (ALDERLAKE_S)
[21:08:54] [PASSED] 0xA782 (ALDERLAKE_S)
[21:08:54] [PASSED] 0xA783 (ALDERLAKE_S)
[21:08:54] [PASSED] 0xA788 (ALDERLAKE_S)
[21:08:54] [PASSED] 0xA789 (ALDERLAKE_S)
[21:08:54] [PASSED] 0xA78A (ALDERLAKE_S)
[21:08:54] [PASSED] 0xA78B (ALDERLAKE_S)
[21:08:54] [PASSED] 0x4905 (DG1)
[21:08:54] [PASSED] 0x4906 (DG1)
[21:08:54] [PASSED] 0x4907 (DG1)
[21:08:54] [PASSED] 0x4908 (DG1)
[21:08:54] [PASSED] 0x4909 (DG1)
[21:08:54] [PASSED] 0x56C0 (DG2)
[21:08:54] [PASSED] 0x56C2 (DG2)
[21:08:54] [PASSED] 0x56C1 (DG2)
[21:08:54] [PASSED] 0x7D51 (METEORLAKE)
[21:08:54] [PASSED] 0x7DD1 (METEORLAKE)
[21:08:54] [PASSED] 0x7D41 (METEORLAKE)
[21:08:54] [PASSED] 0x7D67 (METEORLAKE)
[21:08:54] [PASSED] 0xB640 (METEORLAKE)
[21:08:54] [PASSED] 0x56A0 (DG2)
[21:08:54] [PASSED] 0x56A1 (DG2)
[21:08:54] [PASSED] 0x56A2 (DG2)
[21:08:54] [PASSED] 0x56BE (DG2)
[21:08:54] [PASSED] 0x56BF (DG2)
[21:08:54] [PASSED] 0x5690 (DG2)
[21:08:54] [PASSED] 0x5691 (DG2)
[21:08:54] [PASSED] 0x5692 (DG2)
[21:08:54] [PASSED] 0x56A5 (DG2)
[21:08:54] [PASSED] 0x56A6 (DG2)
[21:08:54] [PASSED] 0x56B0 (DG2)
[21:08:54] [PASSED] 0x56B1 (DG2)
[21:08:54] [PASSED] 0x56BA (DG2)
[21:08:54] [PASSED] 0x56BB (DG2)
[21:08:54] [PASSED] 0x56BC (DG2)
[21:08:54] [PASSED] 0x56BD (DG2)
[21:08:54] [PASSED] 0x5693 (DG2)
[21:08:54] [PASSED] 0x5694 (DG2)
[21:08:54] [PASSED] 0x5695 (DG2)
[21:08:54] [PASSED] 0x56A3 (DG2)
[21:08:54] [PASSED] 0x56A4 (DG2)
[21:08:54] [PASSED] 0x56B2 (DG2)
[21:08:54] [PASSED] 0x56B3 (DG2)
[21:08:54] [PASSED] 0x5696 (DG2)
[21:08:54] [PASSED] 0x5697 (DG2)
[21:08:54] [PASSED] 0xB69 (PVC)
[21:08:54] [PASSED] 0xB6E (PVC)
[21:08:54] [PASSED] 0xBD4 (PVC)
[21:08:54] [PASSED] 0xBD5 (PVC)
[21:08:54] [PASSED] 0xBD6 (PVC)
[21:08:54] [PASSED] 0xBD7 (PVC)
[21:08:54] [PASSED] 0xBD8 (PVC)
[21:08:54] [PASSED] 0xBD9 (PVC)
[21:08:54] [PASSED] 0xBDA (PVC)
[21:08:54] [PASSED] 0xBDB (PVC)
[21:08:54] [PASSED] 0xBE0 (PVC)
[21:08:54] [PASSED] 0xBE1 (PVC)
[21:08:54] [PASSED] 0xBE5 (PVC)
[21:08:54] [PASSED] 0x7D40 (METEORLAKE)
[21:08:54] [PASSED] 0x7D45 (METEORLAKE)
[21:08:54] [PASSED] 0x7D55 (METEORLAKE)
[21:08:54] [PASSED] 0x7D60 (METEORLAKE)
[21:08:54] [PASSED] 0x7DD5 (METEORLAKE)
[21:08:54] [PASSED] 0x6420 (LUNARLAKE)
[21:08:54] [PASSED] 0x64A0 (LUNARLAKE)
[21:08:54] [PASSED] 0x64B0 (LUNARLAKE)
[21:08:54] [PASSED] 0xE202 (BATTLEMAGE)
[21:08:54] [PASSED] 0xE209 (BATTLEMAGE)
[21:08:54] [PASSED] 0xE20B (BATTLEMAGE)
[21:08:54] [PASSED] 0xE20C (BATTLEMAGE)
[21:08:54] [PASSED] 0xE20D (BATTLEMAGE)
[21:08:54] [PASSED] 0xE210 (BATTLEMAGE)
[21:08:54] [PASSED] 0xE211 (BATTLEMAGE)
[21:08:54] [PASSED] 0xE212 (BATTLEMAGE)
[21:08:54] [PASSED] 0xE216 (BATTLEMAGE)
[21:08:54] [PASSED] 0xE220 (BATTLEMAGE)
[21:08:54] [PASSED] 0xE221 (BATTLEMAGE)
[21:08:54] [PASSED] 0xE222 (BATTLEMAGE)
[21:08:54] [PASSED] 0xE223 (BATTLEMAGE)
[21:08:54] [PASSED] 0xB080 (PANTHERLAKE)
[21:08:54] [PASSED] 0xB081 (PANTHERLAKE)
[21:08:54] [PASSED] 0xB082 (PANTHERLAKE)
[21:08:54] [PASSED] 0xB083 (PANTHERLAKE)
[21:08:54] [PASSED] 0xB084 (PANTHERLAKE)
[21:08:54] [PASSED] 0xB085 (PANTHERLAKE)
[21:08:54] [PASSED] 0xB086 (PANTHERLAKE)
[21:08:54] [PASSED] 0xB087 (PANTHERLAKE)
[21:08:54] [PASSED] 0xB08F (PANTHERLAKE)
[21:08:54] [PASSED] 0xB090 (PANTHERLAKE)
[21:08:54] [PASSED] 0xB0A0 (PANTHERLAKE)
[21:08:54] [PASSED] 0xB0B0 (PANTHERLAKE)
[21:08:54] [PASSED] 0xFD80 (PANTHERLAKE)
[21:08:54] [PASSED] 0xFD81 (PANTHERLAKE)
[21:08:54] [PASSED] 0xD740 (NOVALAKE_S)
[21:08:54] [PASSED] 0xD741 (NOVALAKE_S)
[21:08:54] [PASSED] 0xD742 (NOVALAKE_S)
[21:08:54] [PASSED] 0xD743 (NOVALAKE_S)
[21:08:54] [PASSED] 0xD744 (NOVALAKE_S)
[21:08:54] [PASSED] 0xD745 (NOVALAKE_S)
[21:08:54] [PASSED] 0x674C (CRESCENTISLAND)
[21:08:54] =============== [PASSED] check_platform_desc ===============
[21:08:54] ===================== [PASSED] xe_pci ======================
[21:08:54] =================== xe_rtp (2 subtests) ====================
[21:08:54] =============== xe_rtp_process_to_sr_tests  ================
[21:08:54] [PASSED] coalesce-same-reg
[21:08:54] [PASSED] no-match-no-add
[21:08:54] [PASSED] match-or
[21:08:54] [PASSED] match-or-xfail
[21:08:54] [PASSED] no-match-no-add-multiple-rules
[21:08:54] [PASSED] two-regs-two-entries
[21:08:54] [PASSED] clr-one-set-other
[21:08:54] [PASSED] set-field
[21:08:54] [PASSED] conflict-duplicate
[21:08:54] [PASSED] conflict-not-disjoint
[21:08:54] [PASSED] conflict-reg-type
[21:08:54] =========== [PASSED] xe_rtp_process_to_sr_tests ============
[21:08:54] ================== xe_rtp_process_tests  ===================
[21:08:54] [PASSED] active1
[21:08:54] [PASSED] active2
[21:08:54] [PASSED] active-inactive
[21:08:54] [PASSED] inactive-active
[21:08:54] [PASSED] inactive-1st_or_active-inactive
[21:08:54] [PASSED] inactive-2nd_or_active-inactive
[21:08:54] [PASSED] inactive-last_or_active-inactive
[21:08:54] [PASSED] inactive-no_or_active-inactive
[21:08:54] ============== [PASSED] xe_rtp_process_tests ===============
[21:08:54] ===================== [PASSED] xe_rtp ======================
[21:08:54] ==================== xe_wa (1 subtest) =====================
[21:08:54] ======================== xe_wa_gt  =========================
[21:08:54] [PASSED] TIGERLAKE B0
[21:08:54] [PASSED] DG1 A0
[21:08:54] [PASSED] DG1 B0
[21:08:54] [PASSED] ALDERLAKE_S A0
[21:08:54] [PASSED] ALDERLAKE_S B0
[21:08:54] [PASSED] ALDERLAKE_S C0
[21:08:54] [PASSED] ALDERLAKE_S D0
[21:08:54] [PASSED] ALDERLAKE_P A0
[21:08:54] [PASSED] ALDERLAKE_P B0
[21:08:54] [PASSED] ALDERLAKE_P C0
[21:08:54] [PASSED] ALDERLAKE_S RPLS D0
[21:08:54] [PASSED] ALDERLAKE_P RPLU E0
[21:08:54] [PASSED] DG2 G10 C0
[21:08:54] [PASSED] DG2 G11 B1
[21:08:54] [PASSED] DG2 G12 A1
[21:08:54] [PASSED] METEORLAKE 12.70(Xe_LPG) A0 13.00(Xe_LPM+) A0
[21:08:54] [PASSED] METEORLAKE 12.71(Xe_LPG) A0 13.00(Xe_LPM+) A0
[21:08:54] [PASSED] METEORLAKE 12.74(Xe_LPG+) A0 13.00(Xe_LPM+) A0
[21:08:54] [PASSED] LUNARLAKE 20.04(Xe2_LPG) A0 20.00(Xe2_LPM) A0
[21:08:54] [PASSED] LUNARLAKE 20.04(Xe2_LPG) B0 20.00(Xe2_LPM) A0
[21:08:54] [PASSED] BATTLEMAGE 20.01(Xe2_HPG) A0 13.01(Xe2_HPM) A1
[21:08:54] [PASSED] PANTHERLAKE 30.00(Xe3_LPG) A0 30.00(Xe3_LPM) A0
[21:08:54] ==================== [PASSED] xe_wa_gt =====================
[21:08:54] ====================== [PASSED] xe_wa ======================
[21:08:54] ============================================================
[21:08:54] Testing complete. Ran 512 tests: passed: 494, skipped: 18
[21:08:54] Elapsed time: 36.329s total, 4.255s configuring, 31.603s building, 0.460s running

+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/tests/.kunitconfig [21:08:54] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:

$ make ARCH=um O=.kunit olddefconfig
[21:08:56] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[21:09:22] Starting KUnit Kernel (1/1)...
[21:09:22] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[21:09:22] ============ drm_test_pick_cmdline (2 subtests) ============
[21:09:22] [PASSED] drm_test_pick_cmdline_res_1920_1080_60
[21:09:22] =============== drm_test_pick_cmdline_named  ===============
[21:09:22] [PASSED] NTSC
[21:09:22] [PASSED] NTSC-J
[21:09:22] [PASSED] PAL
[21:09:22] [PASSED] PAL-M
[21:09:22] =========== [PASSED] drm_test_pick_cmdline_named ===========
[21:09:22] ============== [PASSED] drm_test_pick_cmdline ==============
[21:09:22] == drm_test_atomic_get_connector_for_encoder (1 subtest) ===
[21:09:22] [PASSED] drm_test_drm_atomic_get_connector_for_encoder
[21:09:22] ==== [PASSED] drm_test_atomic_get_connector_for_encoder ====
[21:09:22] =========== drm_validate_clone_mode (2 subtests) ===========
[21:09:22] ============== drm_test_check_in_clone_mode  ===============
[21:09:22] [PASSED] in_clone_mode
[21:09:22] [PASSED] not_in_clone_mode
[21:09:22] ========== [PASSED] drm_test_check_in_clone_mode ===========
[21:09:22] =============== drm_test_check_valid_clones  ===============
[21:09:22] [PASSED] not_in_clone_mode
[21:09:22] [PASSED] valid_clone
[21:09:22] [PASSED] invalid_clone
[21:09:22] =========== [PASSED] drm_test_check_valid_clones ===========
[21:09:22] ============= [PASSED] drm_validate_clone_mode =============
[21:09:22] ============= drm_validate_modeset (1 subtest) =============
[21:09:22] [PASSED] drm_test_check_connector_changed_modeset
[21:09:22] ============== [PASSED] drm_validate_modeset ===============
[21:09:22] ====== drm_test_bridge_get_current_state (2 subtests) ======
[21:09:22] [PASSED] drm_test_drm_bridge_get_current_state_atomic
[21:09:22] [PASSED] drm_test_drm_bridge_get_current_state_legacy
[21:09:22] ======== [PASSED] drm_test_bridge_get_current_state ========
[21:09:22] ====== drm_test_bridge_helper_reset_crtc (3 subtests) ======
[21:09:22] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic
[21:09:22] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic_disabled
[21:09:22] [PASSED] drm_test_drm_bridge_helper_reset_crtc_legacy
[21:09:22] ======== [PASSED] drm_test_bridge_helper_reset_crtc ========
[21:09:22] ============== drm_bridge_alloc (2 subtests) ===============
[21:09:22] [PASSED] drm_test_drm_bridge_alloc_basic
[21:09:22] [PASSED] drm_test_drm_bridge_alloc_get_put
[21:09:22] ================ [PASSED] drm_bridge_alloc =================
[21:09:22] ================== drm_buddy (8 subtests) ==================
[21:09:22] [PASSED] drm_test_buddy_alloc_limit
[21:09:22] [PASSED] drm_test_buddy_alloc_optimistic
[21:09:22] [PASSED] drm_test_buddy_alloc_pessimistic
[21:09:22] [PASSED] drm_test_buddy_alloc_pathological
[21:09:22] [PASSED] drm_test_buddy_alloc_contiguous
[21:09:22] [PASSED] drm_test_buddy_alloc_clear
[21:09:22] [PASSED] drm_test_buddy_alloc_range_bias
[21:09:22] [PASSED] drm_test_buddy_fragmentation_performance
[21:09:22] ==================== [PASSED] drm_buddy ====================
[21:09:22] ============= drm_cmdline_parser (40 subtests) =============
[21:09:22] [PASSED] drm_test_cmdline_force_d_only
[21:09:22] [PASSED] drm_test_cmdline_force_D_only_dvi
[21:09:22] [PASSED] drm_test_cmdline_force_D_only_hdmi
[21:09:22] [PASSED] drm_test_cmdline_force_D_only_not_digital
[21:09:22] [PASSED] drm_test_cmdline_force_e_only
[21:09:22] [PASSED] drm_test_cmdline_res
[21:09:22] [PASSED] drm_test_cmdline_res_vesa
[21:09:22] [PASSED] drm_test_cmdline_res_vesa_rblank
[21:09:22] [PASSED] drm_test_cmdline_res_rblank
[21:09:22] [PASSED] drm_test_cmdline_res_bpp
[21:09:22] [PASSED] drm_test_cmdline_res_refresh
[21:09:22] [PASSED] drm_test_cmdline_res_bpp_refresh
[21:09:22] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced
[21:09:22] [PASSED] drm_test_cmdline_res_bpp_refresh_margins
[21:09:22] [PASSED] drm_test_cmdline_res_bpp_refresh_force_off
[21:09:22] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on
[21:09:22] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_analog
[21:09:22] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_digital
[21:09:22] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced_margins_force_on
[21:09:22] [PASSED] drm_test_cmdline_res_margins_force_on
[21:09:22] [PASSED] drm_test_cmdline_res_vesa_margins
[21:09:22] [PASSED] drm_test_cmdline_name
[21:09:22] [PASSED] drm_test_cmdline_name_bpp
[21:09:22] [PASSED] drm_test_cmdline_name_option
[21:09:22] [PASSED] drm_test_cmdline_name_bpp_option
[21:09:22] [PASSED] drm_test_cmdline_rotate_0
[21:09:22] [PASSED] drm_test_cmdline_rotate_90
[21:09:22] [PASSED] drm_test_cmdline_rotate_180
[21:09:22] [PASSED] drm_test_cmdline_rotate_270
[21:09:22] [PASSED] drm_test_cmdline_hmirror
[21:09:22] [PASSED] drm_test_cmdline_vmirror
[21:09:22] [PASSED] drm_test_cmdline_margin_options
[21:09:22] [PASSED] drm_test_cmdline_multiple_options
[21:09:22] [PASSED] drm_test_cmdline_bpp_extra_and_option
[21:09:22] [PASSED] drm_test_cmdline_extra_and_option
[21:09:22] [PASSED] drm_test_cmdline_freestanding_options
[21:09:22] [PASSED] drm_test_cmdline_freestanding_force_e_and_options
[21:09:22] [PASSED] drm_test_cmdline_panel_orientation
[21:09:22] ================ drm_test_cmdline_invalid  =================
[21:09:22] [PASSED] margin_only
[21:09:22] [PASSED] interlace_only
[21:09:22] [PASSED] res_missing_x
[21:09:22] [PASSED] res_missing_y
[21:09:22] [PASSED] res_bad_y
[21:09:22] [PASSED] res_missing_y_bpp
[21:09:22] [PASSED] res_bad_bpp
[21:09:22] [PASSED] res_bad_refresh
[21:09:22] [PASSED] res_bpp_refresh_force_on_off
[21:09:22] [PASSED] res_invalid_mode
[21:09:22] [PASSED] res_bpp_wrong_place_mode
[21:09:22] [PASSED] name_bpp_refresh
[21:09:22] [PASSED] name_refresh
[21:09:22] [PASSED] name_refresh_wrong_mode
[21:09:22] [PASSED] name_refresh_invalid_mode
[21:09:22] [PASSED] rotate_multiple
[21:09:22] [PASSED] rotate_invalid_val
[21:09:22] [PASSED] rotate_truncated
[21:09:22] [PASSED] invalid_option
[21:09:22] [PASSED] invalid_tv_option
[21:09:22] [PASSED] truncated_tv_option
[21:09:22] ============ [PASSED] drm_test_cmdline_invalid =============
[21:09:22] =============== drm_test_cmdline_tv_options  ===============
[21:09:22] [PASSED] NTSC
[21:09:22] [PASSED] NTSC_443
[21:09:22] [PASSED] NTSC_J
[21:09:22] [PASSED] PAL
[21:09:22] [PASSED] PAL_M
[21:09:22] [PASSED] PAL_N
[21:09:22] [PASSED] SECAM
[21:09:22] [PASSED] MONO_525
[21:09:22] [PASSED] MONO_625
[21:09:22] =========== [PASSED] drm_test_cmdline_tv_options ===========
[21:09:22] =============== [PASSED] drm_cmdline_parser ================
[21:09:22] ========== drmm_connector_hdmi_init (20 subtests) ==========
[21:09:22] [PASSED] drm_test_connector_hdmi_init_valid
[21:09:22] [PASSED] drm_test_connector_hdmi_init_bpc_8
[21:09:22] [PASSED] drm_test_connector_hdmi_init_bpc_10
[21:09:22] [PASSED] drm_test_connector_hdmi_init_bpc_12
[21:09:22] [PASSED] drm_test_connector_hdmi_init_bpc_invalid
[21:09:22] [PASSED] drm_test_connector_hdmi_init_bpc_null
[21:09:22] [PASSED] drm_test_connector_hdmi_init_formats_empty
[21:09:22] [PASSED] drm_test_connector_hdmi_init_formats_no_rgb
[21:09:22] === drm_test_connector_hdmi_init_formats_yuv420_allowed  ===
[21:09:22] [PASSED] supported_formats=0x9 yuv420_allowed=1
[21:09:22] [PASSED] supported_formats=0x9 yuv420_allowed=0
[21:09:22] [PASSED] supported_formats=0x3 yuv420_allowed=1
[21:09:22] [PASSED] supported_formats=0x3 yuv420_allowed=0
[21:09:22] === [PASSED] drm_test_connector_hdmi_init_formats_yuv420_allowed ===
[21:09:22] [PASSED] drm_test_connector_hdmi_init_null_ddc
[21:09:22] [PASSED] drm_test_connector_hdmi_init_null_product
[21:09:22] [PASSED] drm_test_connector_hdmi_init_null_vendor
[21:09:22] [PASSED] drm_test_connector_hdmi_init_product_length_exact
[21:09:22] [PASSED] drm_test_connector_hdmi_init_product_length_too_long
[21:09:22] [PASSED] drm_test_connector_hdmi_init_product_valid
[21:09:22] [PASSED] drm_test_connector_hdmi_init_vendor_length_exact
[21:09:22] [PASSED] drm_test_connector_hdmi_init_vendor_length_too_long
[21:09:22] [PASSED] drm_test_connector_hdmi_init_vendor_valid
[21:09:22] ========= drm_test_connector_hdmi_init_type_valid  =========
[21:09:22] [PASSED] HDMI-A
[21:09:22] [PASSED] HDMI-B
[21:09:22] ===== [PASSED] drm_test_connector_hdmi_init_type_valid =====
[21:09:22] ======== drm_test_connector_hdmi_init_type_invalid  ========
[21:09:22] [PASSED] Unknown
[21:09:22] [PASSED] VGA
[21:09:22] [PASSED] DVI-I
[21:09:22] [PASSED] DVI-D
[21:09:22] [PASSED] DVI-A
[21:09:22] [PASSED] Composite
[21:09:22] [PASSED] SVIDEO
[21:09:22] [PASSED] LVDS
[21:09:22] [PASSED] Component
[21:09:22] [PASSED] DIN
[21:09:22] [PASSED] DP
[21:09:22] [PASSED] TV
[21:09:22] [PASSED] eDP
[21:09:22] [PASSED] Virtual
[21:09:22] [PASSED] DSI
[21:09:22] [PASSED] DPI
[21:09:22] [PASSED] Writeback
[21:09:22] [PASSED] SPI
[21:09:22] [PASSED] USB
[21:09:22] ==== [PASSED] drm_test_connector_hdmi_init_type_invalid ====
[21:09:22] ============ [PASSED] drmm_connector_hdmi_init =============
[21:09:22] ============= drmm_connector_init (3 subtests) =============
[21:09:22] [PASSED] drm_test_drmm_connector_init
[21:09:22] [PASSED] drm_test_drmm_connector_init_null_ddc
[21:09:22] ========= drm_test_drmm_connector_init_type_valid  =========
[21:09:22] [PASSED] Unknown
[21:09:22] [PASSED] VGA
[21:09:22] [PASSED] DVI-I
[21:09:22] [PASSED] DVI-D
[21:09:22] [PASSED] DVI-A
[21:09:22] [PASSED] Composite
[21:09:22] [PASSED] SVIDEO
[21:09:22] [PASSED] LVDS
[21:09:22] [PASSED] Component
[21:09:22] [PASSED] DIN
[21:09:22] [PASSED] DP
[21:09:22] [PASSED] HDMI-A
[21:09:22] [PASSED] HDMI-B
[21:09:22] [PASSED] TV
[21:09:22] [PASSED] eDP
[21:09:22] [PASSED] Virtual
[21:09:22] [PASSED] DSI
[21:09:22] [PASSED] DPI
[21:09:22] [PASSED] Writeback
[21:09:22] [PASSED] SPI
[21:09:22] [PASSED] USB
[21:09:22] ===== [PASSED] drm_test_drmm_connector_init_type_valid =====
[21:09:22] =============== [PASSED] drmm_connector_init ===============
[21:09:22] ========= drm_connector_dynamic_init (6 subtests) ==========
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_init
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_init_null_ddc
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_init_not_added
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_init_properties
[21:09:22] ===== drm_test_drm_connector_dynamic_init_type_valid  ======
[21:09:22] [PASSED] Unknown
[21:09:22] [PASSED] VGA
[21:09:22] [PASSED] DVI-I
[21:09:22] [PASSED] DVI-D
[21:09:22] [PASSED] DVI-A
[21:09:22] [PASSED] Composite
[21:09:22] [PASSED] SVIDEO
[21:09:22] [PASSED] LVDS
[21:09:22] [PASSED] Component
[21:09:22] [PASSED] DIN
[21:09:22] [PASSED] DP
[21:09:22] [PASSED] HDMI-A
[21:09:22] [PASSED] HDMI-B
[21:09:22] [PASSED] TV
[21:09:22] [PASSED] eDP
[21:09:22] [PASSED] Virtual
[21:09:22] [PASSED] DSI
[21:09:22] [PASSED] DPI
[21:09:22] [PASSED] Writeback
[21:09:22] [PASSED] SPI
[21:09:22] [PASSED] USB
[21:09:22] = [PASSED] drm_test_drm_connector_dynamic_init_type_valid ==
[21:09:22] ======== drm_test_drm_connector_dynamic_init_name  =========
[21:09:22] [PASSED] Unknown
[21:09:22] [PASSED] VGA
[21:09:22] [PASSED] DVI-I
[21:09:22] [PASSED] DVI-D
[21:09:22] [PASSED] DVI-A
[21:09:22] [PASSED] Composite
[21:09:22] [PASSED] SVIDEO
[21:09:22] [PASSED] LVDS
[21:09:22] [PASSED] Component
[21:09:22] [PASSED] DIN
[21:09:22] [PASSED] DP
[21:09:22] [PASSED] HDMI-A
[21:09:22] [PASSED] HDMI-B
[21:09:22] [PASSED] TV
[21:09:22] [PASSED] eDP
[21:09:22] [PASSED] Virtual
[21:09:22] [PASSED] DSI
[21:09:22] [PASSED] DPI
[21:09:22] [PASSED] Writeback
[21:09:22] [PASSED] SPI
[21:09:22] [PASSED] USB
[21:09:22] ==== [PASSED] drm_test_drm_connector_dynamic_init_name =====
[21:09:22] =========== [PASSED] drm_connector_dynamic_init ============
[21:09:22] ==== drm_connector_dynamic_register_early (4 subtests) =====
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_register_early_on_list
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_register_early_defer
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_register_early_no_init
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_register_early_no_mode_object
[21:09:22] ====== [PASSED] drm_connector_dynamic_register_early =======
[21:09:22] ======= drm_connector_dynamic_register (7 subtests) ========
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_register_on_list
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_register_no_defer
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_register_no_init
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_register_mode_object
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_register_sysfs
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_register_sysfs_name
[21:09:22] [PASSED] drm_test_drm_connector_dynamic_register_debugfs
[21:09:22] ========= [PASSED] drm_connector_dynamic_register ==========
[21:09:22] = drm_connector_attach_broadcast_rgb_property (2 subtests) =
[21:09:22] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property
[21:09:22] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector
[21:09:22] === [PASSED] drm_connector_attach_broadcast_rgb_property ===
[21:09:22] ========== drm_get_tv_mode_from_name (2 subtests) ==========
[21:09:22] ========== drm_test_get_tv_mode_from_name_valid  ===========
[21:09:22] [PASSED] NTSC
[21:09:22] [PASSED] NTSC-443
[21:09:22] [PASSED] NTSC-J
[21:09:22] [PASSED] PAL
[21:09:22] [PASSED] PAL-M
[21:09:22] [PASSED] PAL-N
[21:09:22] [PASSED] SECAM
[21:09:22] [PASSED] Mono
[21:09:22] ====== [PASSED] drm_test_get_tv_mode_from_name_valid =======
[21:09:22] [PASSED] drm_test_get_tv_mode_from_name_truncated
[21:09:22] ============ [PASSED] drm_get_tv_mode_from_name ============
[21:09:22] = drm_test_connector_hdmi_compute_mode_clock (12 subtests) =
[21:09:22] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb
[21:09:22] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc
[21:09:22] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1
[21:09:22] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc
[21:09:22] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1
[21:09:22] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_double
[21:09:22] = drm_test_connector_hdmi_compute_mode_clock_yuv420_valid  =
[21:09:22] [PASSED] VIC 96
[21:09:22] [PASSED] VIC 97
[21:09:22] [PASSED] VIC 101
[21:09:22] [PASSED] VIC 102
[21:09:22] [PASSED] VIC 106
[21:09:22] [PASSED] VIC 107
[21:09:22] === [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_valid ===
[21:09:22] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc
[21:09:22] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc
[21:09:22] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc
[21:09:22] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc
[21:09:22] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc
[21:09:22] === [PASSED] drm_test_connector_hdmi_compute_mode_clock ====
[21:09:22] == drm_hdmi_connector_get_broadcast_rgb_name (2 subtests) ==
[21:09:22] === drm_test_drm_hdmi_connector_get_broadcast_rgb_name  ====
[21:09:22] [PASSED] Automatic
[21:09:22] [PASSED] Full
[21:09:22] [PASSED] Limited 16:235
[21:09:22] === [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name ===
[21:09:22] [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name_invalid
[21:09:22] ==== [PASSED] drm_hdmi_connector_get_broadcast_rgb_name ====
[21:09:22] == drm_hdmi_connector_get_output_format_name (2 subtests) ==
[21:09:22] === drm_test_drm_hdmi_connector_get_output_format_name  ====
[21:09:22] [PASSED] RGB
[21:09:22] [PASSED] YUV 4:2:0
[21:09:22] [PASSED] YUV 4:2:2
[21:09:22] [PASSED] YUV 4:4:4
[21:09:22] === [PASSED] drm_test_drm_hdmi_connector_get_output_format_name ===
[21:09:22] [PASSED] drm_test_drm_hdmi_connector_get_output_format_name_invalid
[21:09:22] ==== [PASSED] drm_hdmi_connector_get_output_format_name ====
[21:09:22] ============= drm_damage_helper (21 subtests) ==============
[21:09:22] [PASSED] drm_test_damage_iter_no_damage
[21:09:22] [PASSED] drm_test_damage_iter_no_damage_fractional_src
[21:09:22] [PASSED] drm_test_damage_iter_no_damage_src_moved
[21:09:22] [PASSED] drm_test_damage_iter_no_damage_fractional_src_moved
[21:09:22] [PASSED] drm_test_damage_iter_no_damage_not_visible
[21:09:22] [PASSED] drm_test_damage_iter_no_damage_no_crtc
[21:09:22] [PASSED] drm_test_damage_iter_no_damage_no_fb
[21:09:22] [PASSED] drm_test_damage_iter_simple_damage
[21:09:22] [PASSED] drm_test_damage_iter_single_damage
[21:09:22] [PASSED] drm_test_damage_iter_single_damage_intersect_src
[21:09:22] [PASSED] drm_test_damage_iter_single_damage_outside_src
[21:09:22] [PASSED] drm_test_damage_iter_single_damage_fractional_src
[21:09:22] [PASSED] drm_test_damage_iter_single_damage_intersect_fractional_src
[21:09:22] [PASSED] drm_test_damage_iter_single_damage_outside_fractional_src
[21:09:22] [PASSED] drm_test_damage_iter_single_damage_src_moved
[21:09:22] [PASSED] drm_test_damage_iter_single_damage_fractional_src_moved
[21:09:22] [PASSED] drm_test_damage_iter_damage
[21:09:22] [PASSED] drm_test_damage_iter_damage_one_intersect
[21:09:22] [PASSED] drm_test_damage_iter_damage_one_outside
[21:09:22] [PASSED] drm_test_damage_iter_damage_src_moved
[21:09:22] [PASSED] drm_test_damage_iter_damage_not_visible
[21:09:22] ================ [PASSED] drm_damage_helper ================
[21:09:22] ============== drm_dp_mst_helper (3 subtests) ==============
[21:09:22] ============== drm_test_dp_mst_calc_pbn_mode  ==============
[21:09:22] [PASSED] Clock 154000 BPP 30 DSC disabled
[21:09:22] [PASSED] Clock 234000 BPP 30 DSC disabled
[21:09:22] [PASSED] Clock 297000 BPP 24 DSC disabled
[21:09:22] [PASSED] Clock 332880 BPP 24 DSC enabled
[21:09:22] [PASSED] Clock 324540 BPP 24 DSC enabled
[21:09:22] ========== [PASSED] drm_test_dp_mst_calc_pbn_mode ==========
[21:09:22] ============== drm_test_dp_mst_calc_pbn_div  ===============
[21:09:22] [PASSED] Link rate 2000000 lane count 4
[21:09:22] [PASSED] Link rate 2000000 lane count 2
[21:09:22] [PASSED] Link rate 2000000 lane count 1
[21:09:22] [PASSED] Link rate 1350000 lane count 4
[21:09:22] [PASSED] Link rate 1350000 lane count 2
[21:09:22] [PASSED] Link rate 1350000 lane count 1
[21:09:22] [PASSED] Link rate 1000000 lane count 4
[21:09:22] [PASSED] Link rate 1000000 lane count 2
[21:09:22] [PASSED] Link rate 1000000 lane count 1
[21:09:22] [PASSED] Link rate 810000 lane count 4
[21:09:22] [PASSED] Link rate 810000 lane count 2
[21:09:22] [PASSED] Link rate 810000 lane count 1
[21:09:22] [PASSED] Link rate 540000 lane count 4
[21:09:22] [PASSED] Link rate 540000 lane count 2
[21:09:22] [PASSED] Link rate 540000 lane count 1
[21:09:22] [PASSED] Link rate 270000 lane count 4
[21:09:22] [PASSED] Link rate 270000 lane count 2
[21:09:22] [PASSED] Link rate 270000 lane count 1
[21:09:22] [PASSED] Link rate 162000 lane count 4
[21:09:22] [PASSED] Link rate 162000 lane count 2
[21:09:22] [PASSED] Link rate 162000 lane count 1
[21:09:22] ========== [PASSED] drm_test_dp_mst_calc_pbn_div ===========
[21:09:22] ========= drm_test_dp_mst_sideband_msg_req_decode  =========
[21:09:22] [PASSED] DP_ENUM_PATH_RESOURCES with port number
[21:09:22] [PASSED] DP_POWER_UP_PHY with port number
[21:09:22] [PASSED] DP_POWER_DOWN_PHY with port number
[21:09:22] [PASSED] DP_ALLOCATE_PAYLOAD with SDP stream sinks
[21:09:22] [PASSED] DP_ALLOCATE_PAYLOAD with port number
[21:09:22] [PASSED] DP_ALLOCATE_PAYLOAD with VCPI
[21:09:22] [PASSED] DP_ALLOCATE_PAYLOAD with PBN
[21:09:22] [PASSED] DP_QUERY_PAYLOAD with port number
[21:09:22] [PASSED] DP_QUERY_PAYLOAD with VCPI
[21:09:22] [PASSED] DP_REMOTE_DPCD_READ with port number
[21:09:22] [PASSED] DP_REMOTE_DPCD_READ with DPCD address
[21:09:22] [PASSED] DP_REMOTE_DPCD_READ with max number of bytes
[21:09:22] [PASSED] DP_REMOTE_DPCD_WRITE with port number
[21:09:22] [PASSED] DP_REMOTE_DPCD_WRITE with DPCD address
[21:09:22] [PASSED] DP_REMOTE_DPCD_WRITE with data array
[21:09:22] [PASSED] DP_REMOTE_I2C_READ with port number
[21:09:22] [PASSED] DP_REMOTE_I2C_READ with I2C device ID
[21:09:22] [PASSED] DP_REMOTE_I2C_READ with transactions array
[21:09:22] [PASSED] DP_REMOTE_I2C_WRITE with port number
[21:09:22] [PASSED] DP_REMOTE_I2C_WRITE with I2C device ID
[21:09:22] [PASSED] DP_REMOTE_I2C_WRITE with data array
[21:09:22] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream ID
[21:09:22] [PASSED] DP_QUERY_STREAM_ENC_STATUS with client ID
[21:09:22] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream event
[21:09:22] [PASSED] DP_QUERY_STREAM_ENC_STATUS with valid stream event
[21:09:22] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream behavior
[21:09:22] [PASSED] DP_QUERY_STREAM_ENC_STATUS with a valid stream behavior
[21:09:22] ===== [PASSED] drm_test_dp_mst_sideband_msg_req_decode =====
[21:09:22] ================ [PASSED] drm_dp_mst_helper ================
[21:09:22] ================== drm_exec (7 subtests) ===================
[21:09:22] [PASSED] sanitycheck
[21:09:22] [PASSED] test_lock
[21:09:22] [PASSED] test_lock_unlock
[21:09:22] [PASSED] test_duplicates
[21:09:22] [PASSED] test_prepare
[21:09:22] [PASSED] test_prepare_array
[21:09:22] [PASSED] test_multiple_loops
[21:09:22] ==================== [PASSED] drm_exec =====================
[21:09:22] =========== drm_format_helper_test (17 subtests) ===========
[21:09:22] ============== drm_test_fb_xrgb8888_to_gray8  ==============
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ========== [PASSED] drm_test_fb_xrgb8888_to_gray8 ==========
[21:09:22] ============= drm_test_fb_xrgb8888_to_rgb332  ==============
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb332 ==========
[21:09:22] ============= drm_test_fb_xrgb8888_to_rgb565  ==============
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb565 ==========
[21:09:22] ============ drm_test_fb_xrgb8888_to_xrgb1555  =============
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ======== [PASSED] drm_test_fb_xrgb8888_to_xrgb1555 =========
[21:09:22] ============ drm_test_fb_xrgb8888_to_argb1555  =============
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ======== [PASSED] drm_test_fb_xrgb8888_to_argb1555 =========
[21:09:22] ============ drm_test_fb_xrgb8888_to_rgba5551  =============
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ======== [PASSED] drm_test_fb_xrgb8888_to_rgba5551 =========
[21:09:22] ============= drm_test_fb_xrgb8888_to_rgb888  ==============
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb888 ==========
[21:09:22] ============= drm_test_fb_xrgb8888_to_bgr888  ==============
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ========= [PASSED] drm_test_fb_xrgb8888_to_bgr888 ==========
[21:09:22] ============ drm_test_fb_xrgb8888_to_argb8888  =============
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ======== [PASSED] drm_test_fb_xrgb8888_to_argb8888 =========
[21:09:22] =========== drm_test_fb_xrgb8888_to_xrgb2101010  ===========
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ======= [PASSED] drm_test_fb_xrgb8888_to_xrgb2101010 =======
[21:09:22] =========== drm_test_fb_xrgb8888_to_argb2101010  ===========
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ======= [PASSED] drm_test_fb_xrgb8888_to_argb2101010 =======
[21:09:22] ============== drm_test_fb_xrgb8888_to_mono  ===============
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ========== [PASSED] drm_test_fb_xrgb8888_to_mono ===========
[21:09:22] ==================== drm_test_fb_swab  =====================
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ================ [PASSED] drm_test_fb_swab =================
[21:09:22] ============ drm_test_fb_xrgb8888_to_xbgr8888  =============
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ======== [PASSED] drm_test_fb_xrgb8888_to_xbgr8888 =========
[21:09:22] ============ drm_test_fb_xrgb8888_to_abgr8888  =============
[21:09:22] [PASSED] single_pixel_source_buffer
[21:09:22] [PASSED] single_pixel_clip_rectangle
[21:09:22] [PASSED] well_known_colors
[21:09:22] [PASSED] destination_pitch
[21:09:22] ======== [PASSED] drm_test_fb_xrgb8888_to_abgr8888 =========
[21:09:22] ================= drm_test_fb_clip_offset  =================
[21:09:22] [PASSED] pass through
[21:09:22] [PASSED] horizontal offset
[21:09:22] [PASSED] vertical offset
[21:09:22] [PASSED] horizontal and vertical offset
[21:09:22] [PASSED] horizontal offset (custom pitch)
[21:09:22] [PASSED] vertical offset (custom pitch)
[21:09:22] [PASSED] horizontal and vertical offset (custom pitch)
[21:09:22] ============= [PASSED] drm_test_fb_clip_offset =============
[21:09:22] =================== drm_test_fb_memcpy  ====================
[21:09:22] [PASSED] single_pixel_source_buffer: XR24 little-endian (0x34325258)
[21:09:22] [PASSED] single_pixel_source_buffer: XRA8 little-endian (0x38415258)
[21:09:22] [PASSED] single_pixel_source_buffer: YU24 little-endian (0x34325559)
[21:09:22] [PASSED] single_pixel_clip_rectangle: XB24 little-endian (0x34324258)
[21:09:22] [PASSED] single_pixel_clip_rectangle: XRA8 little-endian (0x38415258)
[21:09:22] [PASSED] single_pixel_clip_rectangle: YU24 little-endian (0x34325559)
[21:09:22] [PASSED] well_known_colors: XB24 little-endian (0x34324258)
[21:09:22] [PASSED] well_known_colors: XRA8 little-endian (0x38415258)
[21:09:22] [PASSED] well_known_colors: YU24 little-endian (0x34325559)
[21:09:22] [PASSED] destination_pitch: XB24 little-endian (0x34324258)
[21:09:22] [PASSED] destination_pitch: XRA8 little-endian (0x38415258)
[21:09:22] [PASSED] destination_pitch: YU24 little-endian (0x34325559)
[21:09:22] =============== [PASSED] drm_test_fb_memcpy ================
[21:09:22] ============= [PASSED] drm_format_helper_test ==============
[21:09:22] ================= drm_format (18 subtests) =================
[21:09:22] [PASSED] drm_test_format_block_width_invalid
[21:09:22] [PASSED] drm_test_format_block_width_one_plane
[21:09:22] [PASSED] drm_test_format_block_width_two_plane
[21:09:22] [PASSED] drm_test_format_block_width_three_plane
[21:09:22] [PASSED] drm_test_format_block_width_tiled
[21:09:22] [PASSED] drm_test_format_block_height_invalid
[21:09:22] [PASSED] drm_test_format_block_height_one_plane
[21:09:22] [PASSED] drm_test_format_block_height_two_plane
[21:09:22] [PASSED] drm_test_format_block_height_three_plane
[21:09:22] [PASSED] drm_test_format_block_height_tiled
[21:09:22] [PASSED] drm_test_format_min_pitch_invalid
[21:09:22] [PASSED] drm_test_format_min_pitch_one_plane_8bpp
[21:09:22] [PASSED] drm_test_format_min_pitch_one_plane_16bpp
[21:09:22] [PASSED] drm_test_format_min_pitch_one_plane_24bpp
[21:09:22] [PASSED] drm_test_format_min_pitch_one_plane_32bpp
[21:09:22] [PASSED] drm_test_format_min_pitch_two_plane
[21:09:22] [PASSED] drm_test_format_min_pitch_three_plane_8bpp
[21:09:22] [PASSED] drm_test_format_min_pitch_tiled
[21:09:22] =================== [PASSED] drm_format ====================
[21:09:22] ============== drm_framebuffer (10 subtests) ===============
[21:09:22] ========== drm_test_framebuffer_check_src_coords  ==========
[21:09:22] [PASSED] Success: source fits into fb
[21:09:22] [PASSED] Fail: overflowing fb with x-axis coordinate
[21:09:22] [PASSED] Fail: overflowing fb with y-axis coordinate
[21:09:22] [PASSED] Fail: overflowing fb with source width
[21:09:22] [PASSED] Fail: overflowing fb with source height
[21:09:22] ====== [PASSED] drm_test_framebuffer_check_src_coords ======
[21:09:22] [PASSED] drm_test_framebuffer_cleanup
[21:09:22] =============== drm_test_framebuffer_create  ===============
[21:09:22] [PASSED] ABGR8888 normal sizes
[21:09:22] [PASSED] ABGR8888 max sizes
[21:09:22] [PASSED] ABGR8888 pitch greater than min required
[21:09:22] [PASSED] ABGR8888 pitch less than min required
[21:09:22] [PASSED] ABGR8888 Invalid width
[21:09:22] [PASSED] ABGR8888 Invalid buffer handle
[21:09:22] [PASSED] No pixel format
[21:09:22] [PASSED] ABGR8888 Width 0
[21:09:22] [PASSED] ABGR8888 Height 0
[21:09:22] [PASSED] ABGR8888 Out of bound height * pitch combination
[21:09:22] [PASSED] ABGR8888 Large buffer offset
[21:09:22] [PASSED] ABGR8888 Buffer offset for inexistent plane
[21:09:22] [PASSED] ABGR8888 Invalid flag
[21:09:22] [PASSED] ABGR8888 Set DRM_MODE_FB_MODIFIERS without modifiers
[21:09:22] [PASSED] ABGR8888 Valid buffer modifier
[21:09:22] [PASSED] ABGR8888 Invalid buffer modifier(DRM_FORMAT_MOD_SAMSUNG_64_32_TILE)
[21:09:22] [PASSED] ABGR8888 Extra pitches without DRM_MODE_FB_MODIFIERS
[21:09:22] [PASSED] ABGR8888 Extra pitches with DRM_MODE_FB_MODIFIERS
[21:09:22] [PASSED] NV12 Normal sizes
[21:09:22] [PASSED] NV12 Max sizes
[21:09:22] [PASSED] NV12 Invalid pitch
[21:09:22] [PASSED] NV12 Invalid modifier/missing DRM_MODE_FB_MODIFIERS flag
[21:09:22] [PASSED] NV12 different  modifier per-plane
[21:09:22] [PASSED] NV12 with DRM_FORMAT_MOD_SAMSUNG_64_32_TILE
[21:09:22] [PASSED] NV12 Valid modifiers without DRM_MODE_FB_MODIFIERS
[21:09:22] [PASSED] NV12 Modifier for inexistent plane
[21:09:22] [PASSED] NV12 Handle for inexistent plane
[21:09:22] [PASSED] NV12 Handle for inexistent plane without DRM_MODE_FB_MODIFIERS
[21:09:22] [PASSED] YVU420 DRM_MODE_FB_MODIFIERS set without modifier
[21:09:22] [PASSED] YVU420 Normal sizes
[21:09:22] [PASSED] YVU420 Max sizes
[21:09:22] [PASSED] YVU420 Invalid pitch
[21:09:22] [PASSED] YVU420 Different pitches
[21:09:22] [PASSED] YVU420 Different buffer offsets/pitches
[21:09:22] [PASSED] YVU420 Modifier set just for plane 0, without DRM_MODE_FB_MODIFIERS
[21:09:22] [PASSED] YVU420 Modifier set just for planes 0, 1, without DRM_MODE_FB_MODIFIERS
[21:09:22] [PASSED] YVU420 Modifier set just for plane 0, 1, with DRM_MODE_FB_MODIFIERS
[21:09:22] [PASSED] YVU420 Valid modifier
[21:09:22] [PASSED] YVU420 Different modifiers per plane
[21:09:22] [PASSED] YVU420 Modifier for inexistent plane
[21:09:22] [PASSED] YUV420_10BIT Invalid modifier(DRM_FORMAT_MOD_LINEAR)
[21:09:22] [PASSED] X0L2 Normal sizes
[21:09:22] [PASSED] X0L2 Max sizes
[21:09:22] [PASSED] X0L2 Invalid pitch
[21:09:22] [PASSED] X0L2 Pitch greater than minimum required
[21:09:22] [PASSED] X0L2 Handle for inexistent plane
[21:09:22] [PASSED] X0L2 Offset for inexistent plane, without DRM_MODE_FB_MODIFIERS set
[21:09:22] [PASSED] X0L2 Modifier without DRM_MODE_FB_MODIFIERS set
[21:09:22] [PASSED] X0L2 Valid modifier
[21:09:22] [PASSED] X0L2 Modifier for inexistent plane
[21:09:22] =========== [PASSED] drm_test_framebuffer_create ===========
[21:09:22] [PASSED] drm_test_framebuffer_free
[21:09:22] [PASSED] drm_test_framebuffer_init
[21:09:22] [PASSED] drm_test_framebuffer_init_bad_format
[21:09:22] [PASSED] drm_test_framebuffer_init_dev_mismatch
[21:09:22] [PASSED] drm_test_framebuffer_lookup
[21:09:22] [PASSED] drm_test_framebuffer_lookup_inexistent
[21:09:22] [PASSED] drm_test_framebuffer_modifiers_not_supported
[21:09:22] ================= [PASSED] drm_framebuffer =================
[21:09:22] ================ drm_gem_shmem (8 subtests) ================
[21:09:22] [PASSED] drm_gem_shmem_test_obj_create
[21:09:22] [PASSED] drm_gem_shmem_test_obj_create_private
[21:09:22] [PASSED] drm_gem_shmem_test_pin_pages
[21:09:22] [PASSED] drm_gem_shmem_test_vmap
[21:09:22] [PASSED] drm_gem_shmem_test_get_sg_table
[21:09:22] [PASSED] drm_gem_shmem_test_get_pages_sgt
[21:09:22] [PASSED] drm_gem_shmem_test_madvise
[21:09:22] [PASSED] drm_gem_shmem_test_purge
[21:09:22] ================== [PASSED] drm_gem_shmem ==================
[21:09:22] === drm_atomic_helper_connector_hdmi_check (27 subtests) ===
[21:09:22] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode
[21:09:22] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode_vic_1
[21:09:22] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode
[21:09:22] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode_vic_1
[21:09:22] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode
[21:09:22] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode_vic_1
[21:09:22] ====== drm_test_check_broadcast_rgb_cea_mode_yuv420  =======
[21:09:22] [PASSED] Automatic
[21:09:22] [PASSED] Full
[21:09:22] [PASSED] Limited 16:235
[21:09:22] == [PASSED] drm_test_check_broadcast_rgb_cea_mode_yuv420 ===
[21:09:22] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_changed
[21:09:22] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_not_changed
[21:09:22] [PASSED] drm_test_check_disable_connector
[21:09:22] [PASSED] drm_test_check_hdmi_funcs_reject_rate
[21:09:22] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_rgb
[21:09:22] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_yuv420
[21:09:22] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422
[21:09:22] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420
[21:09:22] [PASSED] drm_test_check_driver_unsupported_fallback_yuv420
[21:09:22] [PASSED] drm_test_check_output_bpc_crtc_mode_changed
[21:09:22] [PASSED] drm_test_check_output_bpc_crtc_mode_not_changed
[21:09:22] [PASSED] drm_test_check_output_bpc_dvi
[21:09:22] [PASSED] drm_test_check_output_bpc_format_vic_1
[21:09:22] [PASSED] drm_test_check_output_bpc_format_display_8bpc_only
[21:09:22] [PASSED] drm_test_check_output_bpc_format_display_rgb_only
[21:09:22] [PASSED] drm_test_check_output_bpc_format_driver_8bpc_only
[21:09:22] [PASSED] drm_test_check_output_bpc_format_driver_rgb_only
[21:09:22] [PASSED] drm_test_check_tmds_char_rate_rgb_8bpc
[21:09:22] [PASSED] drm_test_check_tmds_char_rate_rgb_10bpc
[21:09:22] [PASSED] drm_test_check_tmds_char_rate_rgb_12bpc
[21:09:22] ===== [PASSED] drm_atomic_helper_connector_hdmi_check ======
[21:09:22] === drm_atomic_helper_connector_hdmi_reset (6 subtests) ====
[21:09:22] [PASSED] drm_test_check_broadcast_rgb_value
[21:09:22] [PASSED] drm_test_check_bpc_8_value
[21:09:22] [PASSED] drm_test_check_bpc_10_value
[21:09:22] [PASSED] drm_test_check_bpc_12_value
[21:09:22] [PASSED] drm_test_check_format_value
[21:09:22] [PASSED] drm_test_check_tmds_char_value
[21:09:22] ===== [PASSED] drm_atomic_helper_connector_hdmi_reset ======
[21:09:22] = drm_atomic_helper_connector_hdmi_mode_valid (4 subtests) =
[21:09:22] [PASSED] drm_test_check_mode_valid
[21:09:22] [PASSED] drm_test_check_mode_valid_reject
[21:09:22] [PASSED] drm_test_check_mode_valid_reject_rate
[21:09:22] [PASSED] drm_test_check_mode_valid_reject_max_clock
[21:09:22] === [PASSED] drm_atomic_helper_connector_hdmi_mode_valid ===
[21:09:22] ================= drm_managed (2 subtests) =================
[21:09:22] [PASSED] drm_test_managed_release_action
[21:09:22] [PASSED] drm_test_managed_run_action
[21:09:22] =================== [PASSED] drm_managed ===================
[21:09:22] =================== drm_mm (6 subtests) ====================
[21:09:22] [PASSED] drm_test_mm_init
[21:09:22] [PASSED] drm_test_mm_debug
[21:09:22] [PASSED] drm_test_mm_align32
[21:09:22] [PASSED] drm_test_mm_align64
[21:09:22] [PASSED] drm_test_mm_lowest
[21:09:22] [PASSED] drm_test_mm_highest
[21:09:22] ===================== [PASSED] drm_mm ======================
[21:09:22] ============= drm_modes_analog_tv (5 subtests) =============
[21:09:22] [PASSED] drm_test_modes_analog_tv_mono_576i
[21:09:22] [PASSED] drm_test_modes_analog_tv_ntsc_480i
[21:09:22] [PASSED] drm_test_modes_analog_tv_ntsc_480i_inlined
[21:09:22] [PASSED] drm_test_modes_analog_tv_pal_576i
[21:09:22] [PASSED] drm_test_modes_analog_tv_pal_576i_inlined
[21:09:22] =============== [PASSED] drm_modes_analog_tv ===============
[21:09:22] ============== drm_plane_helper (2 subtests) ===============
[21:09:22] =============== drm_test_check_plane_state  ================
[21:09:22] [PASSED] clipping_simple
[21:09:22] [PASSED] clipping_rotate_reflect
[21:09:22] [PASSED] positioning_simple
[21:09:22] [PASSED] upscaling
[21:09:22] [PASSED] downscaling
[21:09:22] [PASSED] rounding1
[21:09:22] [PASSED] rounding2
[21:09:22] [PASSED] rounding3
[21:09:22] [PASSED] rounding4
[21:09:22] =========== [PASSED] drm_test_check_plane_state ============
[21:09:22] =========== drm_test_check_invalid_plane_state  ============
[21:09:22] [PASSED] positioning_invalid
[21:09:22] [PASSED] upscaling_invalid
[21:09:22] [PASSED] downscaling_invalid
[21:09:22] ======= [PASSED] drm_test_check_invalid_plane_state ========
[21:09:22] ================ [PASSED] drm_plane_helper =================
[21:09:22] ====== drm_connector_helper_tv_get_modes (1 subtest) =======
[21:09:22] ====== drm_test_connector_helper_tv_get_modes_check  =======
[21:09:22] [PASSED] None
[21:09:22] [PASSED] PAL
[21:09:22] [PASSED] NTSC
[21:09:22] [PASSED] Both, NTSC Default
[21:09:22] [PASSED] Both, PAL Default
[21:09:22] [PASSED] Both, NTSC Default, with PAL on command-line
[21:09:22] [PASSED] Both, PAL Default, with NTSC on command-line
[21:09:22] == [PASSED] drm_test_connector_helper_tv_get_modes_check ===
[21:09:22] ======== [PASSED] drm_connector_helper_tv_get_modes ========
[21:09:22] ================== drm_rect (9 subtests) ===================
[21:09:22] [PASSED] drm_test_rect_clip_scaled_div_by_zero
[21:09:22] [PASSED] drm_test_rect_clip_scaled_not_clipped
[21:09:22] [PASSED] drm_test_rect_clip_scaled_clipped
[21:09:22] [PASSED] drm_test_rect_clip_scaled_signed_vs_unsigned
[21:09:22] ================= drm_test_rect_intersect  =================
[21:09:22] [PASSED] top-left x bottom-right: 2x2+1+1 x 2x2+0+0
[21:09:22] [PASSED] top-right x bottom-left: 2x2+0+0 x 2x2+1-1
[21:09:22] [PASSED] bottom-left x top-right: 2x2+1-1 x 2x2+0+0
[21:09:22] [PASSED] bottom-right x top-left: 2x2+0+0 x 2x2+1+1
[21:09:22] [PASSED] right x left: 2x1+0+0 x 3x1+1+0
[21:09:22] [PASSED] left x right: 3x1+1+0 x 2x1+0+0
[21:09:22] [PASSED] up x bottom: 1x2+0+0 x 1x3+0-1
[21:09:22] [PASSED] bottom x up: 1x3+0-1 x 1x2+0+0
[21:09:22] [PASSED] touching corner: 1x1+0+0 x 2x2+1+1
[21:09:22] [PASSED] touching side: 1x1+0+0 x 1x1+1+0
[21:09:22] [PASSED] equal rects: 2x2+0+0 x 2x2+0+0
[21:09:22] [PASSED] inside another: 2x2+0+0 x 1x1+1+1
[21:09:22] [PASSED] far away: 1x1+0+0 x 1x1+3+6
[21:09:22] [PASSED] points intersecting: 0x0+5+10 x 0x0+5+10
[21:09:22] [PASSED] points not intersecting: 0x0+0+0 x 0x0+5+10
[21:09:22] ============= [PASSED] drm_test_rect_intersect =============
[21:09:22] ================ drm_test_rect_calc_hscale  ================
[21:09:22] [PASSED] normal use
[21:09:22] [PASSED] out of max range
[21:09:22] [PASSED] out of min range
[21:09:22] [PASSED] zero dst
[21:09:22] [PASSED] negative src
[21:09:22] [PASSED] negative dst
[21:09:22] ============ [PASSED] drm_test_rect_calc_hscale ============
[21:09:22] ================ drm_test_rect_calc_vscale  ================
[21:09:22] [PASSED] normal use
stty: 'standard input': Inappropriate ioctl for device
[21:09:22] [PASSED] out of max range
[21:09:22] [PASSED] out of min range
[21:09:22] [PASSED] zero dst
[21:09:22] [PASSED] negative src
[21:09:22] [PASSED] negative dst
[21:09:22] ============ [PASSED] drm_test_rect_calc_vscale ============
[21:09:22] ================== drm_test_rect_rotate  ===================
[21:09:22] [PASSED] reflect-x
[21:09:22] [PASSED] reflect-y
[21:09:22] [PASSED] rotate-0
[21:09:22] [PASSED] rotate-90
[21:09:22] [PASSED] rotate-180
[21:09:22] [PASSED] rotate-270
[21:09:22] ============== [PASSED] drm_test_rect_rotate ===============
[21:09:22] ================ drm_test_rect_rotate_inv  =================
[21:09:22] [PASSED] reflect-x
[21:09:22] [PASSED] reflect-y
[21:09:22] [PASSED] rotate-0
[21:09:22] [PASSED] rotate-90
[21:09:22] [PASSED] rotate-180
[21:09:22] [PASSED] rotate-270
[21:09:22] ============ [PASSED] drm_test_rect_rotate_inv =============
[21:09:22] ==================== [PASSED] drm_rect =====================
[21:09:22] ============ drm_sysfb_modeset_test (1 subtest) ============
[21:09:22] ============ drm_test_sysfb_build_fourcc_list  =============
[21:09:22] [PASSED] no native formats
[21:09:22] [PASSED] XRGB8888 as native format
[21:09:22] [PASSED] remove duplicates
[21:09:22] [PASSED] convert alpha formats
[21:09:22] [PASSED] random formats
[21:09:22] ======== [PASSED] drm_test_sysfb_build_fourcc_list =========
[21:09:22] ============= [PASSED] drm_sysfb_modeset_test ==============
[21:09:22] ================== drm_fixp (2 subtests) ===================
[21:09:22] [PASSED] drm_test_int2fixp
[21:09:22] [PASSED] drm_test_sm2fixp
[21:09:22] ==================== [PASSED] drm_fixp =====================
[21:09:22] ============================================================
[21:09:22] Testing complete. Ran 624 tests: passed: 624
[21:09:22] Elapsed time: 27.760s total, 1.735s configuring, 25.609s building, 0.378s running

+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig [21:09:22] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:

$ make ARCH=um O=.kunit olddefconfig
[21:09:24] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[21:09:33] Starting KUnit Kernel (1/1)...
[21:09:33] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[21:09:33] ================= ttm_device (5 subtests) ==================
[21:09:33] [PASSED] ttm_device_init_basic
[21:09:33] [PASSED] ttm_device_init_multiple
[21:09:33] [PASSED] ttm_device_fini_basic
[21:09:33] [PASSED] ttm_device_init_no_vma_man
[21:09:33] ================== ttm_device_init_pools  ==================
[21:09:33] [PASSED] No DMA allocations, no DMA32 required
[21:09:33] [PASSED] DMA allocations, DMA32 required
[21:09:33] [PASSED] No DMA allocations, DMA32 required
[21:09:33] [PASSED] DMA allocations, no DMA32 required
[21:09:33] ============== [PASSED] ttm_device_init_pools ==============
[21:09:33] =================== [PASSED] ttm_device ====================
[21:09:33] ================== ttm_pool (8 subtests) ===================
[21:09:33] ================== ttm_pool_alloc_basic  ===================
[21:09:33] [PASSED] One page
[21:09:33] [PASSED] More than one page
[21:09:33] [PASSED] Above the allocation limit
[21:09:33] [PASSED] One page, with coherent DMA mappings enabled
[21:09:33] [PASSED] Above the allocation limit, with coherent DMA mappings enabled
[21:09:33] ============== [PASSED] ttm_pool_alloc_basic ===============
[21:09:33] ============== ttm_pool_alloc_basic_dma_addr  ==============
[21:09:33] [PASSED] One page
[21:09:33] [PASSED] More than one page
[21:09:33] [PASSED] Above the allocation limit
[21:09:33] [PASSED] One page, with coherent DMA mappings enabled
[21:09:33] [PASSED] Above the allocation limit, with coherent DMA mappings enabled
[21:09:33] ========== [PASSED] ttm_pool_alloc_basic_dma_addr ==========
[21:09:33] [PASSED] ttm_pool_alloc_order_caching_match
[21:09:33] [PASSED] ttm_pool_alloc_caching_mismatch
[21:09:33] [PASSED] ttm_pool_alloc_order_mismatch
[21:09:33] [PASSED] ttm_pool_free_dma_alloc
[21:09:33] [PASSED] ttm_pool_free_no_dma_alloc
[21:09:33] [PASSED] ttm_pool_fini_basic
[21:09:33] ==================== [PASSED] ttm_pool =====================
[21:09:33] ================ ttm_resource (8 subtests) =================
[21:09:33] ================= ttm_resource_init_basic  =================
[21:09:33] [PASSED] Init resource in TTM_PL_SYSTEM
[21:09:33] [PASSED] Init resource in TTM_PL_VRAM
[21:09:33] [PASSED] Init resource in a private placement
[21:09:33] [PASSED] Init resource in TTM_PL_SYSTEM, set placement flags
[21:09:33] ============= [PASSED] ttm_resource_init_basic =============
[21:09:33] [PASSED] ttm_resource_init_pinned
[21:09:33] [PASSED] ttm_resource_fini_basic
[21:09:33] [PASSED] ttm_resource_manager_init_basic
[21:09:33] [PASSED] ttm_resource_manager_usage_basic
[21:09:33] [PASSED] ttm_resource_manager_set_used_basic
[21:09:33] [PASSED] ttm_sys_man_alloc_basic
[21:09:33] [PASSED] ttm_sys_man_free_basic
[21:09:33] ================== [PASSED] ttm_resource ===================
[21:09:33] =================== ttm_tt (15 subtests) ===================
[21:09:33] ==================== ttm_tt_init_basic  ====================
[21:09:33] [PASSED] Page-aligned size
[21:09:33] [PASSED] Extra pages requested
[21:09:33] ================ [PASSED] ttm_tt_init_basic ================
[21:09:33] [PASSED] ttm_tt_init_misaligned
[21:09:33] [PASSED] ttm_tt_fini_basic
[21:09:33] [PASSED] ttm_tt_fini_sg
[21:09:33] [PASSED] ttm_tt_fini_shmem
[21:09:33] [PASSED] ttm_tt_create_basic
[21:09:33] [PASSED] ttm_tt_create_invalid_bo_type
[21:09:33] [PASSED] ttm_tt_create_ttm_exists
[21:09:33] [PASSED] ttm_tt_create_failed
[21:09:33] [PASSED] ttm_tt_destroy_basic
[21:09:33] [PASSED] ttm_tt_populate_null_ttm
[21:09:33] [PASSED] ttm_tt_populate_populated_ttm
[21:09:33] [PASSED] ttm_tt_unpopulate_basic
[21:09:33] [PASSED] ttm_tt_unpopulate_empty_ttm
[21:09:33] [PASSED] ttm_tt_swapin_basic
[21:09:33] ===================== [PASSED] ttm_tt ======================
[21:09:33] =================== ttm_bo (14 subtests) ===================
[21:09:33] =========== ttm_bo_reserve_optimistic_no_ticket  ===========
[21:09:33] [PASSED] Cannot be interrupted and sleeps
[21:09:33] [PASSED] Cannot be interrupted, locks straight away
[21:09:33] [PASSED] Can be interrupted, sleeps
[21:09:33] ======= [PASSED] ttm_bo_reserve_optimistic_no_ticket =======
[21:09:33] [PASSED] ttm_bo_reserve_locked_no_sleep
[21:09:33] [PASSED] ttm_bo_reserve_no_wait_ticket
[21:09:33] [PASSED] ttm_bo_reserve_double_resv
[21:09:33] [PASSED] ttm_bo_reserve_interrupted
[21:09:33] [PASSED] ttm_bo_reserve_deadlock
[21:09:33] [PASSED] ttm_bo_unreserve_basic
[21:09:33] [PASSED] ttm_bo_unreserve_pinned
[21:09:33] [PASSED] ttm_bo_unreserve_bulk
[21:09:33] [PASSED] ttm_bo_fini_basic
[21:09:33] [PASSED] ttm_bo_fini_shared_resv
[21:09:33] [PASSED] ttm_bo_pin_basic
[21:09:33] [PASSED] ttm_bo_pin_unpin_resource
[21:09:33] [PASSED] ttm_bo_multiple_pin_one_unpin
[21:09:33] ===================== [PASSED] ttm_bo ======================
[21:09:33] ============== ttm_bo_validate (21 subtests) ===============
[21:09:33] ============== ttm_bo_init_reserved_sys_man  ===============
[21:09:33] [PASSED] Buffer object for userspace
[21:09:33] [PASSED] Kernel buffer object
[21:09:33] [PASSED] Shared buffer object
[21:09:33] ========== [PASSED] ttm_bo_init_reserved_sys_man ===========
[21:09:33] ============== ttm_bo_init_reserved_mock_man  ==============
[21:09:33] [PASSED] Buffer object for userspace
[21:09:33] [PASSED] Kernel buffer object
[21:09:33] [PASSED] Shared buffer object
[21:09:33] ========== [PASSED] ttm_bo_init_reserved_mock_man ==========
[21:09:33] [PASSED] ttm_bo_init_reserved_resv
[21:09:33] ================== ttm_bo_validate_basic  ==================
[21:09:33] [PASSED] Buffer object for userspace
[21:09:33] [PASSED] Kernel buffer object
[21:09:33] [PASSED] Shared buffer object
[21:09:33] ============== [PASSED] ttm_bo_validate_basic ==============
[21:09:33] [PASSED] ttm_bo_validate_invalid_placement
[21:09:33] ============= ttm_bo_validate_same_placement  ==============
[21:09:33] [PASSED] System manager
[21:09:33] [PASSED] VRAM manager
[21:09:33] ========= [PASSED] ttm_bo_validate_same_placement ==========
[21:09:33] [PASSED] ttm_bo_validate_failed_alloc
[21:09:33] [PASSED] ttm_bo_validate_pinned
[21:09:33] [PASSED] ttm_bo_validate_busy_placement
[21:09:33] ================ ttm_bo_validate_multihop  =================
[21:09:33] [PASSED] Buffer object for userspace
[21:09:33] [PASSED] Kernel buffer object
[21:09:33] [PASSED] Shared buffer object
[21:09:33] ============ [PASSED] ttm_bo_validate_multihop =============
[21:09:33] ========== ttm_bo_validate_no_placement_signaled  ==========
[21:09:33] [PASSED] Buffer object in system domain, no page vector
[21:09:33] [PASSED] Buffer object in system domain with an existing page vector
[21:09:33] ====== [PASSED] ttm_bo_validate_no_placement_signaled ======
[21:09:33] ======== ttm_bo_validate_no_placement_not_signaled  ========
[21:09:33] [PASSED] Buffer object for userspace
[21:09:33] [PASSED] Kernel buffer object
[21:09:33] [PASSED] Shared buffer object
[21:09:33] ==== [PASSED] ttm_bo_validate_no_placement_not_signaled ====
[21:09:33] [PASSED] ttm_bo_validate_move_fence_signaled
[21:09:33] ========= ttm_bo_validate_move_fence_not_signaled  =========
[21:09:33] [PASSED] Waits for GPU
[21:09:33] [PASSED] Tries to lock straight away
[21:09:33] ===== [PASSED] ttm_bo_validate_move_fence_not_signaled =====
[21:09:33] [PASSED] ttm_bo_validate_happy_evict
[21:09:33] [PASSED] ttm_bo_validate_all_pinned_evict
[21:09:33] [PASSED] ttm_bo_validate_allowed_only_evict
[21:09:33] [PASSED] ttm_bo_validate_deleted_evict
[21:09:33] [PASSED] ttm_bo_validate_busy_domain_evict
[21:09:33] [PASSED] ttm_bo_validate_evict_gutting
[21:09:33] [PASSED] ttm_bo_validate_recrusive_evict
stty: 'standard input': Inappropriate ioctl for device
[21:09:33] ================= [PASSED] ttm_bo_validate =================
[21:09:33] ============================================================
[21:09:33] Testing complete. Ran 101 tests: passed: 101
[21:09:34] Elapsed time: 11.487s total, 1.695s configuring, 9.575s building, 0.183s running

+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel

#49 lore raw

✗ CI.checksparse: warning for Enable THP support in drm_pagemap (rev5)

In reply to Francois Dugast
== Series Details ==

== Series Details ==

Series: Enable THP support in drm_pagemap (rev5)
URL : https://patchwork.freedesktop.org/series/159119/
State : warning

== Summary ==

+ trap cleanup EXIT
+ KERNEL=/kernel
+ MT=/root/linux/maintainer-tools
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools /root/linux/maintainer-tools
Cloning into '/root/linux/maintainer-tools'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ make -C /root/linux/maintainer-tools
make: Entering directory '/root/linux/maintainer-tools'
cc -O2 -g -Wextra -o remap-log remap-log.c
make: Leaving directory '/root/linux/maintainer-tools'
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ /root/linux/maintainer-tools/dim sparse --fast 629c8a9146d75c96e2704592f8764f9553b5fd39
Sparse version: 0.6.4 (Ubuntu: 0.6.4-4ubuntu3)
Fast mode used, each commit won't be checked separately.
-
+drivers/gpu/drm/display/drm_dp_helper.c:1979:1: error: bad constant expression
+drivers/gpu/drm/display/drm_dp_helper.c:1980:1: error: bad constant expression
+drivers/gpu/drm/display/drm_dp_helper.c:2144:1: error: bad constant expression
+drivers/gpu/drm/display/drm_dp_helper.c:2145:1: error: bad constant expression
+drivers/gpu/drm/drm_bridge.c:1643:1: error: bad constant expression
+drivers/gpu/drm/drm_bridge.c:1644:1: error: bad constant expression
+drivers/gpu/drm/drm_bridge.c:1645:1: error: bad constant expression
+drivers/gpu/drm/drm_bridge.c:1645:1: error: bad constant expression
+drivers/gpu/drm/drm_drv.c:60:1: error: bad constant expression
+drivers/gpu/drm/drm_drv.c:61:1: error: bad constant expression
+drivers/gpu/drm/drm_drv.c:62:1: error: bad constant expression
+drivers/gpu/drm/drm_drv.c:62:1: error: bad constant expression
+drivers/gpu/drm/drm_edid.c:1800:1: error: bad constant expression
+drivers/gpu/drm/drm_edid.c:1801:1: error: bad constant expression
+drivers/gpu/drm/drm_gem_framebuffer_helper.c:23:1: error: bad constant expression
+drivers/gpu/drm/drm_gem_shmem_helper.c:28:1: error: bad constant expression
+drivers/gpu/drm/drm_gem_shmem_helper.c:967:1: error: bad constant expression
+drivers/gpu/drm/drm_gem_shmem_helper.c:968:1: error: bad constant expression
+drivers/gpu/drm/drm_gem_shmem_helper.c:969:1: error: bad constant expression
+drivers/gpu/drm/drm_gem_shmem_helper.c:969:1: error: bad constant expression
+drivers/gpu/drm/drm_panel.c:733:1: error: bad constant expression
+drivers/gpu/drm/drm_panel.c:734:1: error: bad constant expression
+drivers/gpu/drm/drm_panel.c:735:1: error: bad constant expression
+drivers/gpu/drm/drm_panel.c:735:1: error: bad constant expression
+drivers/gpu/drm/drm_panel_orientation_quirks.c:601:1: error: bad constant expression
+drivers/gpu/drm/drm_panel_orientation_quirks.c:602:1: error: bad constant expression
+drivers/gpu/drm/drm_panel_orientation_quirks.c:602:1: error: bad constant expression
+drivers/gpu/drm/drm_prime.c:44:1: error: bad constant expression
+drivers/gpu/drm/drm_probe_helper.c:68:1: error: bad constant expression
+drivers/gpu/drm/drm_simple_kms_helper.c:457:1: error: bad constant expression
+drivers/gpu/drm/drm_simple_kms_helper.c:458:1: error: bad constant expression
+drivers/gpu/drm/drm_simple_kms_helper.c:458:1: error: bad constant expression
+drivers/gpu/drm/drm_vblank.c:173:1: error: bad constant expression
+drivers/gpu/drm/drm_vblank.c:174:1: error: bad constant expression
+drivers/gpu/drm/drm_vblank.c:175:1: error: bad constant expression
+drivers/gpu/drm/drm_vblank.c:176:1: error: bad constant expression
+drivers/gpu/drm/i915/display/dvo_ch7017.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/dvo_ch7xxx.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/dvo_ivch.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/dvo_ns2501.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/dvo_sil164.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/dvo_tfp410.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/g4x_dp.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/g4x_hdmi.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/hsw_ips.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/i9xx_plane.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/i9xx_wm.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h, drivers/gpu/drm/i915/display/intel_display_trace.h):
+drivers/gpu/drm/i915/display/icl_dsi.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h, drivers/gpu/drm/i915/display/intel_dsi.h):
+drivers/gpu/drm/i915/display/intel_acpi.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_alpm.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_atomic.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_audio.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_backlight.c: note: in included file:
+drivers/gpu/drm/i915/display/intel_bios.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_bw.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_casf.c:147:21: error: too long token expansion
+drivers/gpu/drm/i915/display/intel_casf.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_cdclk.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_color.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_colorop.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_color_pipeline.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_combo_phy.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_connector.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_crtc.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h, drivers/gpu/drm/i915/display/intel_display_trace.h):
+drivers/gpu/drm/i915/display/intel_crt.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_crtc_state_dump.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_cursor.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_cx0_phy.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dbuf_bw.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_ddi.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_display.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_display_debugfs.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_display_device.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_display_driver.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_display_irq.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h, drivers/gpu/drm/i915/display/intel_display_trace.h):
+drivers/gpu/drm/i915/display/intel_display_power.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_display_power_map.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_display_power_well.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_display_reset.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_display_rps.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dmc.c:131:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:134:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:137:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:140:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:143:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:146:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:149:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:153:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:154:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:157:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:160:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:163:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:166:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:170:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:174:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:178:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:182:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c:186:1: error: bad constant expression
+drivers/gpu/drm/i915/display/intel_dmc.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dp_aux.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dp.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dp_hdcp.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dpio_phy.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dp_link_training.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dpll.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dpll_mgr.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dp_mst.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dpt.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dpt_common.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dp_test.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_drrs.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dsb.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dsi.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h, drivers/gpu/drm/i915/display/intel_dsi.h):
+drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dsi_vbt.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_dvo.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_encoder.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_fb_bo.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_fbc.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h, drivers/gpu/drm/i915/display/intel_display_trace.h):
+drivers/gpu/drm/i915/display/intel_fb.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_fb_pin.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_fdi.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_fifo_underrun.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h, drivers/gpu/drm/i915/display/intel_display_trace.h):
+drivers/gpu/drm/i915/display/intel_flipq.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_frontbuffer.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h, drivers/gpu/drm/i915/display/intel_display_trace.h):
+drivers/gpu/drm/i915/display/intel_global_state.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_gmbus.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_hdcp.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_hdcp_gsc_message.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_hdmi.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_hotplug.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_hotplug_irq.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_initial_plane.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_link_bw.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_load_detect.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_lspcon.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_lt_phy.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_lvds.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_modeset_lock.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_modeset_setup.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_modeset_verify.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_opregion.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_overlay.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_panel.c: note: in included file:
+drivers/gpu/drm/i915/display/intel_pch_display.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_pch_refclk.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_pfit.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_pipe_crc.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_plane.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h, drivers/gpu/drm/i915/display/intel_display_trace.h):
+drivers/gpu/drm/i915/display/intel_pmdemand.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h, drivers/gpu/drm/i915/display/intel_display_trace.h):
+drivers/gpu/drm/i915/display/intel_pps.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_psr.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_quirks.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_sdvo.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_snps_hdmi_pll.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_snps_phy.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_sprite.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_sprite_uapi.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_tc.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_tv.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_vblank.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_vdsc.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_vga.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_vrr.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/intel_wm.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/skl_prefill.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/skl_scaler.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h, drivers/gpu/drm/i915/display/intel_display_trace.h):
+drivers/gpu/drm/i915/display/skl_universal_plane.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/skl_watermark.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/vlv_clock.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/vlv_dsi.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/vlv_dsi_pll.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/display/vlv_sideband.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c:18:1: error: bad constant expression
+drivers/gpu/drm/i915/gem/i915_gem_pages.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/gt/intel_reset.c:1569:12: warning: context imbalance in '_intel_gt_reset_lock' - different lock contexts for basic block +drivers/gpu/drm/i915/gt/intel_sseu.c:600:17: error: too long token expansion
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:191:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:192:1: error: bad constant expression
+drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:193:1: error: bad constant expression
+drivers/gpu/drm/i915/i915_active.c:1062:16: warning: context imbalance in '__i915_active_fence_set' - different lock contexts for basic block +drivers/gpu/drm/i915/i915_drm_client.c:92:9: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/i915/i915_drm_client.c:92:9: error: incompatible types in comparison expression (different address spaces):

+drivers/gpu/drm/i915/i915_drm_client.c:92:9:    expected struct list_head const *list
+drivers/gpu/drm/i915/i915_drm_client.c:92:9:    got struct list_head [noderef] __rcu *pos
+drivers/gpu/drm/i915/i915_drm_client.c:92:9:    struct list_head *
+drivers/gpu/drm/i915/i915_drm_client.c:92:9:    struct list_head *
+drivers/gpu/drm/i915/i915_drm_client.c:92:9:    struct list_head [noderef] __rcu *
+drivers/gpu/drm/i915/i915_drm_client.c:92:9:    struct list_head [noderef] __rcu *

+drivers/gpu/drm/i915/i915_drm_client.c:92:9: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/i915/i915_initial_plane.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/i915_irq.c:467:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:467:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:475:16: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:475:16: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:480:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:480:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:480:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:518:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:518:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:526:16: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:526:16: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:531:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:531:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:531:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:575:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:575:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:578:15: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:578:15: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:582:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:582:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:589:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:589:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:589:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_irq.c:589:9: warning: unreplaced symbol '<noident>' +drivers/gpu/drm/i915/i915_mitigations.c:133:1: error: bad constant expression +drivers/gpu/drm/i915/i915_module.c:125:1: error: bad constant expression +drivers/gpu/drm/i915/i915_module.c:126:1: error: bad constant expression +drivers/gpu/drm/i915/i915_module.c:128:1: error: bad constant expression +drivers/gpu/drm/i915/i915_module.c:129:1: error: bad constant expression +drivers/gpu/drm/i915/i915_module.c:129:1: error: bad constant expression +drivers/gpu/drm/i915/i915_panic.c: note: in included file (through drivers/gpu/drm/i915/display/intel_display_types.h):
+drivers/gpu/drm/i915/i915_params.c:100:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:100:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:104:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:104:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:107:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:107:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:110:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:110:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:119:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:119:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:123:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:123:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:125:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:125:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:66:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:66:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:69:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:69:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:73:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:73:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:79:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:79:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:84:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:84:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:88:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:88:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:91:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:91:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:95:1: error: bad constant expression +drivers/gpu/drm/i915/i915_params.c:95:1: error: bad constant expression +drivers/gpu/drm/i915/intel_uncore.c:1930:1: warning: context imbalance in 'fwtable_read8' - unexpected unlock +drivers/gpu/drm/i915/intel_uncore.c:1931:1: warning: context imbalance in 'fwtable_read16' - unexpected unlock +drivers/gpu/drm/i915/intel_uncore.c:1932:1: warning: context imbalance in 'fwtable_read32' - unexpected unlock +drivers/gpu/drm/i915/intel_uncore.c:1933:1: warning: context imbalance in 'fwtable_read64' - unexpected unlock +drivers/gpu/drm/i915/intel_uncore.c:1998:1: warning: context imbalance in 'gen6_write8' - unexpected unlock +drivers/gpu/drm/i915/intel_uncore.c:1999:1: warning: context imbalance in 'gen6_write16' - unexpected unlock +drivers/gpu/drm/i915/intel_uncore.c:2000:1: warning: context imbalance in 'gen6_write32' - unexpected unlock +drivers/gpu/drm/i915/intel_uncore.c:2020:1: warning: context imbalance in 'fwtable_write8' - unexpected unlock +drivers/gpu/drm/i915/intel_uncore.c:2021:1: warning: context imbalance in 'fwtable_write16' - unexpected unlock +drivers/gpu/drm/i915/intel_uncore.c:2022:1: warning: context imbalance in 'fwtable_write32' - unexpected unlock +drivers/gpu/drm/i915/intel_wakeref.c:148:19: warning: context imbalance in 'wakeref_auto_timeout' - unexpected unlock +drivers/gpu/drm/ttm/ttm_bo.c:1203:31: warning: symbol 'ttm_swap_ops' was not declared. Should it be static?
+drivers/gpu/drm/ttm/ttm_bo_util.c:329:38: expected void *virtual
+drivers/gpu/drm/ttm/ttm_bo_util.c:329:38: got void [noderef] __iomem *
+drivers/gpu/drm/ttm/ttm_bo_util.c:329:38: warning: incorrect type in assignment (different address spaces)
+drivers/gpu/drm/ttm/ttm_bo_util.c:332:38: expected void *virtual
+drivers/gpu/drm/ttm/ttm_bo_util.c:332:38: got void [noderef] __iomem *
+drivers/gpu/drm/ttm/ttm_bo_util.c:332:38: warning: incorrect type in assignment (different address spaces)
+drivers/gpu/drm/ttm/ttm_bo_util.c:335:38: expected void *virtual
+drivers/gpu/drm/ttm/ttm_bo_util.c:335:38: got void [noderef] __iomem *
+drivers/gpu/drm/ttm/ttm_bo_util.c:335:38: warning: incorrect type in assignment (different address spaces)
+drivers/gpu/drm/ttm/ttm_bo_util.c:465:28: expected void volatile [noderef] __iomem *addr
+drivers/gpu/drm/ttm/ttm_bo_util.c:465:28: got void *virtual
+drivers/gpu/drm/ttm/ttm_bo_util.c:465:28: warning: incorrect type in argument 1 (different address spaces) +drivers/gpu/drm/ttm/ttm_pool.c:119:1: error: bad constant expression +drivers/gpu/drm/ttm/ttm_pool.c:120:1: error: bad constant expression
+drivers/gpu/drm/ttm/ttm_tt.c:54:1: error: bad constant expression
+drivers/gpu/drm/ttm/ttm_tt.c:55:1: error: bad constant expression
+drivers/gpu/drm/ttm/ttm_tt.c:59:1: error: bad constant expression
+drivers/gpu/drm/ttm/ttm_tt.c:60:1: error: bad constant expression +drivers/gpu/drm/virtio/virtgpu_drv.c:217:1: error: bad constant expression +drivers/gpu/drm/virtio/virtgpu_drv.c:218:1: error: bad constant expression +drivers/gpu/drm/virtio/virtgpu_drv.c:218:1: error: bad constant expression +drivers/gpu/drm/virtio/virtgpu_drv.c:219:1: error: bad constant expression +drivers/gpu/drm/virtio/virtgpu_drv.c:220:1: error: bad constant expression +drivers/gpu/drm/virtio/virtgpu_drv.c:221:1: error: bad constant expression +drivers/gpu/drm/virtio/virtgpu_drv.c:52:1: error: bad constant expression +drivers/gpu/drm/virtio/virtgpu_drv.c:53:1: error: bad constant expression +drivers/gpu/drm/virtio/virtgpu_object.c:34:1: error: bad constant expression +drivers/gpu/drm/virtio/virtgpu_prime.c:30:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression
+./include/linux/pwm.h:13:1: error: bad constant expression

+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel

#50 lore raw

✓ Xe.CI.BAT: success for Enable THP support in drm_pagemap (rev5)

In reply to Francois Dugast
== Series Details ==

== Series Details ==

Series: Enable THP support in drm_pagemap (rev5)
URL : https://patchwork.freedesktop.org/series/159119/
State : success

== Summary ==

CI Bug Log - changes from xe-4364-629c8a9146d75c96e2704592f8764f9553b5fd39_BAT -> xe-pw-159119v5_BAT
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Participating hosts (12 -> 12)
------------------------------

No changes in participating hosts

Known issues
------------

Here are the changes found in xe-pw-159119v5_BAT that come from known issues:

### IGT changes ###

#### Possible fixes ####

* igt@xe_waitfence@engine:
- bat-dg2-oem2: [FAIL][1] ([Intel XE#6519]) -> [PASS][2]
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4364-629c8a9146d75c96e2704592f8764f9553b5fd39/bat-dg2-oem2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/bat-dg2-oem2/igt@[email protected]

[Intel XE#6519]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6519

Build changes
-------------

* Linux: xe-4364-629c8a9146d75c96e2704592f8764f9553b5fd39 -> xe-pw-159119v5

IGT_8694: 8694
xe-4364-629c8a9146d75c96e2704592f8764f9553b5fd39: 629c8a9146d75c96e2704592f8764f9553b5fd39
xe-pw-159119v5: 159119v5

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/index.html

#51 lore raw

✗ Xe.CI.Full: failure for Enable THP support in drm_pagemap (rev5)

In reply to Francois Dugast
== Series Details ==

== Series Details ==

Series: Enable THP support in drm_pagemap (rev5)
URL : https://patchwork.freedesktop.org/series/159119/
State : failure

== Summary ==

CI Bug Log - changes from xe-4364-629c8a9146d75c96e2704592f8764f9553b5fd39_FULL -> xe-pw-159119v5_FULL
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with xe-pw-159119v5_FULL absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes
introduced in xe-pw-159119v5_FULL, please notify your bug team ([email protected]) to allow them to document this new failure mode, which will reduce false positives in CI.

Participating hosts (2 -> 2)
------------------------------

No changes in participating hosts

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in xe-pw-159119v5_FULL:

### IGT changes ###

#### Possible regressions ####

* igt@kms_cursor_edge_walk@256x256-right-edge@pipe-a-dp-2:
- shard-bmg: NOTRUN -> [ABORT][1]
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-3/igt@kms_cursor_edge_walk@[email protected]

* igt@kms_cursor_edge_walk@256x256-right-edge@pipe-d-dp-2:
- shard-bmg: NOTRUN -> [INCOMPLETE][2]
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-3/igt@kms_cursor_edge_walk@[email protected]

Known issues
------------

Here are the changes found in xe-pw-159119v5_FULL that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- shard-bmg: NOTRUN -> [SKIP][3] ([Intel XE#2233])
[3]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_atomic_transition@plane-all-modeset-transition-internal-panels:
- shard-bmg: NOTRUN -> [SKIP][4] ([Intel XE#2370])
[4]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-3/igt@kms_atomic_transition@plane-all-modeset-transition-internal-panels.html

* igt@kms_big_fb@x-tiled-32bpp-rotate-90:
- shard-bmg: NOTRUN -> [SKIP][5] ([Intel XE#2327]) +7 other tests skip
[5]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_big_fb@y-tiled-8bpp-rotate-90:
- shard-bmg: NOTRUN -> [SKIP][6] ([Intel XE#1124]) +10 other tests skip
[6]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_big_fb@y-tiled-addfb-size-overflow:
- shard-bmg: NOTRUN -> [SKIP][7] ([Intel XE#610])
[7]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_big_fb@yf-tiled-addfb-size-offset-overflow:
- shard-bmg: NOTRUN -> [SKIP][8] ([Intel XE#607])
[8]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-10/igt@[email protected]

* igt@kms_bw@connected-linear-tiling-3-displays-2560x1440p:
- shard-bmg: NOTRUN -> [SKIP][9] ([Intel XE#2314] / [Intel XE#2894]) +2 other tests skip
[9]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@kms_bw@linear-tiling-4-displays-3840x2160p:
- shard-bmg: NOTRUN -> [SKIP][10] ([Intel XE#367]) +3 other tests skip
[10]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_ccs@bad-aux-stride-yf-tiled-ccs:
- shard-bmg: NOTRUN -> [SKIP][11] ([Intel XE#2887]) +16 other tests skip
[11]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-3/igt@[email protected]

* igt@kms_ccs@bad-rotation-90-4-tiled-lnl-ccs@pipe-c-dp-2:
- shard-bmg: NOTRUN -> [SKIP][12] ([Intel XE#2652] / [Intel XE#787]) +8 other tests skip
[12]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@kms_ccs@[email protected]

* igt@kms_ccs@crc-primary-suspend-yf-tiled-ccs:
- shard-bmg: NOTRUN -> [SKIP][13] ([Intel XE#3432]) +3 other tests skip
[13]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_chamelium_color@ctm-0-50:
- shard-bmg: NOTRUN -> [SKIP][14] ([Intel XE#2325]) +1 other test skip
[14]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_chamelium_edid@hdmi-edid-change-during-hibernate:
- shard-bmg: NOTRUN -> [SKIP][15] ([Intel XE#2252]) +9 other tests skip
[15]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-3/igt@[email protected]

* igt@kms_chamelium_sharpness_filter@filter-basic:
- shard-bmg: NOTRUN -> [SKIP][16] ([Intel XE#6507])
[16]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_content_protection@dp-mst-lic-type-1:
- shard-bmg: NOTRUN -> [SKIP][17] ([Intel XE#2390]) +1 other test skip
[17]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_content_protection@dp-mst-suspend-resume:
- shard-bmg: NOTRUN -> [SKIP][18] ([Intel XE#6743])
[18]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-10/igt@[email protected]

* igt@kms_content_protection@dp-mst-type-0-hdcp14:
- shard-bmg: NOTRUN -> [SKIP][19] ([Intel XE#6974]) +1 other test skip
[19]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-2/igt@[email protected]

* igt@kms_cursor_crc@cursor-offscreen-128x42:
- shard-bmg: NOTRUN -> [SKIP][20] ([Intel XE#2320]) +8 other tests skip
[20]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@kms_cursor_crc@cursor-offscreen-512x170:
- shard-bmg: NOTRUN -> [SKIP][21] ([Intel XE#2321]) +1 other test skip
[21]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-3/igt@[email protected]

* igt@kms_cursor_edge_walk@256x256-right-edge:
- shard-bmg: NOTRUN -> [ABORT][22] ([Intel XE#1727])
[22]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-3/igt@[email protected]

* igt@kms_dirtyfb@drrs-dirtyfb-ioctl:
- shard-bmg: NOTRUN -> [SKIP][23] ([Intel XE#1508])
[23]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_dirtyfb@fbc-dirtyfb-ioctl:
- shard-bmg: NOTRUN -> [SKIP][24] ([Intel XE#4210])
[24]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-3/igt@[email protected]

* igt@kms_dsc@dsc-fractional-bpp-with-bpc:
- shard-bmg: NOTRUN -> [SKIP][25] ([Intel XE#2244])
[25]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@kms_fbc_dirty_rect@fbc-dirty-rectangle-out-visible-area:
- shard-bmg: NOTRUN -> [SKIP][26] ([Intel XE#4422])
[26]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_fbcon_fbt@psr:
- shard-bmg: NOTRUN -> [SKIP][27] ([Intel XE#776])
[27]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@kms_feature_discovery@display-1x:
- shard-bmg: NOTRUN -> [SKIP][28] ([Intel XE#6557] / [Intel XE#6703])
[28]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-2/igt@[email protected]

* igt@kms_feature_discovery@psr2:
- shard-bmg: NOTRUN -> [SKIP][29] ([Intel XE#2374])
[29]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-16bpp-ytile-downscaling:
- shard-bmg: NOTRUN -> [SKIP][30] ([Intel XE#2293] / [Intel XE#2380]) +6 other tests skip
[30]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-16bpp-ytile-downscaling.html

* igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-16bpp-ytile-downscaling@pipe-a-valid-mode:
- shard-bmg: NOTRUN -> [SKIP][31] ([Intel XE#2293]) +6 other tests skip
[31]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-16bpp-ytile-downscaling@pipe-a-valid-mode.html

* igt@kms_frontbuffer_tracking@drrs-rgb565-draw-mmap-wc:
- shard-bmg: NOTRUN -> [SKIP][32] ([Intel XE#2311]) +38 other tests skip
[32]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-spr-indfb-draw-render:
- shard-bmg: NOTRUN -> [SKIP][33] ([Intel XE#4141]) +20 other tests skip
[33]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-spr-indfb-draw-render.html

* igt@kms_frontbuffer_tracking@fbcdrrs-2p-primscrn-shrfb-plflip-blt:
- shard-bmg: NOTRUN -> [SKIP][34] ([Intel XE#6703]) +83 other tests skip
[34]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-2/igt@kms_frontbuffer_tracking@fbcdrrs-2p-primscrn-shrfb-plflip-blt.html

* igt@kms_frontbuffer_tracking@fbcdrrs-tiling-y:
- shard-bmg: NOTRUN -> [SKIP][35] ([Intel XE#2352])
[35]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@kms_frontbuffer_tracking@psr-2p-primscrn-indfb-plflip-blt:
- shard-bmg: NOTRUN -> [SKIP][36] ([Intel XE#2313]) +36 other tests skip
[36]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-10/igt@[email protected]

* igt@kms_joiner@basic-ultra-joiner:
- shard-bmg: NOTRUN -> [SKIP][37] ([Intel XE#6911])
[37]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@kms_joiner@invalid-modeset-big-joiner:
- shard-bmg: NOTRUN -> [SKIP][38] ([Intel XE#6901])
[38]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-10/igt@[email protected]

* igt@kms_joiner@switch-modeset-ultra-joiner-big-joiner:
- shard-bmg: NOTRUN -> [SKIP][39] ([Intel XE#2925])
[39]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_pipe_stress@stress-xrgb8888-yftiled:
- shard-bmg: NOTRUN -> [SKIP][40] ([Intel XE#6912])
[40]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@kms_plane_multiple@2x-tiling-yf:
- shard-bmg: NOTRUN -> [SKIP][41] ([Intel XE#5021]) +1 other test skip
[41]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-c:
- shard-bmg: NOTRUN -> [SKIP][42] ([Intel XE#6886]) +4 other tests skip
[42]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@kms_plane_scaling@[email protected]

* igt@kms_pm_backlight@basic-brightness:
- shard-bmg: NOTRUN -> [SKIP][43] ([Intel XE#870])
[43]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-10/igt@[email protected]

* igt@kms_pm_dc@dc3co-vpb-simulation:
- shard-bmg: NOTRUN -> [SKIP][44] ([Intel XE#2391])
[44]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@kms_pm_dc@dc5-retention-flops:
- shard-bmg: NOTRUN -> [SKIP][45] ([Intel XE#3309])
[45]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-3/igt@[email protected]

* igt@kms_pm_dc@dc6-psr:
- shard-bmg: NOTRUN -> [SKIP][46] ([Intel XE#2392])
[46]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_pm_lpsp@kms-lpsp:
- shard-bmg: NOTRUN -> [SKIP][47] ([Intel XE#2499])
[47]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_pm_rpm@legacy-planes:
- shard-bmg: NOTRUN -> [SKIP][48] ([Intel XE#6693])
[48]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-2/igt@[email protected]

* igt@kms_psr2_sf@fbc-psr2-plane-move-sf-dmg-area:
- shard-bmg: NOTRUN -> [SKIP][49] ([Intel XE#1406] / [Intel XE#1489]) +5 other tests skip
[49]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_psr2_su@page_flip-xrgb8888:
- shard-bmg: NOTRUN -> [SKIP][50] ([Intel XE#1406] / [Intel XE#2387])
[50]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-10/igt@kms_psr2_su@page_flip-xrgb8888.html

* igt@kms_psr@psr-no-drrs:
- shard-bmg: NOTRUN -> [SKIP][51] ([Intel XE#1406] / [Intel XE#2234] / [Intel XE#2850]) +15 other tests skip
[51]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-10/igt@[email protected]

* igt@kms_psr@psr-sprite-plane-onoff:
- shard-bmg: NOTRUN -> [SKIP][52] ([Intel XE#1406] / [Intel XE#6703]) +4 other tests skip
[52]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-2/igt@[email protected]

* igt@kms_rotation_crc@primary-y-tiled-reflect-x-90:
- shard-bmg: NOTRUN -> [SKIP][53] ([Intel XE#3414] / [Intel XE#3904]) +1 other test skip
[53]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_sharpness_filter@filter-basic:
- shard-bmg: NOTRUN -> [SKIP][54] ([Intel XE#6503]) +3 other tests skip
[54]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@kms_vrr@flip-suspend:
- shard-bmg: NOTRUN -> [SKIP][55] ([Intel XE#1499]) +1 other test skip
[55]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@kms_vrr@lobf:
- shard-bmg: NOTRUN -> [SKIP][56] ([Intel XE#2168])
[56]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-2/igt@[email protected]

* igt@xe_compute@eu-busy-10s:
- shard-bmg: NOTRUN -> [SKIP][57] ([Intel XE#6599])
[57]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@xe_create@multigpu-create-massive-size:
- shard-bmg: NOTRUN -> [SKIP][58] ([Intel XE#2504])
[58]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@xe_eudebug@basic-vm-bind-metadata-discovery:
- shard-bmg: NOTRUN -> [SKIP][59] ([Intel XE#4837]) +8 other tests skip
[59]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@xe_eudebug_online@breakpoint-many-sessions-single-tile:
- shard-bmg: NOTRUN -> [SKIP][60] ([Intel XE#4837] / [Intel XE#6665]) +6 other tests skip
[60]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@xe_eudebug_online@pagefault-write-stress:
- shard-bmg: NOTRUN -> [SKIP][61] ([Intel XE#6665] / [Intel XE#6681])
[61]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@xe_exec_basic@multigpu-no-exec-bindexecqueue-userptr-invalidate-race:
- shard-bmg: NOTRUN -> [SKIP][62] ([Intel XE#2322]) +9 other tests skip
[62]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-10/igt@xe_exec_basic@multigpu-no-exec-bindexecqueue-userptr-invalidate-race.html

* igt@xe_exec_multi_queue@few-execs-preempt-mode-close-fd-smem:
- shard-bmg: NOTRUN -> [SKIP][63] ([Intel XE#6874]) +35 other tests skip
[63]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@xe_exec_system_allocator@many-64k-mmap-new-huge-nomemset:
- shard-bmg: NOTRUN -> [SKIP][64] ([Intel XE#5007]) +1 other test skip
[64]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@xe_exec_system_allocator@many-execqueues-mmap-huge-nomemset:
- shard-bmg: NOTRUN -> [SKIP][65] ([Intel XE#4943]) +34 other tests skip
[65]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-2/igt@[email protected]

* igt@xe_exec_system_allocator@pat-index-madvise-pat-idx-uc-single-vma:
- shard-lnl: [PASS][66] -> [FAIL][67] ([Intel XE#5625])
[66]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4364-629c8a9146d75c96e2704592f8764f9553b5fd39/shard-lnl-2/igt@xe_exec_system_allocator@pat-index-madvise-pat-idx-uc-single-vma.html
[67]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-lnl-2/igt@xe_exec_system_allocator@pat-index-madvise-pat-idx-uc-single-vma.html

* igt@xe_module_load@force-load:
- shard-bmg: NOTRUN -> [SKIP][68] ([Intel XE#2457])
[68]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@xe_multigpu_svm@mgpu-latency-prefetch:
- shard-bmg: NOTRUN -> [SKIP][69] ([Intel XE#6964]) +3 other tests skip
[69]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-2/igt@[email protected]

* igt@xe_pat@pat-index-xelp:
- shard-bmg: NOTRUN -> [SKIP][70] ([Intel XE#2245])
[70]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-3/igt@[email protected]

* igt@xe_peer2peer@write:
- shard-bmg: NOTRUN -> [SKIP][71] ([Intel XE#2427] / [Intel XE#6953])
[71]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@xe_pm@d3cold-mocs:
- shard-bmg: NOTRUN -> [SKIP][72] ([Intel XE#2284]) +1 other test skip
[72]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-1/igt@[email protected]

* igt@xe_pxp@pxp-termination-key-update-post-suspend:
- shard-bmg: NOTRUN -> [SKIP][73] ([Intel XE#4733]) +2 other tests skip
[73]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-10/igt@[email protected]

* igt@xe_query@multigpu-query-gt-list:
- shard-bmg: NOTRUN -> [SKIP][74] ([Intel XE#944]) +2 other tests skip
[74]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

* igt@xe_sriov_flr@flr-vfs-parallel:
- shard-bmg: NOTRUN -> [FAIL][75] ([Intel XE#6569]) +1 other test fail
[75]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-bmg-9/igt@[email protected]

#### Possible fixes ####

* igt@kms_setmode@basic@pipe-a-edp-1:
- shard-lnl: [FAIL][76] ([Intel XE#6361]) -> [PASS][77] +1 other test pass
[76]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4364-629c8a9146d75c96e2704592f8764f9553b5fd39/shard-lnl-1/igt@kms_setmode@[email protected]
[77]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-lnl-5/igt@kms_setmode@[email protected]

* igt@xe_exec_reset@gt-reset-stress:
- shard-lnl: [DMESG-WARN][78] -> [PASS][79]
[78]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4364-629c8a9146d75c96e2704592f8764f9553b5fd39/shard-lnl-4/igt@[email protected]
[79]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/shard-lnl-4/igt@[email protected]

[Intel XE#1124]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1124
[Intel XE#1406]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1406
[Intel XE#1489]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1489
[Intel XE#1499]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1499
[Intel XE#1508]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1508
[Intel XE#1727]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1727
[Intel XE#2168]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2168
[Intel XE#2233]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2233
[Intel XE#2234]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2234
[Intel XE#2244]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2244
[Intel XE#2245]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2245
[Intel XE#2252]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2252
[Intel XE#2284]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2284
[Intel XE#2293]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2293
[Intel XE#2311]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2311
[Intel XE#2313]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2313
[Intel XE#2314]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2314
[Intel XE#2320]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2320
[Intel XE#2321]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2321
[Intel XE#2322]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2322
[Intel XE#2325]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2325
[Intel XE#2327]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2327
[Intel XE#2352]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2352
[Intel XE#2370]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2370
[Intel XE#2374]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2374
[Intel XE#2380]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2380
[Intel XE#2387]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2387
[Intel XE#2390]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2390
[Intel XE#2391]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2391
[Intel XE#2392]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2392
[Intel XE#2427]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2427
[Intel XE#2457]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2457
[Intel XE#2499]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2499
[Intel XE#2504]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2504
[Intel XE#2652]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2652
[Intel XE#2850]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2850
[Intel XE#2887]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2887
[Intel XE#2894]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2894
[Intel XE#2925]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2925
[Intel XE#3309]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3309
[Intel XE#3414]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3414
[Intel XE#3432]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3432
[Intel XE#367]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/367
[Intel XE#3904]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3904
[Intel XE#4141]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4141
[Intel XE#4210]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4210
[Intel XE#4422]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4422
[Intel XE#4733]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4733
[Intel XE#4837]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4837
[Intel XE#4943]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4943
[Intel XE#5007]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5007
[Intel XE#5021]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5021
[Intel XE#5625]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5625
[Intel XE#607]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/607
[Intel XE#610]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/610
[Intel XE#6361]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6361
[Intel XE#6503]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6503
[Intel XE#6507]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6507
[Intel XE#6557]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6557
[Intel XE#6569]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6569
[Intel XE#6599]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6599
[Intel XE#6665]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6665
[Intel XE#6681]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6681
[Intel XE#6693]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6693
[Intel XE#6703]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6703
[Intel XE#6743]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6743
[Intel XE#6874]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6874
[Intel XE#6886]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6886
[Intel XE#6901]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6901
[Intel XE#6911]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6911
[Intel XE#6912]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6912
[Intel XE#6953]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6953
[Intel XE#6964]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6964
[Intel XE#6974]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6974
[Intel XE#776]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/776
[Intel XE#787]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/787
[Intel XE#870]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/870
[Intel XE#944]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/944

Build changes
-------------

* Linux: xe-4364-629c8a9146d75c96e2704592f8764f9553b5fd39 -> xe-pw-159119v5

IGT_8694: 8694
xe-4364-629c8a9146d75c96e2704592f8764f9553b5fd39: 629c8a9146d75c96e2704592f8764f9553b5fd39
xe-pw-159119v5: 159119v5

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-159119v5/index.html