migrate on fault for device pages
Subsystems (11)
v17 cover migrate on fault for device pages
From: Mika Penttilä <[email protected]>
Currently, the way device page faulting and migration works is not optimal, if you want to do both fault handling and migration at once.
Being able to migrate not present pages (or pages mapped with incorrect permissions, eg. COW) to the GPU requires doing either of the following sequences:
1. hmm_range_fault() - fault in non-present pages with correct permissions, etc.
2. migrate_vma_*() - migrate the pages
Or:
1. migrate_vma_*() - migrate present pages
2. If non-present pages detected by migrate_vma_*():
a) call hmm_range_fault() to fault pages in
b) call migrate_vma_*() again to migrate now present pages
The problem with the first sequence is that you always have to do two page walks even when most of the time the pages are present or zero page mappings so the common case takes a performance hit.
The second sequence is better for the common case, but far worse if pages aren't present because now you have to walk the page tables three times (once to find the page is not present, once so hmm_range_fault() can find a non-present page to fault in and once again to setup the migration). It is also tricky to code correctly. One page table walk could costs over 1000 cpu cycles on X86-64, which is a significant hit.
We should be able to walk the page table once, faulting pages in as required and replacing them with migration entries if requested.
Add a new flag to HMM APIs, HMM_PFN_REQ_MIGRATE,
which tells to prepare for migration also during fault handling. For the migrate_vma_setup() call paths, new flags, MIGRATE_VMA_FAULT, and MIGRATE_VMA_WRITE are added to tell to add fault handling to migrate.
An extra benefit of migrating with hmm_range_fault() path is the migrate_vma.vma gets populated, so no need to retrieve that separataly.
This series avoids the problems in current collecting implementation, where racing MADV_DONTNEED could make the collecting arrays overflow. This is achieved mainly by having a rollback mechanism and populating the collecting array as the last step.
Tested in X86-64 VM with HMM test device, passing the selftests. The main goal of this patchset is to provide a new feature, migrate efficiently on fault, and not directly improve performance of current migrate_vma_setup() (which is now routed thru hmm_range_fault()) callers. That said, the migrate throughput tests from the selftests show that there is at least no regression for current migrate_vma_setup() callers.
For nouveau migrate-on-fault test harness was : Fedora 44, Mesa Rusticl, and a fine-grained-system-SVM OpenCL program. Nouveau SVM is opt-in via Mesa. The OpenCL program passes
a plain malloc pointer (64 pages, array of integers) to the GPU. Increments each element on GPU, and verifies on the CPU the result. So it drives both directions of migration. With svm_migrate_on_fault=1, no migration at bind happens. The GPU used in testing was Pascal generation GP102.
Changes in v17:
- rebased on v7.4-rc1 (drm-tip)
- addressed sashiko's concerns
- addressed review comments from Balbir
- fixed email address of Liam R. Howlett
Sashiko's concerns in v16
https://sashiko.dev/#/patchset/20261021060506.2377545-1-mpenttil%40redhat.com
Answers to sashiko's concerns per patch:
patch 03
Q "Can this condition in mm/hmm.c:hmm_vma_capture_migrate_range() ever be true?"
A it can't trigger; dropped in v17
Q "Should this check instead verify that the single VMA covers the entire requested range..?"
A In v17 the single vma must cover the whole range (-ERANGE otherwise, like migrate_vma_setup()), and hmm_vma_walk_hole() returns -EFAULT for holes outside a vma when migrating. That handles both the leading hole and the whole-range hole."
Q "is it intentional that hmm_vma_capture_migrate_range() runs before validating vma->vm_flags?"
A Not intentional. In v17 the capture runs only after the vm_flags check, so no MMU_NOTIFY_MIGRATE invalidation is fired for a vma we can't handle, and an unsupported vma fails with -EFAULT when migrating. I also added the same hugetlb/VM_SPECIAL/DAX restrictions as migrate_vma_setup(). Q "Should VMA eligibility for both HMM and migration be verified before capturing the VMA and arming the MMU notifier?"
A Fixed in v17
Q.1 "Invalidation range across faults question"
A.2 In v17 it's closed before faulting and reopened for the next walk, so it only covers walking and collecting
Q.2 "Nested invalidations make the retry check return -EBUSY" A.2 This is pre existig behavior already in hmm_range_walk(). -EBUSY and retries is normal HMM behavior and with migration the caller finalizes the collected so far entries before retry
Q.3 "Re-collecting a page without a fresh invalidate_range_start()..?" A.3 One start/end pair covers every PTE change in the range until the end call
patch 04
Q "about skipping migration entries pte and pmd level"
A In v17 both paths are fixed: when migrating, a foreign migration entry with a fault requested now goes through hmm_do_fault() and waits outside the walk, otherwise the pfns are masked as before; our own collected entries are recognised and kept. The input pfns are also cleared when migrating, so nothing is left uninitialized.
Q "stale enries after EAGAIN->goto again?"
A The !ptep rollback did target the wrong range. In v17, after the pte lock is dropped (split or table gone) the walk restarts the pmd range from start: our own migration entries are recognised (collected and same page) and kept, everything else collected is rolled back as it's revisited. The pmd migration entry path now rolls back before masking, and the own-entry check there requires the same page Q "Behavior after failed splits"
A Fixed that after fail, return what we have so for, no HMM_PFN_ER
patch 05
Q1 "About folio splits.."
A But made a fix for v17 so that check if folio is large before split so no error if already split
Q2 Can this trigger a use-after-free when fault_page is a tail subpage of a large device-private folio?
A A fix is in v17
Q3 "about protnone case for migrate_vma_setup() callers without MIGRATE_VMA_FAULT"
Q4 "Doesn't that make the !pte_present(pte) device-private migration path here unreachable unless range->dev_private_owner is also set to migrate->pgmap_owner?"
A yes both fixed in v17
Q5 "Zero-pfn branch wipes INOUT flags, no vma_is_anonymous() check" A fix is in v17
Q6 "When migrate_vma_split_folio() fails (both here and in the !pte_present(pte) branch above), hmm_vma_handle_migrate_prepare() jumps to out_error and returns -EFAULT"
A This is the same as the earlier split-failure comment: in v17 a failed split no longer reports HMM_PFN_ERROR, and addr keeps its valid pfn (pmd level too). Skipping the rest of the pmd range is intentional and matches existing behavior.
Q6.1: "Could folio_lock held before handle_mm_fault() cause deadlock" A No. Collection is anonymous-only: file folios are never collected, so page cache and invalidate_lock ordering (truncate -> folio_lock) never come into play. Faults are confined to the single vma being migrated, and a non-KSM anonymous page is mapped at most once in it ; that mapping is our migration entry. A PMD-mapped THP is collected whole, behind its PMD migration entry; PTE-mapped large folios are split before collecting.
We never fault our own entries: when migrating, only the PTE that needs a fault is faulted, so migration_entry_wait() on our own lock can't happen.
KSM (the same page at several addresses): the second occurrence fails the collection trylock and isn't collected, and breaking COW (do_wp_page()) copies without taking the lock.
A swapcache folio still referenced by other swap entries isn't collected (folio_free_swap() check); otherwise do_swap_page(), with no retry allowed while migrating, would block on our lock.
Reclaim and compaction under the fault's allocations: reclaim only trylocks, and direct compaction runs with PF_MEMALLOC and never takes a blocking folio lock; it also skips our folios because of the extra reference. Other tasks reach our folios only through the migration entries (migration_entry_wait(), holding no folio locks) or via trylock.
Q6.2 and Q6.3 are addressed in v17: own migration entries are recognised before the required_fault check and kept on re-walk, and the !ptep case re-walks from start without the wrong-range rollback, rolling back collected entries when revisited
patch 06
Q1 "Can returning -EBUSY from the split path in hmm_vma_handle_migrate_prepare_pmd() leave stale pre-split PMD entries in range->hmm_pfns[] across the re-walk?"
A In v17 the re-walk always rewrites or faults these entries: a migration entry is only kept as ours if it's collected (VALID|MIGRATE) and the same page, so the stale pmd output never survives; otherwise it's faulted or reset via out:. Migration takes requests only from default_flags (pfn_flags_mask must be 0, input is cleared), so there are no per-page request flags to clobber. v17 clears the pmd-level entries before re-walking as PTEs.
for Q2 : done in v17: both the pmd folio_trylock() failure and a failed pmd split now return 0, leaving the valid pfns from hmm_vma_handle_pmd() without HMM_PFN_MIGRATE, the same as the PTE-level trylock failure. The HMM_PFN_ERROR fill in hmm_vma_walk_pmd() is gone.
patch 08
Q "What happens if entries in hmm_pfns were previously collected, locks were dropped, and on re-walk the page table entry now requires a fault, fails with -EFAULT, or is a PMD migration entry?" A these should roll back first. fixed in v17
Q "Could reaching the out: label in hmm_vma_handle_pte() prematurely roll back a migration PTE that this walk already installed?" A Addressed in v17. Our own migration entries are recognised before the required_fault check (collected and the same page) and kept, so a re-walk never rolls them back under a live migration pte. A migration entry that isn't ours is rolled back (at out:, or before faulting) and, with REQ_FAULT while migrating, goes through hmm_do_fault() so handle_mm_fault() waits for that migration outside the walk. Q "Does this rollback miss entries collected in [start, addr) when the PTE lock is dropped partway through a PMD?"
A The !ptep rollback over the wrong range fixed in v17
patch 09
same concerns as for patch 03-05 and 08 and addressed in v17
patch 10
Q "What happens in do_fault_and_migrate() if mmu_interval_read_retry() returns true after migrate_vma_pages() has already migrated the folios?" A The state is always consistent: any invalidation also clears the device page table, so there's never a stale device mapping. Normally the trip comes from an unmap/zap: our migration ptes are gone, migrate_vma_finalize() releases the dst pages, and the -EBUSY retry re-migrates. In the remaining case (e.g. a huge zero pmd split in migrate_vma_insert_page()) the pages end up committed with no device mapping yet, which is legal and filled in by the next device fault with real HW. The selftest never hits that case, since the buffer is written first.
Q "Does TEST_F(hmm, migrate_on_fault) actually trigger page faults during hmm_range_fault()?"
A Agreed, with the whole buffer written it never faulted. In v17 the test uses hmm_buffer_alloc() and, like anon_read, leaves the first two pages unwritten: page 0 stays pte_none so hmm_range_fault() has to fault it in before migrating, and page 1 maps the zero page. Both are checked to read back as zero from the device.
patch 11
sashiko flags some previously flagged issues in the documentation patch
patch 12
Q What happens in nouveau_dmem_fence_poll() in drivers/gpu/drm/nouveau/nouveau_dmem.c when nouveau_fence_new() fails in its callers?
A Agreed, the return value was ignored, as in the existing nouveau_dmem code. In v17 both paths that use the poll initialize the fence to NULL, check nouveau_fence_new(), and treat a failure as an unconfirmed copy: readback returns VM_FAULT_SIGBUS, and the fault path doesn't map the page. The same pattern in the existing bulk migration path can be fixed separately.
Q "When the retry loop in nouveau_dmem_migrate_fault() in drivers/gpu/drm/nouveau/nouveau_dmem.c repeats after
ret == -EBUSY (either from hmm_range_fault() or from mmu_interval_read_retry()), does migrate.src (aliased by range.hmm_pfns) retain stale migrate_pfn values from the previous iteration?"
A In v17 hmm_range_fault() clears range->hmm_pfns[] at the start of every migrating walk (requests come only from default_flags), so each retry starts from zero, the same as migrate_vma_setup() zeroing args->src, and there's no early-return path left that keeps an input entry. migrate_hmm_range_setup() also resets dst[] for every entry.
Q Question about drm->dmem->migrate.chan synchronization A Copies from migrate_to_ram(), the SVM fault worker, bulk migration and eviction could write commands and fences into the shared migrate channel concurrently.
In v17 those writes are serialized by a dmem migrate mutex, held only around the command writes and fence creation, not across page allocation. Serializing against TTM's own use of the channel is outside this series.
Q "If nouveau_dmem_fence_poll(&fence) times out and returns -EBUSY here in nouveau_dmem_migrate_fault()
(or above in nouveau_dmem_migrate_to_ram()) in drivers/gpu/drm/nouveau/nouveau_dmem.c, doesn't the page migration still get committed with uncopied data while DMA may still be active?"
A In v17 the migration is committed only after the copy fence completes: migrate_vma_pages() now runs after the wait (the fault path still replays before waiting). If the copy can't be confirmed (timeout or no fence), the entries are marked not migrated, so finalize restores the original ptes and the source stays valid; the GPU fallback then maps the original page. Since a wedged copy engine may still use the pages, their DMA mappings and the destination folios are leaked on purpose rather than unmapped and freed.
Q "Can nouveau_dmem_migrate_fault() in drivers/gpu/drm/nouveau/nouveau_dmem.c
map a VRAM page into the GPU that migrate_vma_pages() rejected and that migrate_vma_finalize() is about to free?"
A In v17 the fault path clears the GPU pfn for every entry that migrate_vma_pages() didn't migrate (MIGRATE_PFN_MIGRATE cleared), so a rejected destination page is never mapped. The existing fallback then maps the original source page in place, which finalize restores.
Q "Why is __nouveau_pfns_map_locked() called before checking whether pfns[0] & NVIF_VMM_PFNMAP_V0_V is set in nouveau_dmem_migrate_fault() in drivers/gpu/drm/nouveau/nouveau_dmem.c?"
A In v17 the GPU is only mapped when the resulting pfn is valid. If nothing migrated and the snapshot isn't mappable (huge zero folio, error entry, failed VRAM allocation), leave the existing GPU mapping untouched and return -ENOENT, so the caller falls back to nouveau_range_fault().
Q "Doesn't ignoring all MMU_NOTIFY_MIGRATE events with range->owner == sn->svmm->vmm->cli->drm->dev in nouveau_svm_range_invalidate() in drivers/gpu/drm/nouveau/nouveau_svm.c also ignore concurrent migrations triggered by other paths on the same device, allowing freed VRAM or system RAM pages to be mapped into the GPU VMM?" A In v17 only the invalidations raised by this fault's own migration are ignored: the per-fault notifier records the task running the walk, and only MIGRATE events from that task while it migrates skip the seq bump.
Q "Should __nouveau_pfns_map_locked() in drivers/gpu/drm/nouveau/nouveau_svm.c propagate the return value of nvif_object_ioctl() to nouveau_dmem_migrate_fault()?" A Yes. In v17 __nouveau_pfns_map_locked() returns the nvif_object_ioctl() result and nouveau_dmem_migrate_fault() propagates it
Link to v16:
https://lore.kernel.org/linux-mm/[email protected]/
Mika Penttilä (12):
mm/Kconfig: changes for migrate on fault for device pages
mm: add helper to convert HMM pfn to migrate pfn
mm/hmm: preparations for HMM to participate in migration mm/hmm: do the plumbing for HMM to participate in migration mm/hmm: migrate collection in HMM pagewalk - pte level mm/hmm: migrate collection in HMM pagewalk - pmd level mm/hmm: add lazy MMU mode support for migration in HMM pagewalk mm/hmm: implement rollback for device page migration in HMM pagewalk
mm: enable device page migration from HMM pagewalk lib/test_hmm: add a new testcase for the migrate on fault Documentation/mm/hmm: document migration through hmm_range_fault() drm/nouveau/svm: add support for migrate on fault
Documentation/mm/hmm.rst | 45 + drivers/gpu/drm/nouveau/nouveau_dmem.c | 402 ++++++++- drivers/gpu/drm/nouveau/nouveau_dmem.h | 12 + drivers/gpu/drm/nouveau/nouveau_svm.c | 155 ++-- drivers/gpu/drm/nouveau/nouveau_svm.h | 5 + include/linux/hmm.h | 51 +- include/linux/migrate.h | 59 +- lib/test_hmm.c | 174 +++- lib/test_hmm_uapi.h | 21 +- mm/Kconfig | 1 + mm/hmm.c | 1075 ++++++++++++++++++++++-- mm/migrate_device.c | 618 +++----------- tools/testing/selftests/mm/hmm-tests.c | 56 ++ 13 files changed, 1984 insertions(+), 690 deletions(-)
drm-tip
base-commit: abc364961b361ab626fa5a09568b22744f1e0393
Signature · 1 line
2.55.0
PATCH v17 1/12 mm/Kconfig: changes for migrate on fault for device pages
From: Mika Penttilä <[email protected]>
HMM depends on MMU notifiers. With the unified HMM/migrate_device page table walk migrate_device needs HMM enabled. Enable them explicitly to avoid breaking random configs.
--- mm/Kconfig | 1 + 1 file changed, 1 insertion(+)
mm/Kconfig +1 -0
@@ -682,6 +682,7 @@ config MIGRATION config DEVICE_MIGRATION def_bool MIGRATION && ZONE_DEVICE + select HMM_MIRROR config ARCH_ENABLE_HUGEPAGE_MIGRATION bool
Signature · 1 line
2.55.0
PATCH v17 2/12 mm: add helper to convert HMM pfn to migrate pfn
In reply to [email protected]From: Mika Penttilä <[email protected]>
The unified HMM/migrate_device pagewalk does the "collecting" on the HMM side, so we need a helper to transfer pfns to the migrate_vma world.
--- include/linux/hmm.h | 29 +++++++++++++++++----- include/linux/migrate.h | 3 ++- mm/migrate_device.c | 55 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 7 deletions(-)
include/linux/hmm.h +23 -6
@@ -13,6 +13,8 @@struct mmu_interval_notifier ; +struct migrate_vma ; +/* * On output: * 0 - The page is faultable and a future call with
@@ -27,13 +29,22 @@ struct mmu_interval_notifier;* HMM_PFN_P2PDMA_BUS - Bus mapped P2P transfer * HMM_PFN_DMA_MAPPED - Flag preserved on input-to-output transformation * to mark that page is already DMA mapped +* HMM_PFN_MIGRATE - The entry is to be migrated. Note, HMM_PFN_MIGRATE +* alone without HMM_PFN_VALID denotes the +* empty page. +* This flag optionally together with HMM_PFN_COMPOUND +* are indicators for migrate_hmm_range_setup() to +* setup the migrate pfns. +* HMM_PFN_COMPOUND - The entry represents a > 0 order page * * On input: -* 0 - Return the current state of the page, do not fault it. -* HMM_PFN_REQ_FAULT - The output must have HMM_PFN_VALID or hmm_range_fault() -* will fail -* HMM_PFN_REQ_WRITE - The output must have HMM_PFN_WRITE or hmm_range_fault() -* will fail. Must be combined with HMM_PFN_REQ_FAULT. +* 0 - Return the current state of the page, do not fault it. +* HMM_PFN_REQ_FAULT - The output must have HMM_PFN_VALID or hmm_range_fault() +* will fail +* HMM_PFN_REQ_WRITE - The output must have HMM_PFN_WRITE or hmm_range_fault() +* will fail. Must be combined with HMM_PFN_REQ_FAULT. +* HMM_PFN_REQ_MIGRATE - For default_flags only, request to migrate the range, +* according to hmm_range.migrate.flags */ enum hmm_pfn_flags {/* Output fields and flags */
@@ -48,11 +59,15 @@ enum hmm_pfn_flags {HMM_PFN_P2PDMA =1UL << (BITS_PER_LONG -5 ),HMM_PFN_P2PDMA_BUS =1UL << (BITS_PER_LONG -6 ), -HMM_PFN_ORDER_SHIFT = (BITS_PER_LONG -11 ), +/* Migrate request */ +HMM_PFN_MIGRATE =1UL << (BITS_PER_LONG -7 ), +HMM_PFN_COMPOUND =1UL << (BITS_PER_LONG -8 ), +HMM_PFN_ORDER_SHIFT = (BITS_PER_LONG -13 ),/* Input flags */ HMM_PFN_REQ_FAULT =HMM_PFN_VALID ,HMM_PFN_REQ_WRITE =HMM_PFN_WRITE , +HMM_PFN_REQ_MIGRATE =HMM_PFN_MIGRATE , HMM_PFN_FLAGS = ~((1UL << HMM_PFN_ORDER_SHIFT) - 1), };
@@ -107,6 +122,7 @@ static inline unsigned int hmm_pfn_to_map_order(unsigned long hmm_pfn)* @default_flags: default flags for the range (write, read, ... see hmm doc) * @pfn_flags_mask: allows to mask pfn flags so that only default_flags matter * @dev_private_owner: owner of device private pages +* @migrate: structure for migrating a range of a VMA */ struct hmm_range {struct mmu_interval_notifier *notifier;
@@ -117,6 +133,7 @@ struct hmm_range {unsigned long default_flags;unsigned long pfn_flags_mask;void *dev_private_owner; +struct migrate_vma *migrate; };/*
include/linux/migrate.h +2 -1
@@ -3,6 +3,7 @@#define _LINUX_MIGRATE_H#include <linux/mm.h> +#include <linux/hmm.h> #include <linux/mempolicy.h> #include <linux/migrate_mode.h> #include <linux/hugetlb.h>
@@ -202,7 +203,7 @@ void migrate_device_pages(unsigned long *src_pfns, unsigned long *dst_pfns, unsigned long npages);void migrate_device_finalize (unsigned long *src_pfns,unsigned long *dst_pfns,unsigned long npages); - +void migrate_hmm_range_setup (struct hmm_range *range);#endif /* CONFIG_MIGRATION */ #endif /* _LINUX_MIGRATE_H */
mm/migrate_device.c +55 -0
58 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH v17 4/12 mm/hmm: do the plumbing for HMM to participate in migration
In reply to [email protected]From: Mika Penttilä <[email protected]>
Do the preparations in hmm_range_fault() and pagewalk callbacks to do the "collecting" part of migration, needed for migration.
These steps include locking for pmd/pte if migrating, and calling the still dummy hmm_vma_handle_migrate_prepare_pmd() and hmm_vma_handle_migrate_prepare() functions in the pagewalk.
When doing migration, have to have pmd/pte table locked for the duration of both hmm_vma_handle*() and hmm_vma_handle_migrate_prepare*() walks, and unlock when handling the faults.
--- mm/hmm.c | 342 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 295 insertions(+), 47 deletions(-)
mm/hmm.c +295 -47
@@ -42,6 +42,16 @@ struct hmm_vma_walk {unsigned long start;unsigned long end;unsigned long last; +/* +* For migration we need pte/pmd locked for the handle_* and +* prepare_* regions. While faulting we have to drop the locks +* and start again. ptelocked and pmdlocked hold the state +* and tell if need to drop locks before faulting. +* ptl is the lock held for pte or pmd. +*/ +bool ptelocked; +bool pmdlocked; +spinlock_t *ptl;/* fault and lock drop related fields */ bool *mmlocked;unsigned long fault_end;
@@ -63,6 +73,16 @@ struct hmm_vma_walk {*/ #define HMM_FAULT_UNLOCKED -ENOLCK +#define HMM_ASSERT_PTE_LOCKED (hmm_vma_walk, locked) \ + WARN_ON_ONCE((hmm_vma_walk)->ptelocked != locked) + +#define HMM_ASSERT_PMD_LOCKED (hmm_vma_walk, locked) \ + WARN_ON_ONCE((hmm_vma_walk)->pmdlocked != locked) + +#define HMM_ASSERT_UNLOCKED (hmm_vma_walk) \ + WARN_ON_ONCE((hmm_vma_walk)->ptelocked || \ + (hmm_vma_walk)->pmdlocked) +enum {HMM_NEED_FAULT =1 <<0 ,HMM_NEED_WRITE_FAULT =1 <<1 ,
@@ -76,14 +96,38 @@ enum { };static int hmm_pfns_fill (unsigned long addr,unsigned long end, -struct hmm_range *range,unsigned long cpu_flags) +struct hmm_vma_walk *hmm_vma_walk,unsigned long cpu_flags) { +struct hmm_range *range = hmm_vma_walk->range;unsigned long i = (addr - range->start) >>PAGE_SHIFT ; +enum migrate_vma_info minfo; +bool migrate = false; + + minfo =hmm_select_migrate (range); +if (cpu_flags !=HMM_PFN_ERROR ) { +if (minfo && (vma_is_anonymous (hmm_vma_walk->vma))) { + cpu_flags |=HMM_PFN_MIGRATE ; + migrate = true; + } + } + +if (migrate &&thp_migration_supported () && + (minfo &MIGRATE_VMA_SELECT_COMPOUND ) && +IS_ALIGNED (addr,HPAGE_PMD_SIZE ) && +IS_ALIGNED (end,HPAGE_PMD_SIZE ) && + end-addr ==HPAGE_PMD_SIZE ) { + range->hmm_pfns[i] &=HMM_PFN_INOUT_FLAGS ; + range->hmm_pfns[i] |= cpu_flags |HMM_PFN_COMPOUND ; + addr +=PAGE_SIZE ; + i++; + cpu_flags =0 ; + }for (; addr < end; addr +=PAGE_SIZE , i++) { range->hmm_pfns[i] &=HMM_PFN_INOUT_FLAGS ; range->hmm_pfns[i] |= cpu_flags; } +return 0 ; }
@@ -103,6 +147,7 @@ static int hmm_record_fault(unsigned long addr, unsigned long end,struct hmm_vma_walk *hmm_vma_walk = walk->private;WARN_ON_ONCE (!required_fault); +HMM_ASSERT_UNLOCKED (hmm_vma_walk); hmm_vma_walk->last = addr; hmm_vma_walk->fault_end = end; hmm_vma_walk->required_fault = required_fault;
@@ -187,11 +232,16 @@ static int hmm_vma_walk_hole(unsigned long addr, unsigned long end,if (!walk->vma) {if (required_fault ||hmm_select_migrate (range))return -EFAULT ; -return hmm_pfns_fill (addr, end, range,HMM_PFN_ERROR ); +return hmm_pfns_fill (addr, end, hmm_vma_walk,HMM_PFN_ERROR ); } -if (required_fault) +if (required_fault) { +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + }return hmm_record_fault (addr, end, required_fault, walk); -return hmm_pfns_fill (addr, end, range,0 ); + } +return hmm_pfns_fill (addr, end, hmm_vma_walk,0 ); }static inline unsigned long hmm_pfn_flags_order (unsigned long order)
@@ -224,8 +274,13 @@ static int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr, cpu_flags =pmd_to_hmm_pfn_flags (range, pmd); required_fault =hmm_range_need_fault (hmm_vma_walk, hmm_pfns, npages, cpu_flags); -if (required_fault) +if (required_fault) { +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + }return hmm_record_fault (addr, end, required_fault, walk); + } pfn =pmd_pfn (pmd) + ((addr & ~PMD_MASK ) >>PAGE_SHIFT );for (i =0 ; addr < end; addr +=PAGE_SIZE , i++, pfn++) {
@@ -305,6 +360,14 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, goto fault;if (softleaf_is_migration (entry)) { +/* +* Someone else's migration: when migrating, wait in +* handle_mm_fault() via hmm_do_fault(), outside the walk +* and with the migrate invalidation closed. +*/ +if (hmm_select_migrate (range)) + goto fault; +HMM_ASSERT_UNLOCKED (hmm_vma_walk);pte_unmap (ptep); hmm_vma_walk->last = addr;migration_entry_wait (walk->mm, pmdp, addr);
@@ -312,7 +375,14 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, }/* Report error for everything else */ -pte_unmap (ptep); + +if (hmm_vma_walk->ptelocked) { +pte_unmap_unlock (ptep, hmm_vma_walk->ptl); + hmm_vma_walk->ptelocked = false; + }else { +pte_unmap (ptep); + } +return -EFAULT ; }
@@ -329,7 +399,13 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,if (!vm_normal_page (walk->vma, addr, pte) && !is_zero_pfn (pte_pfn (pte))) {if (hmm_pte_need_fault (hmm_vma_walk, pfn_req_flags,0 )) { -pte_unmap (ptep); +if (hmm_vma_walk->ptelocked) { +pte_unmap_unlock (ptep, hmm_vma_walk->ptl); + hmm_vma_walk->ptelocked = false; + }else { +pte_unmap (ptep); + } +return -EFAULT ; } new_pfn_flags =HMM_PFN_ERROR ;
@@ -342,7 +418,12 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,return 0 ; fault: -pte_unmap (ptep); +if (hmm_vma_walk->ptelocked) { +pte_unmap_unlock (ptep, hmm_vma_walk->ptl); + hmm_vma_walk->ptelocked = false; + }else { +pte_unmap (ptep); + }/* Fault any virtual address we were asked to fault */ return hmm_record_fault (addr, end, required_fault, walk); }
@@ -386,13 +467,18 @@ static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start, required_fault =hmm_range_need_fault (hmm_vma_walk, hmm_pfns, npages,0 );if (required_fault) { -if (softleaf_is_device_private (entry)) +if (softleaf_is_device_private (entry)) { +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + }return hmm_record_fault (addr, end, required_fault, walk); + }else return -EFAULT ; } -return hmm_pfns_fill (start, end, range,HMM_PFN_ERROR ); +return hmm_pfns_fill (start, end, hmm_vma_walk,HMM_PFN_ERROR ); }#else static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start,
@@ -400,15 +486,58 @@ static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start, pmd_t pmd) {struct hmm_vma_walk *hmm_vma_walk = walk->private; -struct hmm_range *range = hmm_vma_walk->range;unsigned long npages = (end - start) >>PAGE_SHIFT ;if (hmm_range_need_fault (hmm_vma_walk, hmm_pfns, npages,0 ))return -EFAULT ; -return hmm_pfns_fill (start, end, range,HMM_PFN_ERROR ); +return hmm_pfns_fill (start, end, hmm_vma_walk,HMM_PFN_ERROR ); }#endif /* CONFIG_ARCH_HAS_PMD_SOFTLEAVES */ +#ifdef CONFIG_DEVICE_MIGRATION +static int hmm_vma_handle_migrate_prepare_pmd (const struct mm_walk *walk, +pmd_t *pmdp, +unsigned long start, +unsigned long end, +unsigned long *hmm_pfn) +{ +// TODO: implement migration entry insertion +return 0 ; +} + +static int hmm_vma_handle_migrate_prepare (const struct mm_walk *walk, +pmd_t *pmdp, +pte_t *ptep, +unsigned long addr, +unsigned long *hmm_pfn, +bool *unmapped) +{ +// TODO: implement migration entry insertion +return 0 ; +} + +#else +static int hmm_vma_handle_migrate_prepare_pmd (const struct mm_walk *walk, +pmd_t *pmdp, +unsigned long start, +unsigned long end, +unsigned long *hmm_pfn) +{ +return 0 ; +} + +static int hmm_vma_handle_migrate_prepare (const struct mm_walk *walk, +pmd_t *pmdp, +pte_t *ptep, +unsigned long addr, +unsigned long *hmm_pfn, +bool *unmapped) +{ +return 0 ; +} + +#endif +static int hmm_vma_capture_migrate_range (unsigned long start,unsigned long end,struct mm_walk *walk)
@@ -483,46 +612,124 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp, {struct hmm_vma_walk *hmm_vma_walk = walk->private;struct hmm_range *range = hmm_vma_walk->range; -unsigned long *hmm_pfns = - &range->hmm_pfns[(start - range->start) >>PAGE_SHIFT ];unsigned long npages = (end - start) >>PAGE_SHIFT ; +struct mm_struct *mm = walk->vma->vm_mm; +unsigned long *hmm_pfns, *hmm_pfns_start; +enum migrate_vma_info minfo;unsigned long addr = start; +bool unmapped = false; +unsigned long i;pte_t *ptep;pmd_t pmd; +int r =0 ; + minfo =hmm_select_migrate (range); + hmm_pfns_start = &range->hmm_pfns[(start - range->start) >>PAGE_SHIFT ]; again: - pmd =pmdp_get_lockless (pmdp); -if (pmd_none (pmd)) -return hmm_vma_walk_hole (start, end,-1 , walk); + hmm_pfns = &range->hmm_pfns[(addr - range->start) >>PAGE_SHIFT ]; + hmm_vma_walk->ptelocked = false; + hmm_vma_walk->pmdlocked = false; + +if (minfo) { + hmm_vma_walk->ptl =pmd_lock (mm, pmdp); + hmm_vma_walk->pmdlocked = true; + pmd =pmdp_get (pmdp); + }else + pmd =pmdp_get_lockless (pmdp); + +if (pmd_none (pmd)) { + r =hmm_vma_walk_hole (start, end,-1 , walk); + +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + } +return r; + }if (thp_migration_supported () &&pmd_is_migration_entry (pmd)) { -if (hmm_range_need_fault (hmm_vma_walk, hmm_pfns, npages,0 )) { +unsigned int required_fault = +hmm_range_need_fault (hmm_vma_walk, hmm_pfns_start, npages,0 ); + +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + } + +if (required_fault) { +/* +* Someone else's migration: when migrating, wait in +* handle_mm_fault() via hmm_do_fault(), outside the walk +* and with the migrate invalidation closed. +*/ +if (minfo) +return hmm_record_fault (addr, end, required_fault, walk); hmm_vma_walk->last = addr;pmd_migration_entry_wait (walk->mm, pmdp);return -EBUSY ; } -return hmm_pfns_fill (start, end, range,0 ); +for (i =0 ; start < end; start +=PAGE_SIZE , i++) + hmm_pfns_start[i] &=HMM_PFN_INOUT_FLAGS ; + +return 0 ; } -if (!pmd_present (pmd)) -return hmm_vma_handle_absent_pmd (walk, start, end, hmm_pfns, - pmd); +if (pmd_trans_huge (pmd) || !pmd_present (pmd)) { +if (!pmd_present (pmd)) { + r =hmm_vma_handle_absent_pmd (walk, start, end, hmm_pfns_start, + pmd); +// If not migrating we are done +if (r || !minfo) { +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + } +return r; + } + } -if (pmd_trans_huge (pmd)) { -/* -* No need to take pmd_lock here, even if some other thread -* is splitting the huge pmd we will get that event through -* mmu_notifier callback. -* -* So just read pmd value and check again it's a transparent -* huge or device mapping one and compute corresponding pfn -* values. -*/ - pmd =pmdp_get_lockless (pmdp); -if (!pmd_trans_huge (pmd)) - goto again; +if (pmd_trans_huge (pmd)) { +/* +* No need to take pmd_lock here if not migrating, +* even if some other thread is splitting the huge +* pmd we will get that event through mmu_notifier callback. +* +* So just read pmd value and check again it's a transparent +* huge or device mapping one and compute corresponding pfn +* values. +*/ + +if (!minfo) { + pmd =pmdp_get_lockless (pmdp); +if (!pmd_trans_huge (pmd)) + goto again; + } + + r =hmm_vma_handle_pmd (walk, start, end, hmm_pfns_start, pmd); + +// If not migrating we are done +if (r || !minfo) { +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + } +return r; + } + } + + r =hmm_vma_handle_migrate_prepare_pmd (walk, pmdp, start, end, hmm_pfns_start); + +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; + } + +return r; + } -return hmm_vma_handle_pmd (walk, addr, end, hmm_pfns, pmd); +if (hmm_vma_walk->pmdlocked) { +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false; }/*
@@ -532,24 +739,65 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,* recover. */ if (pmd_bad (pmd)) { -if (hmm_range_need_fault (hmm_vma_walk, hmm_pfns, npages,0 )) +if (hmm_range_need_fault (hmm_vma_walk, hmm_pfns_start, npages,0 ))return -EFAULT ; -return hmm_pfns_fill (start, end, range,HMM_PFN_ERROR ); +return hmm_pfns_fill (start, end, hmm_vma_walk,HMM_PFN_ERROR ); } - ptep =pte_offset_map (pmdp, addr); -if (!ptep) +if (minfo) { + ptep =pte_offset_map_lock (mm, pmdp, addr, &hmm_vma_walk->ptl); +if (ptep) + hmm_vma_walk->ptelocked = true; + }else { + ptep =pte_offset_map (pmdp, addr); + } +if (!ptep) { + addr = start; goto again; + } +for (; addr < end; addr +=PAGE_SIZE , ptep++, hmm_pfns++) { -int r; r =hmm_vma_handle_pte (walk, addr, end, pmdp, ptep, hmm_pfns);if (r) { -/* hmm_vma_handle_pte() did pte_unmap() */ +/* hmm_vma_handle_pte() did pte_unmap() / pte_unmap_unlock */ +if (unmapped) +flush_tlb_range (walk->vma, start, addr);return r; } + + r =hmm_vma_handle_migrate_prepare (walk, pmdp, ptep, addr, hmm_pfns, &unmapped); +if (r == -EAGAIN ) { +HMM_ASSERT_UNLOCKED (hmm_vma_walk); +if (unmapped) { +flush_tlb_range (walk->vma, start, addr); + unmapped = false; + } + goto again; + } +if (r) { +/* +* Splitting the folio failed; migrate_vma_split_folio() +* already dropped the PTE lock. Don't migrate the rest +* of the pmd range; addr keeps its valid pfn. +*/ +HMM_ASSERT_UNLOCKED (hmm_vma_walk); +if (unmapped) +flush_tlb_range (walk->vma, start, addr); +return 0 ; + } + } + +if (unmapped) +flush_tlb_range (walk->vma, start, addr); + +if (hmm_vma_walk->ptelocked) { +pte_unmap_unlock (ptep -1 , hmm_vma_walk->ptl); + hmm_vma_walk->ptelocked = false; + }else { +pte_unmap (ptep -1 ); } -pte_unmap (ptep -1 ); +return 0 ; }
@@ -696,7 +944,7 @@ static int hmm_vma_walk_test(unsigned long start, unsigned long end, (end - start) >> PAGE_SHIFT, 0))return -EFAULT ; -hmm_pfns_fill (start, end, range,HMM_PFN_ERROR ); +hmm_pfns_fill (start, end, hmm_vma_walk,HMM_PFN_ERROR );/* Skip this vma and continue processing the next vma. */ return 1 ;
@@ -833,9 +1081,9 @@ static int hmm_range_fault_locked(struct hmm_range *range, bool *locked)hmm_vma_migrate_disarm (&hmm_vma_walk); ret =hmm_do_fault (mm, &hmm_vma_walk);if (ret ==HMM_FAULT_UNLOCKED ) { -if (fatal_signal_pending (current)) -return -EINTR ; -return -EBUSY ; + ret =fatal_signal_pending (current) ? -EINTR : + -EBUSY ; +break ; } }/*
Signature · 1 line
2.55.0
PATCH v17 5/12 mm/hmm: migrate collection in HMM pagewalk - pte level
In reply to [email protected]From: Mika Penttilä <[email protected]>
Implement the needed hmm_vma_handle_migrate_prepare() function which is mostly carried over from migrate_device.c's migrate_vma_collect_pmd() function.
Also implement the migrate_vma_split_folio(), for splitting pte mapped large folios. It is also mostly from migrate_device.c, with care taken to reference folio before releasing page table lock.
With HMM pagewalk based migration, the idea is that hmm_vma_handle_*() are responsible for faulting,
and the pfn collecting part. hmm_vma_handle_migrate_prepare*() do the migration decisions (with HMM_PFN_MIGRATE), possibly split folios, and insert migration ptes/pmds.
Collected folios stay locked while hmm_range_fault() may still fault other pages of the range. This cannot self-deadlock: only anonymous folios are collected, so no page cache or invalidate_lock ordering is involved; faults are confined to the single vma, where a non-KSM anonymous page is mapped only once (and that mapping is now our migration entry); and when migrating only the faulting pte is faulted, never our own entries. A KSM page's second mapping just fails the collection trylock, and a swapcache folio still referenced by other swap entries is not collected. Reclaim and direct compaction under the fault only trylock folio locks.
HMM pagewalk based migration is enabled in later commit, for now hmm_select_migrate() returns 0.
--- mm/hmm.c | 294 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 293 insertions(+), 1 deletion(-)
mm/hmm.c +293 -1
@@ -495,6 +495,71 @@ static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start,#endif /* CONFIG_ARCH_HAS_PMD_SOFTLEAVES */ #ifdef CONFIG_DEVICE_MIGRATION +/** +* migrate_vma_split_folio() - Helper function to split a THP folio +* @folio: the folio to split +* @fault_page: struct page associated with the fault if any +* @hmm_vma_walk: walk in progress +* @ptep: pte_t * for unmap and unlock ptl +* +* Always drops the pte lock associated with @ptep. +* +* Returns 0 on success +*/ +static int migrate_vma_split_folio (struct folio *folio, +struct page *fault_page, +struct hmm_vma_walk *hmm_vma_walk, +pte_t *ptep) +{ +int ret; +struct folio *fault_folio = fault_page ?page_folio (fault_page) :NULL ; +struct folio *new_fault_folio =NULL ; + +/* +* Take the reference while still holding the PTE lock, so the folio +* cannot be freed once the lock is dropped. folio_lock() may sleep, +* so it can only be taken after dropping the PTE spinlock. The fault +* folio is already referenced and locked by do_swap_page(). +*/ +if (folio != fault_folio) +folio_get (folio); + +pte_unmap_unlock (ptep, hmm_vma_walk->ptl); + hmm_vma_walk->ptelocked = false; + +if (folio != fault_folio) +folio_lock (folio); + + ret =split_folio (folio); +if (ret) { +if (folio != fault_folio) { +folio_unlock (folio); +folio_put (folio); + } +return ret; + } + + new_fault_folio = fault_page ?page_folio (fault_page) :NULL ; + +/* +* Ensure the lock is held on the correct +* folio after the split +*/ +if (!new_fault_folio) { +folio_unlock (folio); +folio_put (folio); + }else if (folio != new_fault_folio) { +if (new_fault_folio != fault_folio) { +folio_get (new_fault_folio); +folio_lock (new_fault_folio); + } +folio_unlock (folio); +folio_put (folio); + } + +return 0 ; +} + static int hmm_vma_handle_migrate_prepare_pmd(const struct mm_walk *walk, pmd_t *pmdp, unsigned long start,
@@ -505,6 +570,11 @@ static int hmm_vma_handle_migrate_prepare_pmd(const struct mm_walk *walk,return 0 ; } +/* +* Install migration entries if migration requested, either from fault +* or migrate paths. +* +*/ static int hmm_vma_handle_migrate_prepare(const struct mm_walk *walk, pmd_t *pmdp, pte_t *ptep,
@@ -512,8 +582,230 @@ static int hmm_vma_handle_migrate_prepare(const struct mm_walk *walk,unsigned long *hmm_pfn, bool *unmapped) { -// TODO: implement migration entry insertion + struct hmm_vma_walk *hmm_vma_walk = walk->private; +struct hmm_range *range = hmm_vma_walk->range; +struct migrate_vma *migrate = range->migrate; +struct mm_struct *mm = walk->vma->vm_mm; +struct folio *fault_folio =NULL ; +enum migrate_vma_info minfo; +struct dev_pagemap *pgmap; +bool anon_exclusive; +struct folio *folio; +unsigned long pfn; +struct page *page; +softleaf_t entry; +pte_t pte, swp_pte; +bool writable = false; + +// Do we want to migrate at all? + minfo =hmm_select_migrate (range); +if (!minfo) +return 0 ; + +WARN_ON_ONCE (!migrate); +HMM_ASSERT_PTE_LOCKED (hmm_vma_walk, true); + + fault_folio = migrate->fault_page ? +page_folio (migrate->fault_page) :NULL ; + + pte =ptep_get (ptep); + +if (pte_none (pte)) { +if (vma_is_anonymous (walk->vma)) { + *hmm_pfn &=HMM_PFN_INOUT_FLAGS ; + *hmm_pfn |=HMM_PFN_MIGRATE ; + goto out; + } + } + +/* +* NUMA hinting (protnone) entries are not reported valid, but the +* page can still be migrated as is. +*/ +if (!(hmm_pfn[0 ] &HMM_PFN_VALID ) && + !(pte_present (pte) &&pte_protnone (pte))) + goto out; + +if (!pte_present (pte)) { +/* +* Only care about unaddressable device page special +* page table entry. Other special swap entries are not +* migratable, and we ignore regular swapped page. +*/ + entry =softleaf_from_pte (pte); +if (!softleaf_is_device_private (entry)) + goto out; + +if (!(minfo &MIGRATE_VMA_SELECT_DEVICE_PRIVATE )) + goto out; + + page =softleaf_to_page (entry); + folio =page_folio (page); +if (folio->pgmap->owner != migrate->pgmap_owner) + goto out; + +if (folio_test_large (folio)) { +int ret; + + ret =migrate_vma_split_folio (folio, + migrate->fault_page, + hmm_vma_walk, + ptep); +if (ret) + goto out_error; +return -EAGAIN ; + } + + pfn =page_to_pfn (page); +if (softleaf_is_device_private_write (entry)) + writable = true; + }else { + pfn =pte_pfn (pte); +if (is_zero_pfn (pfn) && + (minfo &MIGRATE_VMA_SELECT_SYSTEM )) { +/* Like pte_none(): only anonymous memory can be populated */ +if (!vma_is_anonymous (walk->vma)) + goto out; + *hmm_pfn &=HMM_PFN_INOUT_FLAGS ; + *hmm_pfn |=HMM_PFN_MIGRATE ; + goto out; + } + page =vm_normal_page (walk->vma, addr, pte); +if (page && !is_zone_device_page (page) && + !(minfo &MIGRATE_VMA_SELECT_SYSTEM )) { + goto out; + }else if (page &&is_device_coherent_page (page)) { + pgmap =page_pgmap (page); + +if (!(minfo & +MIGRATE_VMA_SELECT_DEVICE_COHERENT ) || + pgmap->owner != migrate->pgmap_owner) + goto out; + } + + folio = page ?page_folio (page) :NULL ; +if (folio &&folio_test_large (folio)) { +int ret; + + ret =migrate_vma_split_folio (folio, + migrate->fault_page, + hmm_vma_walk, + ptep); +if (ret) + goto out_error; +return -EAGAIN ; + } + + writable =pte_write (pte); + } + +/* Only anonymous memory can be migrated to device memory */ +if (!page || !folio_test_anon (page_folio (page))) + goto out; + +/* +* By getting a reference on the folio we pin it and that blocks +* any kind of migration. Side effect is that it "freezes" the +* pte. +* +* We drop this reference after isolating the folio from the lru +* for non device folio (device folio are not on the lru and thus +* can't be dropped from it). +*/ + folio =page_folio (page); +folio_get (folio); + +/* +* We rely on folio_trylock() to avoid deadlock between +* concurrent migrations where each is waiting on the others +* folio lock. If we can't immediately lock the folio we fail this +* migration as it is only best effort anyway. +* +* If we can lock the folio it's safe to set up a migration entry +* now. In the common case where the folio is mapped once in a +* single process setting up the migration entry now is an +* optimisation to avoid walking the rmap later with +* try_to_migrate(). +*/ + +if (fault_folio == folio ||folio_trylock (folio)) { +/* +* A swapcache folio still referenced by other swap entries +* can't be migrated (see migrate_device_pages()), and faulting +* one of those entries later in the walk, with no retry +* allowed, would block on the lock we hold. +*/ +if (folio_test_swapcache (folio) && !folio_free_swap (folio)) { +if (fault_folio != folio) +folio_unlock (folio); +folio_put (folio); + goto out; + } + + anon_exclusive =folio_test_anon (folio) && +PageAnonExclusive (page); + +if (pte_present (pte)) +flush_cache_page (walk->vma, addr, pfn); + +if (anon_exclusive) { + pte =ptep_clear_flush (walk->vma, addr, ptep); + +if (folio_try_share_anon_rmap_pte (folio, page)) { +set_pte_at (mm, addr, ptep, pte); +if (fault_folio != folio) +folio_unlock (folio); +folio_put (folio); + goto out; + } + }else { + pte =ptep_get_and_clear (mm, addr, ptep); + } + +if (pte_present (pte) &&pte_dirty (pte)) +folio_mark_dirty (folio); + +/* Setup special migration page table entry */ +if (writable) + entry =make_writable_migration_entry (pfn); +else if (anon_exclusive) + entry =make_readable_exclusive_migration_entry (pfn); +else + entry =make_readable_migration_entry (pfn); + +if (pte_present (pte)) { +if (pte_young (pte)) + entry =make_migration_entry_young (entry); +if (pte_dirty (pte)) + entry =make_migration_entry_dirty (entry); + } + + swp_pte =swp_entry_to_pte (entry); +if (pte_present (pte)) { +if (pte_soft_dirty (pte)) + swp_pte =pte_swp_mksoft_dirty (swp_pte); +if (pte_uffd (pte)) + swp_pte =pte_swp_mkuffd (swp_pte); + }else { +if (pte_swp_soft_dirty (pte)) + swp_pte =pte_swp_mksoft_dirty (swp_pte); +if (pte_swp_uffd (pte)) + swp_pte =pte_swp_mkuffd (swp_pte); + } + +set_pte_at (mm, addr, ptep, swp_pte); +folio_remove_rmap_pte (folio, page, walk->vma); +folio_put (folio); + *hmm_pfn |=HMM_PFN_VALID |HMM_PFN_MIGRATE ; +if (pte_present (pte)) + *unmapped = true; + }else { +folio_put (folio); + } +out:return 0 ; +out_error: +return -EFAULT ; }#else
Signature · 1 line
2.55.0
PATCH v17 6/12 mm/hmm: migrate collection in HMM pagewalk - pmd level
In reply to [email protected]From: Mika Penttilä <[email protected]>
Implement the needed hmm_vma_handle_migrate_prepare_pmd() function which is mostly carried over from migrate_device.c's migrate_vma_collect_huge_pmd() function.
With HMM pagewalk based migration, the idea is that hmm_vma_handle_*() are responsible for faulting, and the pfn collecting part. hmm_vma_handle_migrate_prepare*() do the migration decisions (with HMM_PFN_MIGRATE), possibly split folios, and insert migration ptes/pmds.
Locking follows the same rules as at the pte level (see the previous commit): the folio is only trylocked, a PMD-mapped THP is collected whole behind its pmd migration entry (its only mapping in the vma), and a swapcache folio still referenced by other swap entries is not collected. On a trylock or split failure the valid pfns are kept and nothing is migrated.
HMM pagewalk based migration is enabled in later commit, for now hmm_select_migrate() returns 0.
Also avoid the problems present in the migrate_vma_collect_huge_pmd() split fallback path this HMM path supersedes:
- extra refcount for fault_folio makes split_folio() fail
- wrong folio unlocked after split_folio()
--- mm/hmm.c | 183 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 152 insertions(+), 31 deletions(-)
mm/hmm.c +152 -31
@@ -496,7 +496,33 @@ static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start,#ifdef CONFIG_DEVICE_MIGRATION /** -* migrate_vma_split_folio() - Helper function to split a THP folio +* __migrate_vma_split_folio() - split a locked folio for migration +* @folio: the folio to split, locked and referenced by the caller +* @fault_page: fault page if any +* +* The fault folio is split at @fault_page, so the caller's lock and reference +* stay on the folio containing @fault_page. For any other folio our lock and +* reference are dropped, whether or not the split succeeds. +* +* Returns 0 on success. +*/ +static int __migrate_vma_split_folio (struct folio *folio, +struct page *fault_page) +{ +int ret; + +if (fault_page && folio ==page_folio (fault_page)) +return split_huge_page (fault_page); + +/* Someone else may have split it while we waited for the lock */ + ret =folio_test_large (folio) ?split_folio (folio) :0 ; +folio_unlock (folio); +folio_put (folio); +return ret; +} + +/** +* migrate_vma_split_folio() - drop the pte lock and split a THP folio * @folio: the folio to split * @fault_page: struct page associated with the fault if any * @hmm_vma_walk: walk in progress
@@ -511,9 +537,7 @@ static int migrate_vma_split_folio(struct folio *folio,struct hmm_vma_walk *hmm_vma_walk, pte_t *ptep) { - int ret; struct folio *fault_folio = fault_page ? page_folio(fault_page) : NULL; -struct folio *new_fault_folio =NULL ;/* * Take the reference while still holding the PTE lock, so the folio
@@ -530,44 +554,136 @@ static int migrate_vma_split_folio(struct folio *folio,if (folio != fault_folio)folio_lock (folio); - ret =split_folio (folio); -if (ret) { -if (folio != fault_folio) { +return __migrate_vma_split_folio (folio, fault_page); +} + +static int hmm_vma_handle_migrate_prepare_pmd (const struct mm_walk *walk, +pmd_t *pmdp, +unsigned long start, +unsigned long end, +unsigned long *hmm_pfn) +{ +struct hmm_vma_walk *hmm_vma_walk = walk->private; +struct hmm_range *range = hmm_vma_walk->range; +struct migrate_vma *migrate = range->migrate; +struct folio *fault_folio =NULL ; +enum migrate_vma_info minfo; +struct folio *folio; +unsigned long i; +int r =0 ; + +// Do we want to migrate at all? + minfo =hmm_select_migrate (range); +if (!minfo) +return r; + +WARN_ON_ONCE (!migrate); +HMM_ASSERT_PMD_LOCKED (hmm_vma_walk, true); + + fault_folio = migrate->fault_page ? +page_folio (migrate->fault_page) :NULL ; + +if (pmd_none (*pmdp)) +return hmm_pfns_fill (start, end, hmm_vma_walk,0 ); + +/* Like at the pte level, NUMA hinting (protnone) pmds are migrated */ +if (!(hmm_pfn[0 ] &HMM_PFN_VALID ) && + !(pmd_trans_huge (*pmdp) &&pmd_protnone (*pmdp))) + goto out; + +if (pmd_trans_huge (*pmdp)) { +if (!(minfo &MIGRATE_VMA_SELECT_SYSTEM )) + goto out; + + folio =pmd_folio (*pmdp); +if (is_huge_zero_folio (folio)) +return hmm_pfns_fill (start, end, hmm_vma_walk,0 ); + + }else if (!pmd_present (*pmdp)) { +const softleaf_t entry =softleaf_from_pmd (*pmdp); + +if (!softleaf_is_device_private (entry)) + goto out; + +if (!(minfo &MIGRATE_VMA_SELECT_DEVICE_PRIVATE )) + goto out; + + folio =softleaf_to_folio (entry); +if (folio->pgmap->owner != migrate->pgmap_owner) + goto out; + }else { + hmm_vma_walk->last = start; +return -EBUSY ; + } + +folio_get (folio); + +/* Can't lock it: not migrated, the valid pfns stay as reported */ +if (folio != fault_folio &&unlikely (!folio_trylock (folio))) { +folio_put (folio); +return 0 ; + } + +/* Swapcache folio still referenced elsewhere: see the pte level */ +if (folio_test_swapcache (folio) && !folio_free_swap (folio)) { +if (folio != fault_folio)folio_unlock (folio); -folio_put (folio); +folio_put (folio); +return 0 ; + } + +if (thp_migration_supported () && + (migrate->flags &MIGRATE_VMA_SELECT_COMPOUND ) && + (IS_ALIGNED (start,HPAGE_PMD_SIZE ) && +IS_ALIGNED (end,HPAGE_PMD_SIZE ))) { +struct page_vma_mapped_walk pvmw = { + .ptl = hmm_vma_walk->ptl, + .address = start, + .pmd = pmdp, + .vma = walk->vma, + }; + + hmm_pfn[0 ] |=HMM_PFN_MIGRATE |HMM_PFN_COMPOUND ; + + r =set_pmd_migration_entry (&pvmw,folio_page (folio,0 )); +if (r) { + hmm_pfn[0 ] &= ~(HMM_PFN_MIGRATE |HMM_PFN_COMPOUND ); + goto split;/* fall back to splitting the pmd */ } -return ret; +/* Collected; a protnone pmd was not reported valid before */ + hmm_pfn[0 ] |=HMM_PFN_VALID ; +for (i =1 , start +=PAGE_SIZE ; start < end; start +=PAGE_SIZE , i++) + hmm_pfn[i] &=HMM_PFN_INOUT_FLAGS ; + + }else { + goto split;/* fall back to splitting the pmd */ } - new_fault_folio = fault_page ?page_folio (fault_page) :NULL ; +out: +return r; + +split: +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false;/* -* Ensure the lock is held on the correct -* folio after the split +* folio_get() above took an extra reference. For the fault folio the +* caller still holds a reference and the lock, which is the +* precondition of __migrate_vma_split_folio(), so drop the extra one. */ -if (!new_fault_folio) { -folio_unlock (folio); +if (folio == fault_folio)folio_put (folio); - }else if (folio != new_fault_folio) { -if (new_fault_folio != fault_folio) { -folio_get (new_fault_folio); -folio_lock (new_fault_folio); - } -folio_unlock (folio); -folio_put (folio); - } -return 0 ; -} +/* Split failed: not migrated, the valid pfns stay as reported */ +if (__migrate_vma_split_folio (folio, migrate->fault_page)) +return 0 ; -static int hmm_vma_handle_migrate_prepare_pmd (const struct mm_walk *walk, -pmd_t *pmdp, -unsigned long start, -unsigned long end, -unsigned long *hmm_pfn) -{ -// TODO: implement migration entry insertion -return 0 ; +/* Re-walked as PTEs from start: drop the pmd-level output */ +for (i =0 ; i < (end - start) >>PAGE_SHIFT ; i++) + hmm_pfn[i] &=HMM_PFN_INOUT_FLAGS ; + + hmm_vma_walk->last = start; +return -EBUSY ; }/*
@@ -1016,6 +1132,11 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp, hmm_vma_walk->pmdlocked = false; } +/* +* hmm_vma_handle_migrate_prepare_pmd() splits the huge pmd in +* place when needed and returns -EBUSY to re-walk the range as +* PTEs. +*/ return r; }
Signature · 1 line
2.55.0
PATCH v17 3/12 mm/hmm: preparations for HMM to participate in migration
In reply to [email protected]From: Mika Penttilä <[email protected]>
For migration to happen after hmm_range_fault(), the vma has to be retrieved. Luckily, pagewalk already resolves that for us, so just have to save it for further use. For migration, mmap_lock has to be held for the whole operation, so vma stays stable. In case lock-drop behavior is requested, return an error while migrating. Also, rename some struct hmm_vma_walk fields to solve namespace collisions, and we are later introducing more xxlocked fields so be unambiguous.
Take care also of firing the mmu_notifier when migrating.
When migrating, requests come only from range->default_flags (pfn_flags_mask must be 0), so the input range->hmm_pfns carry nothing and are cleared at the start of hmm_range_fault(). Collected entries (HMM_PFN_VALID | HMM_PFN_MIGRATE) can then be told apart reliably during the walk and on rollback. This also means that HMM_PFN_INOUT_FLAGS such as HMM_PFN_DMA_MAPPED are not preserved across a migrating call, which is intended since the pages are being replaced.
Also, prepare for differences of how mm_struct * is retrieved in fault and migrate_vma paths.
--- include/linux/migrate.h | 50 ++++++++++++- lib/test_hmm.c | 2 +- mm/hmm.c | 157 ++++++++++++++++++++++++++++++++++------ 3 files changed, 186 insertions(+), 23 deletions(-)
include/linux/migrate.h +49 -1
@@ -5,6 +5,7 @@#include <linux/mm.h> #include <linux/hmm.h> #include <linux/mempolicy.h> +#include <linux/mmu_notifier.h> #include <linux/migrate_mode.h> #include <linux/hugetlb.h>
@@ -108,6 +109,29 @@ static inline void softleaf_entry_wait_on_locked(softleaf_t entry, spinlock_t *p spin_unlock(ptl); } +enum migrate_vma_info { +MIGRATE_VMA_SELECT_NONE =0 , +MIGRATE_VMA_SELECT_COMPOUND =MIGRATE_VMA_SELECT_NONE , +}; + +static inline enum migrate_vma_info hmm_select_migrate (struct hmm_range *range) +{ +return MIGRATE_VMA_SELECT_NONE ; +} + +static inline void hmm_fill_migrate_vma (struct hmm_range *range, +struct vm_area_struct *vma, +unsigned long start, +unsigned long end) +{ +} + +#ifdef CONFIG_MMU_NOTIFIER +static inline struct mm_struct *hmm_range_fault_mm (struct hmm_range *range) +{ +return range->notifier->mm; +} +#endif #endif /* CONFIG_MIGRATION */ #ifdef CONFIG_NUMA_BALANCING
@@ -151,7 +175,8 @@ static inline unsigned long migrate_pfn(unsigned long pfn)return (pfn <<MIGRATE_PFN_SHIFT ) |MIGRATE_PFN_VALID ; } -enum migrate_vma_direction { +enum migrate_vma_info { +MIGRATE_VMA_SELECT_NONE =0 ,MIGRATE_VMA_SELECT_SYSTEM =1 <<0 ,MIGRATE_VMA_SELECT_DEVICE_PRIVATE =1 <<1 ,MIGRATE_VMA_SELECT_DEVICE_COHERENT =1 <<2 ,
@@ -193,6 +218,29 @@ struct migrate_vma {struct page *fault_page; }; +// TODO: enable migration +static inline enum migrate_vma_info hmm_select_migrate (struct hmm_range *range) +{ +return 0 ; +} + +#ifdef CONFIG_MMU_NOTIFIER +static inline struct mm_struct *hmm_range_fault_mm (struct hmm_range *range) +{ +return range->notifier ? range->notifier->mm : range->migrate->vma->vm_mm; +} +#endif + +static inline void hmm_fill_migrate_vma (struct hmm_range *range, +struct vm_area_struct *vma, +unsigned long start, +unsigned long end) +{ + range->migrate->vma = vma; + range->migrate->start = start; + range->migrate->end = end; +} +int migrate_vma_setup (struct migrate_vma *args);void migrate_vma_pages (struct migrate_vma *migrate);void migrate_vma_finalize (struct migrate_vma *migrate);
lib/test_hmm.c +1 -1
@@ -145,7 +145,7 @@ static bool dmirror_is_private_zone(struct dmirror_device *mdevice) HMM_DMIRROR_MEMORY_DEVICE_PRIVATE); } -static enum migrate_vma_direction +static enum migrate_vma_info dmirror_select_device (struct dmirror *dmirror) { return (dmirror->mdevice->zone_device_type ==
mm/hmm.c +136 -21
248 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH v17 7/12 mm/hmm: add lazy MMU mode support for migration in HMM pagewalk
In reply to [email protected]From: Mika Penttilä <[email protected]>
Add calls to lazy_mmu_mode_enable() and lazy_mmu_mode_disable() while doing migration.
--- mm/hmm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
mm/hmm.c +8 -1
@@ -377,6 +377,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,/* Report error for everything else */ if (hmm_vma_walk->ptelocked) { +lazy_mmu_mode_disable ();pte_unmap_unlock (ptep, hmm_vma_walk->ptl); hmm_vma_walk->ptelocked = false; }else {
@@ -400,6 +401,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, !is_zero_pfn(pte_pfn(pte))) {if (hmm_pte_need_fault (hmm_vma_walk, pfn_req_flags,0 )) {if (hmm_vma_walk->ptelocked) { +lazy_mmu_mode_disable ();pte_unmap_unlock (ptep, hmm_vma_walk->ptl); hmm_vma_walk->ptelocked = false; }else {
@@ -419,6 +421,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, fault:if (hmm_vma_walk->ptelocked) { +lazy_mmu_mode_disable ();pte_unmap_unlock (ptep, hmm_vma_walk->ptl); hmm_vma_walk->ptelocked = false; }else {
@@ -548,6 +551,7 @@ static int migrate_vma_split_folio(struct folio *folio,if (folio != fault_folio)folio_get (folio); +lazy_mmu_mode_disable ();pte_unmap_unlock (ptep, hmm_vma_walk->ptl); hmm_vma_walk->ptelocked = false;
@@ -1159,8 +1163,10 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,if (minfo) { ptep =pte_offset_map_lock (mm, pmdp, addr, &hmm_vma_walk->ptl); -if (ptep) +if (ptep) { +lazy_mmu_mode_enable (); hmm_vma_walk->ptelocked = true; + } }else { ptep =pte_offset_map (pmdp, addr); }
@@ -1205,6 +1211,7 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,flush_tlb_range (walk->vma, start, addr);if (hmm_vma_walk->ptelocked) { +lazy_mmu_mode_disable ();pte_unmap_unlock (ptep -1 , hmm_vma_walk->ptl); hmm_vma_walk->ptelocked = false; }else {
Signature · 1 line
2.55.0
PATCH v17 8/12 mm/hmm: implement rollback for device page migration in HMM pagewalk
In reply to [email protected]From: Mika Penttilä <[email protected]>
During the migration pagewalk, the PTE table could be cleared and/or changed into PMD leaf or even another PTE table while dropped locks.
In these cases the possibly inserted migration ptes are gone. We have to however undo the collecting done so far, so unlock the folios and drop reference taken.
During the pagewalk we notice such scenarios if going to recollect a pfn but have already committed to migrate the entry with HMM_PFN_MIGRATE, in which case do rollback. Rollback clears (HMM_PFN_VALID | HMM_PFN_MIGRATE) which is safe, as migration is entirely driven by default_flags.
If we encounter migration ptes they are just skipped to allow for restart own walks.
--- include/linux/hmm.h | 22 ++++++++ mm/hmm.c | 127 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 148 insertions(+), 1 deletion(-)
include/linux/hmm.h +22 -0
@@ -111,6 +111,28 @@ static inline unsigned int hmm_pfn_to_map_order(unsigned long hmm_pfn)return (hmm_pfn >>HMM_PFN_ORDER_SHIFT ) &0x1F ; } +/* +* hmm_pfn_collected() - is this pfn entry prepared for migration ? +* If collected the folio's refcount is increased and the folio +* is locked. +*/ +static inline bool hmm_pfn_collected (unsigned long hmm_pfn) +{ +return (hmm_pfn & (HMM_PFN_VALID |HMM_PFN_MIGRATE )) == + (HMM_PFN_VALID |HMM_PFN_MIGRATE ); +} + +/* +* hmm_pfn_rollback_collected() - undoes the collection of hmm_pfn +* +* Note for total rollback the folio's refcount has to be put +* and folio has to be unlocked. +*/ +static inline unsigned long hmm_pfn_rollback_collected (unsigned long hmm_pfn) +{ +return hmm_pfn & ~(HMM_PFN_VALID |HMM_PFN_MIGRATE |HMM_PFN_COMPOUND ); +} +/* * struct hmm_range - track invalidation lock on virtual address range *
mm/hmm.c +126 -1
223 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH v17 9/12 mm: enable device page migration from HMM pagewalk
In reply to [email protected]From: Mika Penttilä <[email protected]>
HMM pagewalk has now the machinery to do the first phase of device page migration, collecting the pfns and installing migration ptes.
Enable migration in hmm_range_fault(), and change migrate_vma_setup() to use HMM pagewalk path. Two new flags, MIGRATE_VMA_FAULT and MIGRATE_VMA_WRITE are introduced for migrate_vma_setup(), to request for faulting missing pages, and requesting write access.
Also, the migrate_vma_collect*() based paths are now unused, so delete them.
--- include/linux/migrate.h | 10 +- mm/hmm.c | 33 ++- mm/migrate_device.c | 563 ++++------------------------------------ 3 files changed, 84 insertions(+), 522 deletions(-)
include/linux/migrate.h +8 -2
@@ -181,6 +181,8 @@ enum migrate_vma_info {MIGRATE_VMA_SELECT_DEVICE_PRIVATE =1 <<1 ,MIGRATE_VMA_SELECT_DEVICE_COHERENT =1 <<2 ,MIGRATE_VMA_SELECT_COMPOUND =1 <<3 , +MIGRATE_VMA_FAULT =1 <<4 , + MIGRATE_VMA_WRITE = 1 << 5, }; struct migrate_vma {
@@ -218,10 +220,14 @@ struct migrate_vma {struct page *fault_page; }; -// TODO: enable migration static inline enum migrate_vma_info hmm_select_migrate (struct hmm_range *range) { -return 0 ; +enum migrate_vma_info minfo; + + minfo = (range->default_flags &HMM_PFN_REQ_MIGRATE ) ? + range->migrate->flags :0 ; + +return minfo; }#ifdef CONFIG_MMU_NOTIFIER
mm/hmm.c +31 -2
@@ -1658,14 +1658,43 @@ static int hmm_range_fault_locked(struct hmm_range *range, bool *locked)* the invalidation to finish. * -EFAULT: A page was requested to be valid and could not be made valid * ie it has no backing VMA or it is illegal to access +* -ERANGE: The range crosses multiple VMAs, or space for hmm_pfns array +* is too low. * * This is similar to get_user_pages(), except that it can read the page tables * without mutating them (ie causing faults). * * The mmap lock must be held by the caller and will remain held on return. * New users should prefer hmm_range_fault_unlocked_timeout() unless they -* specifically need to keep the mmap lock held across the call. This helper -* cannot support VMAs whose fault handlers need to drop the mmap lock. +* specifically need to keep the mmap lock held across the call like while +* migrating. This helper cannot support VMAs whose fault handlers need to +* drop the mmap lock. +* +* If want to do migration after faulting, call hmm_range_fault() with +* range.default_flags of HMM_PFN_REQ_MIGRATE, and optionally +* HMM_PFN_REQ_FAULT|HMM_PFN_REQ_WRITE, and initialize range->migrate field. +* range->migrate->vma will be populated during the call, +* and must be stable across the whole migrate process, which is +* why mmap_lock must be held around this call. +* +* When HMM_PFN_REQ_MIGRATE is set, migration collection may be partial on +* return and the caller takes responsibility for completing or aborting it. +* +* On success, the caller must call migrate_hmm_range_setup() and may then +* proceed with the normal migrate_vma sequence: prepare destination pages, +* call migrate_vma_pages(), update device mappings as needed, and finally +* call migrate_vma_finalize(). +* +* On -EBUSY, the caller may retry hmm_range_fault() using the same range and +* PFN array without undoing entries collected by the previous attempt. If +* the caller stops retrying, it must abort the partial migration. +* +* On any other error, or when abandoning a retry, the caller must call +* migrate_hmm_range_setup(), migrate_vma_pages() with no valid destination +* entries, and migrate_vma_finalize() to abort the partial migration. +* +* The mmap read lock must remain held until the migration has either been +* completed or aborted. */ int hmm_range_fault (struct hmm_range *range) {
mm/migrate_device.c +45 -518
597 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH v17 10/12 lib/test_hmm: add a new testcase for the migrate on fault
In reply to [email protected]From: Mika Penttilä <[email protected]>
Enhance the hmm test driver (lib/test_hmm) with a migrate on fault
case: a single hmm_range_fault() walk with HMM_PFN_REQ_FAULT | HMM_PFN_REQ_MIGRATE faults in and collects the range, which is then migrated to device private memory and mapped into the dmirror page table. The selftest leaves the first two pages unwritten, so page 0 has to be faulted in and page 1 maps the zero page.
If mmu_interval_read_retry() trips after migrate_vma_pages(), the dmirror mapping is skipped and the -EBUSY retry re-walks. Normally the trip comes from an unmap or zap: the migration ptes are gone, migrate_vma_finalize() releases the destination pages and the retry migrates again. Pages committed to device memory without a dmirror mapping (e.g. after a huge zero pmd split in migrate_vma_insert_page()) are still consistent, since any invalidation also clears the dmirror page table, and a real device would map them on its next fault. The selftest doesn't hit that case: the unwritten pages share a pmd with written ones, so there is no huge zero pmd.
--- lib/test_hmm.c | 172 +++++++++++++++++++++++-- lib/test_hmm_uapi.h | 21 +-- tools/testing/selftests/mm/hmm-tests.c | 56 ++++++++ 3 files changed, 226 insertions(+), 23 deletions(-)
lib/test_hmm.c +159 -13
@@ -36,6 +36,7 @@#define DMIRROR_RANGE_FAULT_TIMEOUT 1000#define DEVMEM_CHUNK_SIZE (256 * 1024 * 1024U)#define DEVMEM_CHUNKS_RESERVE 16 +#define PFNS_ARRAY_SIZE 64/* * For device_private pages, dpage is just a dummy struct page
@@ -355,6 +356,7 @@ static int dmirror_range_fault(struct dmirror *dmirror,struct mm_struct *mm = dmirror->notifier.mm;unsigned long timeout = jiffies +msecs_to_jiffies (HMM_RANGE_DEFAULT_TIMEOUT ); +bool migrate = range->default_flags &HMM_PFN_REQ_MIGRATE ;int ret;while (true) {
@@ -364,9 +366,15 @@ static int dmirror_range_fault(struct dmirror *dmirror, } range->notifier_seq =mmu_interval_read_begin (range->notifier); -mmap_read_lock (mm); - ret =hmm_range_fault (range); -mmap_read_unlock (mm); + +/* mmap lock held for whole migrate on fault operation */ +if (!migrate) { +mmap_read_lock (mm); + ret =hmm_range_fault (range); +mmap_read_unlock (mm); + }else { + ret =hmm_range_fault (range); + }if (ret) {if (ret == -EBUSY )continue ;
@@ -382,7 +390,9 @@ static int dmirror_range_fault(struct dmirror *dmirror,break ; } - ret =dmirror_do_fault (dmirror, range); +/* update device page table after migration */ +if (!migrate) + ret =dmirror_do_fault (dmirror, range);mutex_unlock (&dmirror->mutex); out:
@@ -994,8 +1004,12 @@ static int dmirror_atomic_map(unsigned long addr, struct page *page,return 0 ; } -static int dmirror_migrate_finalize_and_map (struct migrate_vma *args, -struct dmirror *dmirror) +/* +* Map the migrated pages into the device's page table. Caller must hold +* dmirror->mutex. +*/ +static int __dmirror_migrate_map_locked (struct migrate_vma *args, +struct dmirror *dmirror) {unsigned long start = args->start;unsigned long end = args->end;
@@ -1005,9 +1019,6 @@ static int dmirror_migrate_finalize_and_map(struct migrate_vma *args,const unsigned long start_pfn = start >>PAGE_SHIFT ;const unsigned long end_pfn = end >>PAGE_SHIFT ; -/* Map the migrated pages into the device's page tables. */ -mutex_lock (&dmirror->mutex); -for (pfn = start_pfn; pfn < end_pfn; pfn++, src++, dst++) {struct page *dpage;void *entry;
@@ -1036,17 +1047,27 @@ static int dmirror_migrate_finalize_and_map(struct migrate_vma *args,if (*dst &MIGRATE_PFN_WRITE ) entry =xa_tag_pointer (entry,DPT_XA_TAG_WRITE ); entry =xa_store (&dmirror->pt, pfn + i, entry,GFP_ATOMIC ); -if (xa_is_err (entry)) { -mutex_unlock (&dmirror->mutex); +if (xa_is_err (entry))return xa_err (entry); - } } } -mutex_unlock (&dmirror->mutex);return 0 ; } +static int dmirror_migrate_finalize_and_map (struct migrate_vma *args, +struct dmirror *dmirror) +{ +int ret; + +/* Map the migrated pages into the device's page tables. */ +mutex_lock (&dmirror->mutex); + ret =__dmirror_migrate_map_locked (args, dmirror); +mutex_unlock (&dmirror->mutex); + +return ret; +} +static int dmirror_exclusive (struct dmirror *dmirror,struct hmm_dmirror_cmd *cmd) {
@@ -1377,6 +1398,127 @@ static int dmirror_migrate_to_device(struct dmirror *dmirror,return ret; } +static int do_fault_and_migrate (struct dmirror *dmirror,struct hmm_range *range) +{ +struct migrate_vma *migrate = range->migrate; +unsigned long timeout = + jiffies +msecs_to_jiffies (HMM_RANGE_DEFAULT_TIMEOUT ); +int ret; + +do { +mmap_read_lock (dmirror->notifier.mm); + +/* Fault-in pages for migration */ + ret =dmirror_range_fault (dmirror, range); +/* +* Set this up even on error: hmm_range_fault() may have collected +* part of the range before failing. +*/ +migrate_hmm_range_setup (range); +if (ret) { +/* +* dst[] entries are empty, so this marks every collected +* migration as failed. finalize then restores the source +* mappings and drops the associated locks/references. +*/ +migrate_vma_pages (migrate); +migrate_vma_finalize (migrate); + goto unlock; + } + +pr_debug ("Migrating from sys mem to device mem\n" ); + +dmirror_migrate_alloc_and_copy (migrate, dmirror); +migrate_vma_pages (migrate); + +mutex_lock (&dmirror->mutex); +if (mmu_interval_read_retry (&dmirror->notifier, + range->notifier_seq)) + ret = -EBUSY ; +else + ret =__dmirror_migrate_map_locked (migrate, dmirror); +mutex_unlock (&dmirror->mutex); + +migrate_vma_finalize (migrate); +unlock: +mmap_read_unlock (dmirror->notifier.mm); + }while (ret == -EBUSY && !time_after (jiffies, timeout)); + +return ret; +} + +static int dmirror_fault_and_migrate_to_device (struct dmirror *dmirror, +struct hmm_dmirror_cmd *cmd) +{ +unsigned long start, size, end, next; +unsigned long src_pfns[PFNS_ARRAY_SIZE ] = {0 }; +unsigned long dst_pfns[PFNS_ARRAY_SIZE ] = {0 }; +struct migrate_vma migrate = {0 }; +struct hmm_range range = {0 }; +struct dmirror_bounce bounce; +int ret =0 ; + +/* Whole range */ + start = cmd->addr; + size = cmd->npages <<PAGE_SHIFT ; + end = start + size; + +if (!mmget_not_zero (dmirror->notifier.mm)) { + ret = -EFAULT ; + goto out; + } + + migrate.pgmap_owner = dmirror->mdevice; + migrate.src = src_pfns; + migrate.dst = dst_pfns; + migrate.flags =MIGRATE_VMA_SELECT_SYSTEM ; + + range.migrate = &migrate; + range.hmm_pfns = src_pfns; + range.pfn_flags_mask =0 ; + range.default_flags =HMM_PFN_REQ_FAULT |HMM_PFN_REQ_MIGRATE ; + range.dev_private_owner = dmirror->mdevice; + range.notifier = &dmirror->notifier; + +for (next = start; next < end; next = range.end) { + range.start = next; + range.end =min (end, next + (PFNS_ARRAY_SIZE <<PAGE_SHIFT )); + +pr_debug ("Fault and migrate range start:%#lx end:%#lx\n" , + range.start, range.end); + + ret =do_fault_and_migrate (dmirror, &range); +if (ret) + goto out_mmput; + } + +/* +* Return the migrated data for verification. +* Only for pages in device zone +*/ + ret =dmirror_bounce_init (&bounce, start, size); +if (ret) + goto out_mmput; + +mutex_lock (&dmirror->mutex); + ret =dmirror_do_read (dmirror, start, end, &bounce); +mutex_unlock (&dmirror->mutex); +if (ret ==0 ) { + ret =copy_to_user (u64_to_user_ptr (cmd->ptr), bounce.ptr, bounce.size); +if (ret) + ret = -EFAULT ; + } + + cmd->cpages = bounce.cpages; +dmirror_bounce_fini (&bounce); + + +out_mmput: +mmput (dmirror->notifier.mm); +out: +return ret; +} +static void dmirror_mkentry (struct dmirror *dmirror,struct hmm_range *range,unsigned char *perm,unsigned long entry) {
@@ -1645,6 +1787,10 @@ static long dmirror_fops_unlocked_ioctl(struct file *filp, ret =dmirror_migrate_to_device (dmirror, &cmd);break ; +case HMM_DMIRROR_MIGRATE_ON_FAULT_TO_DEV : + ret =dmirror_fault_and_migrate_to_device (dmirror, &cmd); +break ; +case HMM_DMIRROR_MIGRATE_TO_SYS : ret =dmirror_migrate_to_system (dmirror, &cmd);break ;
lib/test_hmm_uapi.h +11 -10
@@ -29,16 +29,17 @@ struct hmm_dmirror_cmd { };/* Expose the address space of the calling process through hmm device file */ -#define HMM_DMIRROR_READ _IOWR('H', 0x00, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_WRITE _IOWR('H', 0x01, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_MIGRATE_TO_DEV _IOWR('H', 0x02, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_MIGRATE_TO_SYS _IOWR('H', 0x03, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_SNAPSHOT _IOWR('H', 0x04, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_EXCLUSIVE _IOWR('H', 0x05, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_CHECK_EXCLUSIVE _IOWR('H', 0x06, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_RELEASE _IOWR('H', 0x07, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_FLAGS _IOWR('H', 0x08, struct hmm_dmirror_cmd) -#define HMM_DMIRROR_READ_UNLOCKED _IOWR('H', 0x09, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_READ _IOWR('H', 0x00, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_WRITE _IOWR('H', 0x01, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_MIGRATE_TO_DEV _IOWR('H', 0x02, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_MIGRATE_TO_SYS _IOWR('H', 0x03, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_SNAPSHOT _IOWR('H', 0x04, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_EXCLUSIVE _IOWR('H', 0x05, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_CHECK_EXCLUSIVE _IOWR('H', 0x06, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_RELEASE _IOWR('H', 0x07, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_FLAGS _IOWR('H', 0x08, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_READ_UNLOCKED _IOWR('H', 0x09, struct hmm_dmirror_cmd) +#define HMM_DMIRROR_MIGRATE_ON_FAULT_TO_DEV _IOWR('H', 0x0a, struct hmm_dmirror_cmd)#define HMM_DMIRROR_FLAG_FAIL_ALLOC (1ULL << 0)
tools/testing/selftests/mm/hmm-tests.c +56 -0
68 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH v17 11/12 Documentation/mm/hmm: document migration through hmm_range_fault()
In reply to [email protected]From: Mika Penttilä <[email protected]>
Describe the two new MIGRATE_VMA_FAULT / MIGRATE_VMA_WRITE flags of migrate_vma_setup(), and add a section on driving the migration collection phase directly from hmm_range_fault() via HMM_PFN_REQ_MIGRATE and migrate_hmm_range_setup().
--- Documentation/mm/hmm.rst | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
Documentation/mm/hmm.rst +45 -0
@@ -348,6 +348,13 @@ between device driver specific code and shared common code: Currently only anonymous private VMA ranges can be migrated to or from system memory and device private memory. + By default only pages already present are collected. Two additional flags + ask migrate_vma_setup() to fault in missing pages first: + + * ``MIGRATE_VMA_FAULT`` faults in missing pages with read access. + * ``MIGRATE_VMA_WRITE`` faults in missing pages with write access + (implies faulting). + One of the first steps migrate_vma_setup() does is to invalidate other device's MMUs with the ``mmu_notifier_invalidate_range_start()`` and ``mmu_notifier_invalidate_range_end()`` calls around the page table
@@ -427,6 +434,44 @@ between device driver specific code and shared common code: The lock can now be released. +Migration collection through hmm_range_fault() +============================================== + +The collection phase of migration (steps 1 and 2 above) can also be driven by +hmm_range_fault() directly, sharing its page table walk. This lets a driver +fault in and collect a range for migration in one walk, which is useful for +migrate on fault. + +To do so, the driver sets ``HMM_PFN_REQ_MIGRATE`` in ``range->default_flags`` +and points ``range->migrate`` at a ``struct migrate_vma`` it has filled in +(``flags``, ``src``, ``dst``, ``pgmap_owner``). Usually ``HMM_PFN_REQ_FAULT`` +(and ``HMM_PFN_REQ_WRITE``) is set as well, so missing pages are faulted in +before being collected. The mmap_read_lock() has to be held for the whole +migration, since the vma must stay stable. + +Migration requests come only from ``range->default_flags``: +``range->pfn_flags_mask`` must be 0 and ``range->dev_private_owner`` must +equal ``migrate->pgmap_owner``. ``range->hmm_pfns`` is cleared at the start of +hmm_range_fault(), so per-pfn input, including ``HMM_PFN_INOUT_FLAGS`` such as +``HMM_PFN_DMA_MAPPED``, is not preserved across a migrating call. + +hmm_range_fault() collects the entries the same way migrate_vma_setup() does, +taking a folio reference, locking it and installing a migration PTE. Collected +entries are marked with ``HMM_PFN_VALID | HMM_PFN_MIGRATE`` in +``range->hmm_pfns``. If the page tables change while locks are dropped the +partially collected entries are rolled back automatically. + +After hmm_range_fault() returns, the driver calls:: + + void migrate_hmm_range_setup(struct hmm_range *range); + +to translate ``range->hmm_pfns`` into ``migrate->src[]`` (``migrate->dst[]`` is +zeroed) and initialize ``migrate->cpages`` and ``migrate->npages``. From here on +the ``range->migrate`` struct is ready for the rest of the flow (steps 3 +onwards), i.e. migrate_vma_pages() and migrate_vma_finalize(). This should be +called even on error, since hmm_range_fault() may have collected part of the +range before failing. + Exclusive access memory =======================
Signature · 1 line
2.55.0
PATCH v17 12/12 drm/nouveau/svm: add support for migrate on fault
In reply to [email protected]From: Mika Penttilä <[email protected]>
Add a direct user for the new HMM_PFN_REQ_MIGRATE flag and implement migrate on fault for nouveau driver. It is gated by the svm_migrate_on_fault module parameter, default off.
Added nouveau_dmem_migrate_fault() that faults a range in and does migrate collecting in a single hmm_range_fault() walk.
As an optimization, a migration policy - deciding which faulting ranges are worth migrating to VRAM and which are better left mirrored in system memory - would be useful. This patch establishes the migrate-on-fault mechanism as a basis for later refinement.
--- drivers/gpu/drm/nouveau/nouveau_dmem.c | 402 +++++++++++++++++++++++-- drivers/gpu/drm/nouveau/nouveau_dmem.h | 12 + drivers/gpu/drm/nouveau/nouveau_svm.c | 155 +++++++--- drivers/gpu/drm/nouveau/nouveau_svm.h | 5 + 4 files changed, 503 insertions(+), 71 deletions(-)
drivers/gpu/drm/nouveau/nouveau_dmem.c +379 -23
@@ -40,6 +40,9 @@#include <linux/hmm.h> #include <linux/memremap.h> #include <linux/migrate.h> +#include <linux/jiffies.h> +#include <linux/delay.h> +#include <linux/mmu_notifier.h> /* * FIXME: this is ugly right now we are using TTM to allocate vram and we pin
@@ -76,6 +79,14 @@ struct nouveau_dmem_migrate {nouveau_migrate_copy_t copy_func;nouveau_clear_page_t clear_func;struct nouveau_channel *chan; +/* +* Serializes the dmem users of chan (CPU faults in migrate_to_ram(), +* migrate on fault, bulk migration, eviction): the copy and clear +* commands they write to its push buffer and the fences they emit. +* Held only around those writes, never across page allocation. +* TTM serializes its own use of the channel with cli->mutex. +*/ +struct mutex lock; };struct nouveau_dmem {
@@ -93,6 +104,41 @@ struct nouveau_dmem_dma_info {size_t size; }; +static int nouveau_dmem_copy (struct nouveau_drm *drm,u64 npages, +enum nouveau_aper dst_aper,u64 dst_addr, +enum nouveau_aper src_aper,u64 src_addr) +{ +int ret; + +mutex_lock (&drm->dmem->migrate.lock); + ret = drm->dmem->migrate.copy_func (drm, npages, dst_aper, dst_addr, + src_aper, src_addr); +mutex_unlock (&drm->dmem->migrate.lock); +return ret; +} + +static int nouveau_dmem_clear (struct nouveau_drm *drm,u32 length, +enum nouveau_aper dst_aper,u64 dst_addr) +{ +int ret; + +mutex_lock (&drm->dmem->migrate.lock); + ret = drm->dmem->migrate.clear_func (drm, length, dst_aper, dst_addr); +mutex_unlock (&drm->dmem->migrate.lock); +return ret; +} + +static int nouveau_dmem_fence_new (struct nouveau_drm *drm, +struct nouveau_fence **fence) +{ +int ret; + +mutex_lock (&drm->dmem->migrate.lock); + ret =nouveau_fence_new (fence, drm->dmem->migrate.chan); +mutex_unlock (&drm->dmem->migrate.lock); +return ret; +} +static struct nouveau_dmem_chunk *nouveau_page_to_chunk (struct page *page) { return container_of(page_pgmap(page), struct nouveau_dmem_chunk,
@@ -139,10 +185,12 @@ static void nouveau_dmem_folio_free(struct folio *folio)spin_unlock (&dmem->lock); } -static void nouveau_dmem_fence_done (struct nouveau_fence **fence) +static int nouveau_dmem_fence_done (struct nouveau_fence **fence) { +int ret =0 ; +if (fence) { -nouveau_fence_wait (*fence, true, false); + ret =nouveau_fence_wait (*fence, true, false);nouveau_fence_unref (fence); }else {/*
@@ -150,6 +198,54 @@ static void nouveau_dmem_fence_done(struct nouveau_fence **fence)* the hmem object. */ } + +/* 0 on completion, -EBUSY on timeout, or other errno; propagated. */ +return ret; +} + +/* +* Poll the copy fence instead of the lazy (interrupt-driven) wait since +* completion IRQ is randomly missed, hitting the timeout. +* +* Returns 0 on completion, -EBUSY on timeout. Consumes the fence reference. +*/ +static int nouveau_dmem_fence_poll (struct nouveau_fence **fence) +{ +unsigned long deadline = jiffies +30 *HZ ; +int ret =0 ; + +while (!nouveau_fence_done (*fence)) { +if (time_after (jiffies, deadline)) { + ret = -EBUSY ; +break ; + } +schedule_timeout_uninterruptible (msecs_to_jiffies (1 )); + } +nouveau_fence_unref (fence); + +return ret; +} + +/* +* The copy could not be confirmed (fence timeout or no fence): don't migrate, +* so finalize restores the original ptes and the source stays valid. The copy +* engine may still be using the pages, so keep the destination folios (an +* extra reference that finalize won't drop) and let the caller skip the DMA +* unmap: leaking is safer than freeing memory a wedged engine might write. +*/ +static void nouveau_dmem_migrate_abort (struct nouveau_drm *drm, +struct migrate_vma *args) +{ +unsigned long i; + +for (i =0 ; i < args->npages; i++) { +struct page *dpage =migrate_pfn_to_page (args->dst[i]); + + args->src[i] &= ~MIGRATE_PFN_MIGRATE ; +if (dpage) +folio_get (page_folio (dpage)); + } +NV_ERROR (drm,"svm: copy not confirmed, migration aborted, pages leaked\n" ); } static int nouveau_dmem_copy_folio(struct nouveau_drm *drm,
@@ -168,10 +264,10 @@ static int nouveau_dmem_copy_folio(struct nouveau_drm *drm,if (dma_mapping_error (dev, dma_info->dma_addr))return -EIO ; -if (drm->dmem->migrate.copy_func (drm,folio_nr_pages (sfolio), -NOUVEAU_APER_HOST , dma_info->dma_addr, -NOUVEAU_APER_VRAM , -nouveau_dmem_page_addr (spage))) { +if (nouveau_dmem_copy (drm,folio_nr_pages (sfolio), +NOUVEAU_APER_HOST , dma_info->dma_addr, +NOUVEAU_APER_VRAM , +nouveau_dmem_page_addr (spage))) {dma_unmap_page (dev, dma_info->dma_addr,page_size (dpage),DMA_BIDIRECTIONAL );return -EIO ;
@@ -183,12 +279,11 @@ static int nouveau_dmem_copy_folio(struct nouveau_drm *drm,static vm_fault_t nouveau_dmem_migrate_to_ram (struct vm_fault *vmf) {struct nouveau_drm *drm =page_to_drm (vmf->page); -struct nouveau_dmem *dmem = drm->dmem; -struct nouveau_fence *fence; +struct nouveau_fence *fence =NULL ;struct nouveau_svmm *svmm;struct page *dpage;vm_fault_t ret =0 ; -int err; +int err, fret =0 ;struct migrate_vma args = { .vma = vmf->vma, .pgmap_owner = drm->dev,
@@ -233,10 +328,12 @@ static vm_fault_t nouveau_dmem_migrate_to_ram(struct vm_fault *vmf)* than just one page on CPU fault. When such fault happens it is very * likely that more surrounding page will CPU fault too. */ -if (migrate_vma_setup (&args) <0 ) -return VM_FAULT_SIGBUS ; +if (migrate_vma_setup (&args) <0 ) { + ret =VM_FAULT_SIGBUS ; + goto err; + }if (!args.cpages) -return 0 ; + goto done;if (order) dpage = folio_page(vma_alloc_folio(GFP_HIGHUSER | __GFP_ZERO,
@@ -264,11 +361,21 @@ static vm_fault_t nouveau_dmem_migrate_to_ram(struct vm_fault *vmf) goto done; } -nouveau_fence_new (&fence, dmem->migrate.chan); +/* +* Commit the migration only once the copy is confirmed. Without a +* fence the copy can't be confirmed: treat it as failed. +*/ + fret =nouveau_dmem_fence_new (drm, &fence); +if (!fret) + fret =nouveau_dmem_fence_poll (&fence); +if (fret) { +nouveau_dmem_migrate_abort (drm, &args); + ret =VM_FAULT_SIGBUS ; + }else { +dma_unmap_page (drm->dev->dev, dma_info.dma_addr, dma_info.size, +DMA_BIDIRECTIONAL ); + }migrate_vma_pages (&args); -nouveau_dmem_fence_done (&fence); -dma_unmap_page (drm->dev->dev, dma_info.dma_addr, dma_info.size, -DMA_BIDIRECTIONAL ); done:migrate_vma_finalize (&args); err:
@@ -528,7 +635,7 @@ nouveau_dmem_evict_chunk(struct nouveau_dmem_chunk *chunk) } } -nouveau_fence_new (&fence, chunk->drm->dmem->migrate.chan); +nouveau_dmem_fence_new (chunk->drm, &fence);migrate_device_pages (src_pfns, dst_pfns, npages);nouveau_dmem_fence_done (&fence);migrate_device_finalize (src_pfns, dst_pfns, npages);
@@ -729,6 +836,7 @@ nouveau_dmem_init(struct nouveau_drm *drm)INIT_LIST_HEAD (&drm->dmem->chunks);mutex_init (&drm->dmem->mutex);spin_lock_init (&drm->dmem->lock); +mutex_init (&drm->dmem->migrate.lock);/* Initialize migration dma helpers before registering memory */ ret =nouveau_dmem_migrate_init (drm);
@@ -764,13 +872,13 @@ static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, dma_info->size =page_size (spage);if (dma_mapping_error (dev, dma_info->dma_addr)) goto out_free_page; -if (drm->dmem->migrate.copy_func (drm,folio_nr_pages (page_folio (spage)), +if (nouveau_dmem_copy (drm,folio_nr_pages (page_folio (spage)),NOUVEAU_APER_VRAM , paddr,NOUVEAU_APER_HOST , dma_info->dma_addr)) goto out_dma_unmap; }else { dma_info->dma_addr =DMA_MAPPING_ERROR ; -if (drm->dmem->migrate.clear_func (drm,page_size (dpage), +if (nouveau_dmem_clear (drm,page_size (dpage),NOUVEAU_APER_VRAM , paddr)) goto out_free_page; }
@@ -794,11 +902,12 @@ static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm,return 0 ; } -static void nouveau_dmem_migrate_chunk (struct nouveau_drm *drm, +static unsigned long +nouveau_dmem_migrate_alloc_and_copy (struct nouveau_drm *drm,struct nouveau_svmm *svmm,struct migrate_vma *args, -struct nouveau_dmem_dma_info *dma_info,u64 *pfns) +struct nouveau_dmem_dma_info *dma_info,u64 *pfns, +unsigned long *nr_dma_out,unsigned long *order_out) { -struct nouveau_fence *fence;unsigned long addr = args->start, nr_dma =0 , i;unsigned long order =0 ;
@@ -820,7 +929,22 @@ static void nouveau_dmem_migrate_chunk(struct nouveau_drm *drm, addr += (1 << order) *PAGE_SIZE ; } -nouveau_fence_new (&fence, drm->dmem->migrate.chan); + *nr_dma_out = nr_dma; + *order_out = order; +return i; +} + +static void nouveau_dmem_migrate_chunk (struct nouveau_drm *drm, +struct nouveau_svmm *svmm,struct migrate_vma *args, +struct nouveau_dmem_dma_info *dma_info,u64 *pfns) +{ +struct nouveau_fence *fence; +unsigned long nr_dma, order, i; + + i =nouveau_dmem_migrate_alloc_and_copy (drm, svmm, args, dma_info, pfns, + &nr_dma, &order); + +nouveau_dmem_fence_new (drm, &fence);migrate_vma_pages (args);nouveau_dmem_fence_done (&fence);nouveau_pfns_map (svmm, args->vma->vm_mm, args->start, pfns, i, order);
@@ -832,6 +956,238 @@ static void nouveau_dmem_migrate_chunk(struct nouveau_drm *drm,migrate_vma_finalize (args); } +/* +* Encode an hmm_range_fault() pfn for @start into the nouveau PFNMAP format, +* shared by nouveau_hmm_convert_pfn() and the in-place map in +* nouveau_dmem_migrate_fault(). +*/ +u64 nouveau_dmem_hmm_pfn_to_map (unsigned long hmm_pfn,unsigned long start, +unsigned long *map_addr,unsigned int *page_shift) +{ +unsigned long order; +struct page *page; +u64 pfn; + + *map_addr = start; + *page_shift =PAGE_SHIFT ; + +if (!(hmm_pfn &HMM_PFN_VALID )) +return NVIF_VMM_PFNMAP_V0_NONE ; + + page =hmm_pfn_to_page (hmm_pfn); + + order =hmm_pfn_to_map_order (hmm_pfn); +if (order) { + *page_shift = order +PAGE_SHIFT ; + *map_addr = start & ~((1UL << *page_shift) -1 ); + page -= (start - *map_addr) >>PAGE_SHIFT ; + } + +if (is_device_private_page (page)) + pfn =nouveau_dmem_page_addr (page) | +NVIF_VMM_PFNMAP_V0_V |NVIF_VMM_PFNMAP_V0_VRAM ; +else + pfn =page_to_phys (page) | +NVIF_VMM_PFNMAP_V0_V |NVIF_VMM_PFNMAP_V0_HOST ; +if (hmm_pfn &HMM_PFN_WRITE ) + pfn |=NVIF_VMM_PFNMAP_V0_W ; + +return pfn; +} + +/* +* Fault a range in and migrate it to VRAM. +* Returns 0 on success, or an error (so the caller +* falls back to nouveau_range_fault()) if nothing could be mapped. +*/ +int +nouveau_dmem_migrate_fault (struct nouveau_drm *drm,struct nouveau_svmm *svmm, +struct mmu_interval_notifier *notifier, +unsigned long start,unsigned long end, +unsigned long hmm_flags, +u64 *out_pfn0,unsigned long *out_addr, +unsigned int *out_shift) +{ +unsigned long timeout = + jiffies +msecs_to_jiffies (HMM_RANGE_DEFAULT_TIMEOUT ); +unsigned long npages = (end - start) >>PAGE_SHIFT ; +struct mm_struct *mm = notifier->mm; +struct nouveau_dmem_dma_info *dma_info; +struct nouveau_fence *fence =NULL ; +struct migrate_vma migrate = { + .start = start, + .end = end, + .pgmap_owner = drm->dev, + .flags =MIGRATE_VMA_SELECT_SYSTEM , + }; +struct hmm_range range = { + .notifier = notifier, + .start = start, + .end = end, + .dev_private_owner = drm->dev, + .migrate = &migrate, + .default_flags = hmm_flags |HMM_PFN_REQ_MIGRATE , + }; +unsigned long nr_dma, order, n, i; +unsigned long hmm_pfn0 =0 ; +bool migrated; +u64 *pfns; +int ret, fret =0 ; + +if (!drm->dmem) +return -ENODEV ; + + migrate.src =kcalloc (npages,sizeof (*migrate.src),GFP_KERNEL ); +if (!migrate.src) +return -ENOMEM ; + migrate.dst =kcalloc (npages,sizeof (*migrate.dst),GFP_KERNEL ); +if (!migrate.dst) { + ret = -ENOMEM ; + goto out_free_src; + } + dma_info =kmalloc_objs (*dma_info, npages); +if (!dma_info) { + ret = -ENOMEM ; + goto out_free_dst; + } + pfns =nouveau_pfns_alloc (npages); +if (!pfns) { + ret = -ENOMEM ; + goto out_free_dma; + } + +/* hmm_range_fault() shares the source pfn array with migrate_vma. */ + range.hmm_pfns = migrate.src; + +do { +mmap_read_lock (mm); + range.notifier_seq =mmu_interval_read_begin (notifier); + + ret =hmm_range_fault (&range); +/* +* Snapshot the pfn before migrate_hmm_range_setup() overwrites the +* shared array; used to map in place if nothing migrates. +*/ +if (!ret) + hmm_pfn0 = range.hmm_pfns[0 ]; +migrate_hmm_range_setup (&range); +if (ret) { +migrate_vma_pages (&migrate); +migrate_vma_finalize (&migrate); + goto unlock; + } + + n =nouveau_dmem_migrate_alloc_and_copy (drm, svmm, &migrate, + dma_info, pfns, + &nr_dma, &order); + +/* Only a migrated page has an in-flight CE copy to unblock below. */ +for (i =0 , migrated = false; i < npages; i++) { +if (migrate.dst[i]) { + migrated = true; +break ; + } + } + +/* +* Track a copy fence only when a copy was enqueued; waiting on an +* empty fence would block until the fault's CTXSW_TIMEOUT. +*/ +if (migrated) + fret =nouveau_dmem_fence_new (drm, &fence); + +/* +* The fault-in path must replay the faulting channel before waiting on +* the copy fence: with the fault still unreplayed the copy does not +* make progress. GPU has no mapping so it might refault, until it +* gets the migrated or mirrored mapping. +*/ +if (drm->svm && migrated) +nouveau_svm_fault_replay (drm->svm); + +/* Without a fence (fret set) the copy can't be confirmed. */ +if (migrated && !fret) + fret =nouveau_dmem_fence_poll (&fence); + +/* Commit the migration only once the copy is confirmed. */ +if (fret) +nouveau_dmem_migrate_abort (drm, &migrate); +migrate_vma_pages (&migrate); + +/* +* Don't map destination pages that migrate_vma_pages() didn't +* migrate: finalize frees them and restores the source. +*/ +for (i =0 ; i < npages; i++) +if (!(migrate.src[i] &MIGRATE_PFN_MIGRATE )) + pfns[i] =NVIF_VMM_PFNMAP_V0_NONE ; + +mutex_lock (&svmm->mutex); +if (fret) { +/* Copy did not complete; don't map a half-copied page. */ + ret = -EIO ; + }else if (mmu_interval_read_retry (notifier, range.notifier_seq)) { + ret = -EBUSY ; + }else { +unsigned long map_addr = migrate.start; +unsigned int page_shift =PAGE_SHIFT + order; + +/* +* If nothing migrated might still be able to mirror. +* In that case use the snapshot hmm_pfn. +* npages == 1 always today. +*/ +if (npages ==1 && !(pfns[0 ] &NVIF_VMM_PFNMAP_V0_V )) + pfns[0 ] =nouveau_dmem_hmm_pfn_to_map (hmm_pfn0, + start, &map_addr, &page_shift); + +/* +* Nothing to map: leave the GPU mapping alone, the +* caller falls back to nouveau_range_fault(). +*/ +if (pfns[0 ] &NVIF_VMM_PFNMAP_V0_V ) { +/* On failure the caller falls back, then cancels */ + ret =__nouveau_pfns_map_locked (svmm, map_addr, + pfns, n, + page_shift); +if (!ret) { + *out_pfn0 = pfns[0 ]; + *out_addr = map_addr; + *out_shift = page_shift; + } + } + } +mutex_unlock (&svmm->mutex); + +if (fret) +NV_ERROR (drm, +"svm: migrate copy did not complete (%d) for %lx-%lx\n" , + fret, start, end); + +/* After an aborted copy the engine may still use the mappings */ +while (!fret && nr_dma--) { +dma_unmap_page (drm->dev->dev, dma_info[nr_dma].dma_addr, + dma_info[nr_dma].size,DMA_BIDIRECTIONAL ); + } +migrate_vma_finalize (&migrate); +unlock: +mmap_read_unlock (mm); + }while (ret == -EBUSY && !time_after (jiffies, timeout)); + +/* Nothing migrated or mappable in place, fallback to nouveau_range_fault(). */ +if (!ret && !(pfns[0 ] &NVIF_VMM_PFNMAP_V0_V )) + ret = -ENOENT ; + +nouveau_pfns_free (pfns); +out_free_dma: +kfree (dma_info); +out_free_dst: +kfree (migrate.dst); +out_free_src: +kfree (migrate.src); +return ret; +} + int nouveau_dmem_migrate_vma(struct nouveau_drm *drm, struct nouveau_svmm *svmm,
drivers/gpu/drm/nouveau/nouveau_dmem.h +12 -0
@@ -27,6 +27,7 @@ struct drm_file;struct nouveau_drm ;struct nouveau_svmm ;struct hmm_range ; +struct mmu_interval_notifier ;#if IS_ENABLED (CONFIG_DRM_NOUVEAU_SVM )void nouveau_dmem_init (struct nouveau_drm *);
@@ -39,7 +40,18 @@ int nouveau_dmem_migrate_vma(struct nouveau_drm *drm,struct vm_area_struct *vma, unsigned long start, unsigned long end); +int nouveau_dmem_migrate_fault (struct nouveau_drm *drm, +struct nouveau_svmm *svmm, +struct mmu_interval_notifier *notifier, +unsigned long start, +unsigned long end, +unsigned long hmm_flags, +u64 *out_pfn0, +unsigned long *out_addr, +unsigned int *out_shift);unsigned long nouveau_dmem_page_addr (struct page *page); +u64 nouveau_dmem_hmm_pfn_to_map (unsigned long hmm_pfn,unsigned long start, +unsigned long *map_addr,unsigned int *page_shift);#else /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */ static inline void nouveau_dmem_init (struct nouveau_drm *drm) {}
drivers/gpu/drm/nouveau/nouveau_svm.c +107 -48
237 lines not on this page · raw message
drivers/gpu/drm/nouveau/nouveau_svm.h +5 -0
@@ -5,6 +5,7 @@struct drm_device ;struct drm_file ;struct nouveau_drm ; +struct nouveau_svm ;struct nouveau_svmm {struct mmu_notifier notifier;
@@ -35,6 +36,10 @@ void nouveau_pfns_free(u64 *pfns);void nouveau_pfns_map (struct nouveau_svmm *svmm,struct mm_struct *mm,unsigned long addr,u64 *pfns,unsigned long npages,unsigned int page_shift); +int __nouveau_pfns_map_locked (struct nouveau_svmm *svmm,unsigned long addr, +u64 *pfns,unsigned long npages, +unsigned int page_shift); +void nouveau_svm_fault_replay (struct nouveau_svm *svm);#else /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */ static inline void nouveau_svm_init (struct nouveau_drm *drm) {}static inline void nouveau_svm_fini (struct nouveau_drm *drm) {}
Signature · 1 line
2.55.0
Patchwork
CI✗ CI.checkpatch: warning for Migrate on fault for device pages (rev9)
In reply to [email protected]== Series Details ==
== Series Details ==
Series: Migrate on fault for device pages (rev9)
URL : https://patchwork.freedesktop.org/series/165953/
State : warning
== Summary ==
+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master 3009867cd31863246e4afc138520a7a8bd37bb11
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 22b3495b79362c0ba98c229494362b3020126424
Author: Mika Penttilä <[email protected]> Date: Tue Nov 3 08:16:29 2026 +0200
drm/nouveau/svm: add support for migrate on fault
Add a direct user for the new HMM_PFN_REQ_MIGRATE flag and implement migrate on fault for nouveau driver. It is gated by the svm_migrate_on_fault module parameter, default off.
Added nouveau_dmem_migrate_fault() that faults a range in and does migrate collecting in a single hmm_range_fault() walk.
As an optimization, a migration policy - deciding which faulting ranges are worth migrating to VRAM and which are better left mirrored in system memory - would be useful. This patch establishes the migrate-on-fault mechanism as a basis for later refinement.
+ /mt/dim checkpatch dabb4c72ce501c30b3e57854bb05415bfe9047f4 drm-intel ee8cac66c94b mm/Kconfig: changes for migrate on fault for device pages d3612d604e07 mm: add helper to convert HMM pfn to migrate pfn -:179: CHECK:BRACES: Blank lines aren't necessary before a close brace '}' #179: FILE: mm/migrate_device.c:1586:
+
+}
total: 0 errors, 0 warnings, 1 checks, 138 lines checked 657d1ac73063 mm/hmm: preparations for HMM to participate in migration 9f6df6f8f2c2 mm/hmm: do the plumbing for HMM to participate in migration -:47: CHECK:UNCOMMENTED_DEFINITION: spinlock_t definition without comment #47: FILE: mm/hmm.c:54:
+ spinlock_t *ptl;
-:55: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'locked' may be better as '(locked)' to avoid precedence issues #55: FILE: mm/hmm.c:76:
+#define HMM_ASSERT_PTE_LOCKED(hmm_vma_walk, locked) \
+ WARN_ON_ONCE((hmm_vma_walk)->ptelocked != locked)
-:58: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'locked' may be better as '(locked)' to avoid precedence issues #58: FILE: mm/hmm.c:79:
+#define HMM_ASSERT_PMD_LOCKED(hmm_vma_walk, locked) \
+ WARN_ON_ONCE((hmm_vma_walk)->pmdlocked != locked)
-:61: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'hmm_vma_walk' - possible side-effects? #61: FILE: mm/hmm.c:82:
+#define HMM_ASSERT_UNLOCKED(hmm_vma_walk) \
+ WARN_ON_ONCE((hmm_vma_walk)->ptelocked || \
+ (hmm_vma_walk)->pmdlocked)
-:92: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV) #92: FILE: mm/hmm.c:118:
+ end-addr == HPAGE_PMD_SIZE) {
^
-:216: CHECK:BRACES: braces {} should be used on all arms of this statement #216: FILE: mm/hmm.c:470:
+ if (softleaf_is_device_private(entry)) {
[...]
else
[...]
-:320: CHECK:BRACES: braces {} should be used on all arms of this statement #320: FILE: mm/hmm.c:633:
+ if (minfo) {
[...]
+ } else
[...]
-:324: CHECK:BRACES: Unbalanced braces around else statement #324: FILE: mm/hmm.c:637:
+ } else
total: 0 errors, 0 warnings, 8 checks, 487 lines checked 087405190f21 mm/hmm: migrate collection in HMM pagewalk - pte level c1cd2eff4210 mm/hmm: migrate collection in HMM pagewalk - pmd level fd91556e4ecf mm/hmm: add lazy MMU mode support for migration in HMM pagewalk 3e2b94590cf5 mm/hmm: implement rollback for device page migration in HMM pagewalk -:226: CHECK:BRACES: Blank lines aren't necessary before a close brace '}' #226: FILE: mm/hmm.c:649:
+
+ }
total: 0 errors, 0 warnings, 1 checks, 251 lines checked 3a7ad58164e2 mm: enable device page migration from HMM pagewalk 278ee42916a1 lib/test_hmm: add a new testcase for the migrate on fault -:262: CHECK:LINE_SPACING: Please don't use multiple blank lines #262: FILE: lib/test_hmm.c:1515:
+
+
-:337: CHECK:LINE_SPACING: Please don't use multiple blank lines #337: FILE: tools/testing/selftests/mm/hmm-tests.c:947:
+
total: 0 errors, 0 warnings, 2 checks, 328 lines checked 9103195d05d6 Documentation/mm/hmm: document migration through hmm_range_fault() 22b3495b7936 drm/nouveau/svm: add support for migrate on fault -:260: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #260: FILE: drivers/gpu/drm/nouveau/nouveau_dmem.c:876:
+ if (nouveau_dmem_copy(drm, folio_nr_pages(page_folio(spage)),
NOUVEAU_APER_VRAM, paddr, NOUVEAU_APER_HOST,
-:267: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #267: FILE: drivers/gpu/drm/nouveau/nouveau_dmem.c:882:
+ if (nouveau_dmem_clear(drm, page_size(dpage),
NOUVEAU_APER_VRAM, paddr))
-:277: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #277: FILE: drivers/gpu/drm/nouveau/nouveau_dmem.c:907:
+nouveau_dmem_migrate_alloc_and_copy(struct nouveau_drm *drm,
struct nouveau_svmm *svmm, struct migrate_vma *args,
-:297: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #297: FILE: drivers/gpu/drm/nouveau/nouveau_dmem.c:938:
+static void nouveau_dmem_migrate_chunk(struct nouveau_drm *drm,
+ struct nouveau_svmm *svmm, struct migrate_vma *args,
-:497: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #497: FILE: drivers/gpu/drm/nouveau/nouveau_dmem.c:1142:
+ pfns[0] = nouveau_dmem_hmm_pfn_to_map(hmm_pfn0,
+ start, &map_addr, &page_shift);
total: 0 errors, 0 warnings, 5 checks, 785 lines checked
Patchwork
CI✓ CI.KUnit: success for Migrate on fault for device pages (rev9)
In reply to [email protected]== Series Details ==
== Series Details ==
Series: Migrate on fault for device pages (rev9)
URL : https://patchwork.freedesktop.org/series/165953/
State : success
== Summary ==
+ trap cleanup EXIT
+ kunitconfigs=('/kernel/drivers/gpu/tests/.kunitconfig' '/kernel/drivers/gpu/drm/xe/.kunitconfig' '/kernel/drivers/gpu/drm/tests/.kunitconfig' '/kernel/drivers/gpu/drm/ttm/tests/.kunitconfig' '/kernel/drivers/dma-buf/.kunitconfig')
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/tests/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/tests/.kunitconfig
[08:46:30] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [08:46:35] 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 [08:46:56] Starting KUnit Kernel (1/1)... [08:46:56] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [08:46:56] ================= gpu_buddy (14 subtests) ================== [08:46:56] [PASSED] gpu_test_buddy_alloc_limit [08:46:56] [PASSED] gpu_test_buddy_alloc_optimistic [08:46:56] [PASSED] gpu_test_buddy_alloc_pessimistic [08:46:56] [PASSED] gpu_test_buddy_alloc_pathological [08:46:56] [PASSED] gpu_test_buddy_alloc_contiguous [08:46:56] [PASSED] gpu_test_buddy_alloc_clear [08:46:56] [PASSED] gpu_test_buddy_alloc_range [08:46:56] [PASSED] gpu_test_buddy_alloc_range_bias [08:46:57] [PASSED] gpu_test_buddy_fragmentation_performance [08:46:58] [PASSED] gpu_test_buddy_dirty_tracker_performance [08:46:58] [PASSED] gpu_test_buddy_alloc_exceeds_max_order [08:46:58] [PASSED] gpu_test_buddy_offset_aligned_allocation [08:46:58] [PASSED] gpu_test_buddy_subtree_offset_alignment_stress [08:46:58] [PASSED] gpu_test_buddy_addr_to_block [08:46:58] ==================== [PASSED] gpu_buddy ==================== [08:46:58] ============================================================ [08:46:58] Testing complete. Ran 14 tests: passed: 14 [08:46:58] Elapsed time: 27.452s total, 4.974s configuring, 20.610s building, 1.823s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/drm/xe/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig [08:46:58] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [08:47:00] 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 [08:47:38] Starting KUnit Kernel (1/1)... [08:47:38] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [08:47:39] ================== guc_buf (11 subtests) =================== [08:47:39] [PASSED] test_smallest [08:47:39] [PASSED] test_largest [08:47:39] [PASSED] test_granular [08:47:39] [PASSED] test_unique [08:47:39] [PASSED] test_overlap [08:47:39] [PASSED] test_reusable [08:47:39] [PASSED] test_too_big [08:47:39] [PASSED] test_flush [08:47:39] [PASSED] test_lookup [08:47:39] [PASSED] test_data [08:47:39] [PASSED] test_class [08:47:39] ===================== [PASSED] guc_buf ===================== [08:47:39] =================== guc_dbm (7 subtests) =================== [08:47:39] [PASSED] test_empty [08:47:39] [PASSED] test_default [08:47:39] ======================== test_size ======================== [08:47:39] [PASSED] 4 [08:47:39] [PASSED] 8 [08:47:39] [PASSED] 32 [08:47:39] [PASSED] 256 [08:47:39] ==================== [PASSED] test_size ==================== [08:47:39] ======================= test_reuse ======================== [08:47:39] [PASSED] 4 [08:47:39] [PASSED] 8 [08:47:39] [PASSED] 32 [08:47:39] [PASSED] 256 [08:47:39] =================== [PASSED] test_reuse ==================== [08:47:39] =================== test_range_overlap ==================== [08:47:39] [PASSED] 4 [08:47:39] [PASSED] 8 [08:47:39] [PASSED] 32 [08:47:39] [PASSED] 256 [08:47:39] =============== [PASSED] test_range_overlap ================ [08:47:39] =================== test_range_compact ==================== [08:47:39] [PASSED] 4 [08:47:39] [PASSED] 8 [08:47:39] [PASSED] 32 [08:47:39] [PASSED] 256 [08:47:39] =============== [PASSED] test_range_compact ================ [08:47:39] ==================== test_range_spare ===================== [08:47:39] [PASSED] 4 [08:47:39] [PASSED] 8 [08:47:39] [PASSED] 32 [08:47:39] [PASSED] 256 [08:47:39] ================ [PASSED] test_range_spare ================= [08:47:39] ===================== [PASSED] guc_dbm ===================== [08:47:39] ================== guc_idm (22 subtests) =================== [08:47:39] [PASSED] bad_init [08:47:39] [PASSED] no_init [08:47:39] [PASSED] init_fini [08:47:39] [PASSED] check_init_small [08:47:39] [PASSED] check_init_shared [08:47:39] [PASSED] check_used [08:47:39] [PASSED] check_quota [08:47:39] [PASSED] check_all [08:47:39] [PASSED] check_limits [08:47:39] [PASSED] check_overlap [08:47:39] [PASSED] check_overlap_alloc [08:47:39] [PASSED] check_overlap_release [08:47:39] [PASSED] check_overlap_partial_init [08:47:39] [PASSED] check_overlap_partial_shared_range_blocking [08:47:39] [PASSED] check_used_usable [08:47:39] [PASSED] check_used_shareable [08:47:39] [PASSED] check_used_mixed [08:47:39] [PASSED] check_release_usable_range [08:47:39] [PASSED] check_release_shareable_range [08:47:39] [PASSED] check_split_boundaries [08:47:39] [PASSED] check_shareable_spare [08:47:39] [PASSED] check_shareable_spare_fragmented_tail [08:47:39] ===================== [PASSED] guc_idm ===================== [08:47:39] ============== guc_klv_helpers (13 subtests) =============== [08:47:39] [PASSED] test_count [08:47:39] [PASSED] test_encode_u32 [08:47:39] [PASSED] test_encode_u64 [08:47:39] [PASSED] test_encode_string [08:47:39] [PASSED] test_encode_object_raw [08:47:39] [PASSED] test_encode_object_klv [08:47:39] [PASSED] test_encode_object_nested [08:47:39] [PASSED] test_encode_object_basic [08:47:39] ===================== test_decode_u16 ===================== [08:47:39] [PASSED] empty [08:47:39] [PASSED] valid [08:47:39] [PASSED] max [08:47:39] [PASSED] big [08:47:39] [PASSED] long [08:47:39] ================= [PASSED] test_decode_u16 ================= [08:47:39] ===================== test_decode_u32 ===================== [08:47:39] [PASSED] empty [08:47:39] [PASSED] valid [08:47:39] [PASSED] max [08:47:39] [PASSED] long [08:47:39] ================= [PASSED] test_decode_u32 ================= [08:47:39] ===================== test_decode_u64 ===================== [08:47:39] [PASSED] empty [08:47:39] [PASSED] short [08:47:39] [PASSED] valid [08:47:39] [PASSED] max [08:47:39] [PASSED] long [08:47:39] ================= [PASSED] test_decode_u64 ================= [08:47:39] ===================== test_decode_str ===================== [08:47:39] [PASSED] empty [08:47:39] [PASSED] one [08:47:39] [PASSED] one_trash [08:47:39] [PASSED] two [08:47:39] [PASSED] two_trash [08:47:39] [PASSED] three [08:47:39] [PASSED] dword [08:47:39] [PASSED] four [08:47:39] [PASSED] five [08:47:39] [PASSED] six [08:47:39] [PASSED] seven [08:47:39] [PASSED] qword [08:47:39] ================= [PASSED] test_decode_str ================= [08:47:39] [PASSED] test_print [08:47:39] ================= [PASSED] guc_klv_helpers ================= [08:47:39] =================== xe_log (4 subtests) ==================== [08:47:39] [PASSED] demo_cper [08:47:39] [PASSED] demo_dmesg [08:47:39] ======================= test_dmesg ======================== [08:47:39] [PASSED] test_fatal [08:47:39] [PASSED] test_fatal_tile [08:47:39] [PASSED] test_fatal_gt [08:47:39] [PASSED] test_fatal_comp [08:47:39] [PASSED] test_fatal_comp_tile [08:47:39] [PASSED] test_fatal_comp_gt [08:47:39] [PASSED] test_fatal_all [08:47:39] [PASSED] test_recoverable [08:47:39] [PASSED] test_recoverable_tile [08:47:39] [PASSED] test_recoverable_gt [08:47:39] [PASSED] test_recoverable_comp [08:47:39] [PASSED] test_recoverable_comp_tile [08:47:39] [PASSED] test_recoverable_comp_gt [08:47:39] [PASSED] test_recoverable_all [08:47:39] [PASSED] test_info [08:47:39] [PASSED] test_info_tile [08:47:39] [PASSED] test_info_gt [08:47:39] [PASSED] test_info_err [08:47:39] [PASSED] test_info_comp [08:47:39] [PASSED] test_info_comp_tile [08:47:39] [PASSED] test_info_comp_gt [08:47:39] [PASSED] test_info_all [08:47:39] [PASSED] test_hw_fatal [08:47:39] [PASSED] test_hw_recoverable [08:47:39] [PASSED] test_hw_corrected [08:47:39] [PASSED] test_hw_informational [08:47:39] =================== [PASSED] test_dmesg ==================== [08:47:39] ====================== test_invalid ======================= [08:47:39] [SKIPPED] no-component no-location no-warn (requires CONFIG_DRM_XE_DEBUG) [08:47:39] [SKIPPED] reserved location (requires CONFIG_DRM_XE_DEBUG) [08:47:39] [SKIPPED] unknown location (requires CONFIG_DRM_XE_DEBUG) [08:47:39] [SKIPPED] nonzero-device-id location (requires CONFIG_DRM_XE_DEBUG) [08:47:39] [SKIPPED] invalid-tile-id location (requires CONFIG_DRM_XE_DEBUG) [08:47:39] [SKIPPED] invalid-gt-id location (requires CONFIG_DRM_XE_DEBUG) [08:47:39] [SKIPPED] unknown component class (requires CONFIG_DRM_XE_DEBUG) [08:47:39] [SKIPPED] unknown system component (requires CONFIG_DRM_XE_DEBUG) [08:47:39] [SKIPPED] unknown hardware component (requires CONFIG_DRM_XE_DEBUG) [08:47:39] [SKIPPED] unknown component and location (requires CONFIG_DRM_XE_DEBUG) [08:47:39] ================== [SKIPPED] test_invalid ================== [08:47:39] ===================== [PASSED] xe_log ====================== [08:47:39] ================== no_relay (3 subtests) =================== [08:47:39] [PASSED] xe_drops_guc2pf_if_not_ready [08:47:39] [PASSED] xe_drops_guc2vf_if_not_ready [08:47:39] [PASSED] xe_rejects_send_if_not_ready [08:47:39] ==================== [PASSED] no_relay ===================== [08:47:39] ================== pf_relay (14 subtests) ================== [08:47:39] [PASSED] pf_rejects_guc2pf_too_short [08:47:39] [PASSED] pf_rejects_guc2pf_too_long [08:47:39] [PASSED] pf_rejects_guc2pf_no_payload [08:47:39] [PASSED] pf_fails_no_payload [08:47:39] [PASSED] pf_fails_bad_origin [08:47:39] [PASSED] pf_fails_bad_type [08:47:39] [PASSED] pf_txn_reports_error [08:47:39] [PASSED] pf_txn_sends_pf2guc [08:47:39] [PASSED] pf_sends_pf2guc [08:47:39] [SKIPPED] pf_loopback_nop (requires CONFIG_DRM_XE_DEBUG_SRIOV) [08:47:39] [SKIPPED] pf_loopback_echo (requires CONFIG_DRM_XE_DEBUG_SRIOV) [08:47:39] [SKIPPED] pf_loopback_fail (requires CONFIG_DRM_XE_DEBUG_SRIOV) [08:47:39] [SKIPPED] pf_loopback_busy (requires CONFIG_DRM_XE_DEBUG_SRIOV) [08:47:39] [SKIPPED] pf_loopback_retry (requires CONFIG_DRM_XE_DEBUG_SRIOV) [08:47:39] ==================== [PASSED] pf_relay ===================== [08:47:39] ================== vf_relay (3 subtests) =================== [08:47:39] [PASSED] vf_rejects_guc2vf_too_short [08:47:39] [PASSED] vf_rejects_guc2vf_too_long [08:47:39] [PASSED] vf_rejects_guc2vf_no_payload [08:47:39] ==================== [PASSED] vf_relay ===================== [08:47:39] ================ pf_gt_config (9 subtests) ================= [08:47:39] [PASSED] fair_contexts_1vf [08:47:39] [PASSED] fair_doorbells_1vf [08:47:39] [PASSED] fair_ggtt_1vf [08:47:39] ====================== fair_vram_1vf ====================== [08:47:39] [PASSED] 3.50 GiB [08:47:39] [PASSED] 11.5 GiB [08:47:39] [PASSED] 15.5 GiB [08:47:39] [PASSED] 31.5 GiB [08:47:39] [PASSED] 63.5 GiB [08:47:39] [PASSED] 1.91 GiB [08:47:39] ================== [PASSED] fair_vram_1vf ================== [08:47:39] ================ fair_vram_1vf_admin_only ================= [08:47:39] [PASSED] 3.50 GiB [08:47:39] [PASSED] 11.5 GiB [08:47:39] [PASSED] 15.5 GiB [08:47:39] [PASSED] 31.5 GiB [08:47:39] [PASSED] 63.5 GiB [08:47:39] [PASSED] 1.91 GiB [08:47:39] ============ [PASSED] fair_vram_1vf_admin_only ============= [08:47:39] ====================== fair_contexts ====================== [08:47:39] [PASSED] 1 VF [08:47:39] [PASSED] 2 VFs [08:47:39] [PASSED] 3 VFs [08:47:39] [PASSED] 4 VFs [08:47:39] [PASSED] 5 VFs [08:47:39] [PASSED] 6 VFs [08:47:39] [PASSED] 7 VFs [08:47:39] [PASSED] 8 VFs [08:47:39] [PASSED] 9 VFs [08:47:39] [PASSED] 10 VFs [08:47:39] [PASSED] 11 VFs [08:47:39] [PASSED] 12 VFs [08:47:39] [PASSED] 13 VFs [08:47:39] [PASSED] 14 VFs [08:47:39] [PASSED] 15 VFs [08:47:39] [PASSED] 16 VFs [08:47:39] [PASSED] 17 VFs [08:47:39] [PASSED] 18 VFs [08:47:39] [PASSED] 19 VFs [08:47:39] [PASSED] 20 VFs [08:47:39] [PASSED] 21 VFs [08:47:39] [PASSED] 22 VFs [08:47:39] [PASSED] 23 VFs [08:47:39] [PASSED] 24 VFs [08:47:39] [PASSED] 25 VFs [08:47:39] [PASSED] 26 VFs [08:47:39] [PASSED] 27 VFs [08:47:39] [PASSED] 28 VFs [08:47:39] [PASSED] 29 VFs [08:47:39] [PASSED] 30 VFs [08:47:39] [PASSED] 31 VFs [08:47:39] [PASSED] 32 VFs [08:47:39] [PASSED] 33 VFs [08:47:39] [PASSED] 34 VFs [08:47:39] [PASSED] 35 VFs [08:47:39] [PASSED] 36 VFs [08:47:39] [PASSED] 37 VFs [08:47:39] [PASSED] 38 VFs [08:47:39] [PASSED] 39 VFs [08:47:39] [PASSED] 40 VFs [08:47:39] [PASSED] 41 VFs [08:47:39] [PASSED] 42 VFs [08:47:39] [PASSED] 43 VFs [08:47:39] [PASSED] 44 VFs [08:47:39] [PASSED] 45 VFs [08:47:39] [PASSED] 46 VFs [08:47:39] [PASSED] 47 VFs [08:47:39] [PASSED] 48 VFs [08:47:39] [PASSED] 49 VFs [08:47:39] [PASSED] 50 VFs [08:47:39] [PASSED] 51 VFs [08:47:39] [PASSED] 52 VFs [08:47:39] [PASSED] 53 VFs [08:47:39] [PASSED] 54 VFs [08:47:39] [PASSED] 55 VFs [08:47:39] [PASSED] 56 VFs [08:47:39] [PASSED] 57 VFs [08:47:39] [PASSED] 58 VFs [08:47:39] [PASSED] 59 VFs [08:47:39] [PASSED] 60 VFs [08:47:39] [PASSED] 61 VFs [08:47:39] [PASSED] 62 VFs [08:47:39] [PASSED] 63 VFs [08:47:39] ================== [PASSED] fair_contexts ================== [08:47:39] ===================== fair_doorbells ====================== [08:47:39] [PASSED] 1 VF [08:47:39] [PASSED] 2 VFs [08:47:39] [PASSED] 3 VFs [08:47:39] [PASSED] 4 VFs [08:47:39] [PASSED] 5 VFs [08:47:39] [PASSED] 6 VFs [08:47:39] [PASSED] 7 VFs [08:47:39] [PASSED] 8 VFs [08:47:39] [PASSED] 9 VFs [08:47:39] [PASSED] 10 VFs [08:47:39] [PASSED] 11 VFs [08:47:39] [PASSED] 12 VFs [08:47:39] [PASSED] 13 VFs [08:47:39] [PASSED] 14 VFs [08:47:39] [PASSED] 15 VFs [08:47:39] [PASSED] 16 VFs [08:47:39] [PASSED] 17 VFs [08:47:39] [PASSED] 18 VFs [08:47:39] [PASSED] 19 VFs [08:47:39] [PASSED] 20 VFs [08:47:39] [PASSED] 21 VFs [08:47:39] [PASSED] 22 VFs [08:47:39] [PASSED] 23 VFs [08:47:39] [PASSED] 24 VFs [08:47:39] [PASSED] 25 VFs [08:47:39] [PASSED] 26 VFs [08:47:39] [PASSED] 27 VFs [08:47:39] [PASSED] 28 VFs [08:47:39] [PASSED] 29 VFs [08:47:39] [PASSED] 30 VFs [08:47:39] [PASSED] 31 VFs [08:47:39] [PASSED] 32 VFs [08:47:39] [PASSED] 33 VFs [08:47:39] [PASSED] 34 VFs [08:47:39] [PASSED] 35 VFs [08:47:39] [PASSED] 36 VFs [08:47:39] [PASSED] 37 VFs [08:47:39] [PASSED] 38 VFs [08:47:39] [PASSED] 39 VFs [08:47:39] [PASSED] 40 VFs [08:47:39] [PASSED] 41 VFs [08:47:39] [PASSED] 42 VFs [08:47:39] [PASSED] 43 VFs [08:47:39] [PASSED] 44 VFs [08:47:39] [PASSED] 45 VFs [08:47:39] [PASSED] 46 VFs [08:47:39] [PASSED] 47 VFs [08:47:39] [PASSED] 48 VFs [08:47:39] [PASSED] 49 VFs [08:47:39] [PASSED] 50 VFs [08:47:39] [PASSED] 51 VFs [08:47:39] [PASSED] 52 VFs [08:47:39] [PASSED] 53 VFs [08:47:39] [PASSED] 54 VFs [08:47:39] [PASSED] 55 VFs [08:47:39] [PASSED] 56 VFs [08:47:39] [PASSED] 57 VFs [08:47:39] [PASSED] 58 VFs [08:47:39] [PASSED] 59 VFs [08:47:39] [PASSED] 60 VFs [08:47:39] [PASSED] 61 VFs [08:47:39] [PASSED] 62 VFs [08:47:39] [PASSED] 63 VFs [08:47:39] ================= [PASSED] fair_doorbells ================== [08:47:39] ======================== fair_ggtt ======================== [08:47:39] [PASSED] 1 VF [08:47:39] [PASSED] 2 VFs [08:47:39] [PASSED] 3 VFs [08:47:39] [PASSED] 4 VFs [08:47:39] [PASSED] 5 VFs [08:47:39] [PASSED] 6 VFs [08:47:39] [PASSED] 7 VFs [08:47:39] [PASSED] 8 VFs [08:47:39] [PASSED] 9 VFs [08:47:39] [PASSED] 10 VFs [08:47:39] [PASSED] 11 VFs [08:47:39] [PASSED] 12 VFs [08:47:39] [PASSED] 13 VFs [08:47:39] [PASSED] 14 VFs [08:47:39] [PASSED] 15 VFs [08:47:39] [PASSED] 16 VFs [08:47:39] [PASSED] 17 VFs [08:47:39] [PASSED] 18 VFs [08:47:39] [PASSED] 19 VFs [08:47:39] [PASSED] 20 VFs [08:47:39] [PASSED] 21 VFs [08:47:39] [PASSED] 22 VFs [08:47:39] [PASSED] 23 VFs [08:47:39] [PASSED] 24 VFs [08:47:39] [PASSED] 25 VFs [08:47:39] [PASSED] 26 VFs [08:47:39] [PASSED] 27 VFs [08:47:39] [PASSED] 28 VFs [08:47:39] [PASSED] 29 VFs [08:47:39] [PASSED] 30 VFs [08:47:39] [PASSED] 31 VFs [08:47:39] [PASSED] 32 VFs [08:47:39] [PASSED] 33 VFs [08:47:39] [PASSED] 34 VFs [08:47:39] [PASSED] 35 VFs [08:47:39] [PASSED] 36 VFs [08:47:39] [PASSED] 37 VFs [08:47:39] [PASSED] 38 VFs [08:47:39] [PASSED] 39 VFs [08:47:39] [PASSED] 40 VFs [08:47:39] [PASSED] 41 VFs [08:47:39] [PASSED] 42 VFs [08:47:39] [PASSED] 43 VFs [08:47:39] [PASSED] 44 VFs [08:47:39] [PASSED] 45 VFs [08:47:39] [PASSED] 46 VFs [08:47:39] [PASSED] 47 VFs [08:47:39] [PASSED] 48 VFs [08:47:39] [PASSED] 49 VFs [08:47:39] [PASSED] 50 VFs [08:47:39] [PASSED] 51 VFs [08:47:39] [PASSED] 52 VFs [08:47:39] [PASSED] 53 VFs [08:47:39] [PASSED] 54 VFs [08:47:39] [PASSED] 55 VFs [08:47:39] [PASSED] 56 VFs [08:47:39] [PASSED] 57 VFs [08:47:39] [PASSED] 58 VFs [08:47:39] [PASSED] 59 VFs [08:47:39] [PASSED] 60 VFs [08:47:39] [PASSED] 61 VFs [08:47:39] [PASSED] 62 VFs [08:47:39] [PASSED] 63 VFs [08:47:39] ==================== [PASSED] fair_ggtt ==================== [08:47:39] ======================== fair_vram ======================== [08:47:39] [PASSED] 1 VF [08:47:39] [PASSED] 2 VFs [08:47:39] [PASSED] 3 VFs [08:47:39] [PASSED] 4 VFs [08:47:39] [PASSED] 5 VFs [08:47:39] [PASSED] 6 VFs [08:47:39] [PASSED] 7 VFs [08:47:39] [PASSED] 8 VFs [08:47:39] [PASSED] 9 VFs [08:47:39] [PASSED] 10 VFs [08:47:39] [PASSED] 11 VFs [08:47:39] [PASSED] 12 VFs [08:47:39] [PASSED] 13 VFs [08:47:39] [PASSED] 14 VFs [08:47:39] [PASSED] 15 VFs [08:47:39] [PASSED] 16 VFs [08:47:39] [PASSED] 17 VFs [08:47:39] [PASSED] 18 VFs [08:47:39] [PASSED] 19 VFs [08:47:39] [PASSED] 20 VFs [08:47:39] [PASSED] 21 VFs [08:47:39] [PASSED] 22 VFs [08:47:39] [PASSED] 23 VFs [08:47:39] [PASSED] 24 VFs [08:47:39] [PASSED] 25 VFs [08:47:39] [PASSED] 26 VFs [08:47:39] [PASSED] 27 VFs [08:47:39] [PASSED] 28 VFs [08:47:39] [PASSED] 29 VFs [08:47:39] [PASSED] 30 VFs [08:47:39] [PASSED] 31 VFs [08:47:39] [PASSED] 32 VFs [08:47:39] [PASSED] 33 VFs [08:47:39] [PASSED] 34 VFs [08:47:39] [PASSED] 35 VFs [08:47:39] [PASSED] 36 VFs [08:47:39] [PASSED] 37 VFs [08:47:39] [PASSED] 38 VFs [08:47:39] [PASSED] 39 VFs [08:47:39] [PASSED] 40 VFs [08:47:39] [PASSED] 41 VFs [08:47:39] [PASSED] 42 VFs [08:47:39] [PASSED] 43 VFs [08:47:39] [PASSED] 44 VFs [08:47:39] [PASSED] 45 VFs [08:47:39] [PASSED] 46 VFs [08:47:39] [PASSED] 47 VFs [08:47:39] [PASSED] 48 VFs [08:47:39] [PASSED] 49 VFs [08:47:39] [PASSED] 50 VFs [08:47:39] [PASSED] 51 VFs [08:47:39] [PASSED] 52 VFs [08:47:39] [PASSED] 53 VFs [08:47:39] [PASSED] 54 VFs [08:47:39] [PASSED] 55 VFs [08:47:39] [PASSED] 56 VFs [08:47:39] [PASSED] 57 VFs [08:47:39] [PASSED] 58 VFs [08:47:39] [PASSED] 59 VFs [08:47:39] [PASSED] 60 VFs [08:47:39] [PASSED] 61 VFs [08:47:39] [PASSED] 62 VFs [08:47:39] [PASSED] 63 VFs [08:47:39] ==================== [PASSED] fair_vram ==================== [08:47:39] ================== [PASSED] pf_gt_config =================== [08:47:39] ===================== lmtt (1 subtest) ===================== [08:47:39] ======================== test_ops ========================= [08:47:39] [PASSED] 2-level [08:47:39] [PASSED] multi-level [08:47:39] ==================== [PASSED] test_ops ===================== [08:47:39] ====================== [PASSED] lmtt ======================= [08:47:39] ================= sriov_packet (1 subtest) ================= [08:47:39] [PASSED] test_descriptor_init [08:47:39] ================== [PASSED] sriov_packet =================== [08:47:39] ================= pf_service (11 subtests) ================= [08:47:39] [PASSED] pf_negotiate_any [08:47:39] [PASSED] pf_negotiate_base_match [08:47:39] [PASSED] pf_negotiate_base_newer [08:47:39] [PASSED] pf_negotiate_base_next [08:47:39] [SKIPPED] pf_negotiate_base_older (no older minor) [08:47:39] [PASSED] pf_negotiate_base_prev [08:47:39] [PASSED] pf_negotiate_latest_match [08:47:39] [PASSED] pf_negotiate_latest_newer [08:47:39] [PASSED] pf_negotiate_latest_next [08:47:39] [SKIPPED] pf_negotiate_latest_older (no older minor) [08:47:39] [SKIPPED] pf_negotiate_latest_prev (no prev major) [08:47:39] =================== [PASSED] pf_service ==================== [08:47:39] ================= xe_guc_g2g (2 subtests) ================== [08:47:39] ============== xe_live_guc_g2g_kunit_default ============== [08:47:39] ========= [SKIPPED] xe_live_guc_g2g_kunit_default ========== [08:47:39] ============== xe_live_guc_g2g_kunit_allmem =============== [08:47:39] ========== [SKIPPED] xe_live_guc_g2g_kunit_allmem ========== [08:47:39] =================== [SKIPPED] xe_guc_g2g =================== [08:47:39] =================== xe_mocs (2 subtests) =================== [08:47:39] ================ xe_live_mocs_kernel_kunit ================ [08:47:39] =========== [SKIPPED] xe_live_mocs_kernel_kunit ============ [08:47:39] ================ xe_live_mocs_reset_kunit ================= [08:47:39] ============ [SKIPPED] xe_live_mocs_reset_kunit ============ [08:47:39] ==================== [SKIPPED] xe_mocs ===================== [08:47:39] ================= xe_migrate (3 subtests) ================== [08:47:39] ================= xe_migrate_sanity_kunit ================= [08:47:39] ============ [SKIPPED] xe_migrate_sanity_kunit ============= [08:47:39] ================== xe_validate_ccs_kunit ================== [08:47:39] ============= [SKIPPED] xe_validate_ccs_kunit ============== [08:47:39] ============= xe_migrate_access_memory_kunit ============== [08:47:39] ========= [SKIPPED] xe_migrate_access_memory_kunit ========= [08:47:39] =================== [SKIPPED] xe_migrate =================== [08:47:39] ================== xe_dma_buf (1 subtest) ================== [08:47:39] ==================== xe_dma_buf_kunit ===================== [08:47:39] ================ [SKIPPED] xe_dma_buf_kunit ================ [08:47:39] =================== [SKIPPED] xe_dma_buf =================== [08:47:39] ================= xe_bo_shrink (1 subtest) ================= [08:47:39] =================== xe_bo_shrink_kunit ==================== [08:47:39] =============== [SKIPPED] xe_bo_shrink_kunit =============== [08:47:39] ================== [SKIPPED] xe_bo_shrink ================== [08:47:39] ==================== xe_bo (2 subtests) ==================== [08:47:39] ================== xe_ccs_migrate_kunit =================== [08:47:39] ============== [SKIPPED] xe_ccs_migrate_kunit ============== [08:47:39] ==================== xe_bo_evict_kunit ==================== [08:47:39] =============== [SKIPPED] xe_bo_evict_kunit ================ [08:47:39] ===================== [SKIPPED] xe_bo ====================== [08:47:39] =================== xe_any (9 subtests) ==================== [08:47:39] [PASSED] test_to_xe [08:47:39] [PASSED] test_to_dev [08:47:39] [PASSED] test_to_pdev [08:47:39] [PASSED] test_to_drm [08:47:39] [PASSED] test_if_pdev [08:47:39] [PASSED] test_if_xe [08:47:39] [PASSED] test_if_tile [08:47:39] [PASSED] test_if_gt [08:47:39] [PASSED] test_to_id [08:47:39] ===================== [PASSED] xe_any ====================== [08:47:39] ==================== args (13 subtests) ==================== [08:47:39] [PASSED] count_args_test [08:47:39] [PASSED] call_args_example [08:47:39] [PASSED] call_args_test [08:47:39] [PASSED] drop_first_arg_example [08:47:39] [PASSED] drop_first_arg_test [08:47:39] [PASSED] first_arg_example [08:47:39] [PASSED] first_arg_test [08:47:39] [PASSED] last_arg_example [08:47:39] [PASSED] last_arg_test [08:47:39] [PASSED] pick_arg_example [08:47:39] [PASSED] if_args_example [08:47:39] [PASSED] if_args_test [08:47:39] [PASSED] sep_comma_example [08:47:39] ====================== [PASSED] args ======================= [08:47:39] =================== xe_pci (3 subtests) ==================== [08:47:39] ==================== check_graphics_ip ==================== [08:47:39] [PASSED] 12.00 Xe_LP [08:47:39] [PASSED] 12.10 Xe_LP+ [08:47:39] [PASSED] 12.55 Xe_HPG [08:47:39] [PASSED] 12.60 Xe_HPC [08:47:39] [PASSED] 12.70 Xe_LPG [08:47:39] [PASSED] 12.71 Xe_LPG [08:47:39] [PASSED] 12.74 Xe_LPG+ [08:47:39] [PASSED] 20.01 Xe2_HPG [08:47:39] [PASSED] 20.02 Xe2_HPG [08:47:39] [PASSED] 20.04 Xe2_LPG [08:47:39] [PASSED] 30.00 Xe3_LPG [08:47:39] [PASSED] 30.01 Xe3_LPG [08:47:39] [PASSED] 30.03 Xe3_LPG [08:47:39] [PASSED] 30.04 Xe3_LPG [08:47:39] [PASSED] 30.05 Xe3_LPG [08:47:39] [PASSED] 35.10 Xe3p_LPG [08:47:39] [PASSED] 35.11 Xe3p_XPC [08:47:39] ================ [PASSED] check_graphics_ip ================ [08:47:39] ===================== check_media_ip ====================== [08:47:39] [PASSED] 12.00 Xe_M [08:47:39] [PASSED] 12.55 Xe_HPM [08:47:39] [PASSED] 13.00 Xe_LPM+ [08:47:39] [PASSED] 13.01 Xe2_HPM [08:47:39] [PASSED] 20.00 Xe2_LPM [08:47:39] [PASSED] 30.00 Xe3_LPM [08:47:39] [PASSED] 30.02 Xe3_LPM [08:47:39] [PASSED] 35.00 Xe3p_LPM [08:47:39] [PASSED] 35.03 Xe3p_HPM [08:47:39] ================= [PASSED] check_media_ip ================== [08:47:39] =================== check_platform_desc =================== [08:47:39] [PASSED] 0x9A60 (TIGERLAKE) [08:47:39] [PASSED] 0x9A68 (TIGERLAKE) [08:47:39] [PASSED] 0x9A70 (TIGERLAKE) [08:47:39] [PASSED] 0x9A40 (TIGERLAKE) [08:47:39] [PASSED] 0x9A49 (TIGERLAKE) [08:47:39] [PASSED] 0x9A59 (TIGERLAKE) [08:47:39] [PASSED] 0x9A78 (TIGERLAKE) [08:47:39] [PASSED] 0x9AC0 (TIGERLAKE) [08:47:39] [PASSED] 0x9AC9 (TIGERLAKE) [08:47:39] [PASSED] 0x9AD9 (TIGERLAKE) [08:47:39] [PASSED] 0x9AF8 (TIGERLAKE) [08:47:39] [PASSED] 0x4C80 (ROCKETLAKE) [08:47:39] [PASSED] 0x4C8A (ROCKETLAKE) [08:47:39] [PASSED] 0x4C8B (ROCKETLAKE) [08:47:39] [PASSED] 0x4C8C (ROCKETLAKE) [08:47:39] [PASSED] 0x4C90 (ROCKETLAKE) [08:47:39] [PASSED] 0x4C9A (ROCKETLAKE) [08:47:39] [PASSED] 0x4680 (ALDERLAKE_S) [08:47:39] [PASSED] 0x4682 (ALDERLAKE_S) [08:47:39] [PASSED] 0x4688 (ALDERLAKE_S) [08:47:39] [PASSED] 0x468A (ALDERLAKE_S) [08:47:39] [PASSED] 0x468B (ALDERLAKE_S) [08:47:39] [PASSED] 0x4690 (ALDERLAKE_S) [08:47:39] [PASSED] 0x4692 (ALDERLAKE_S) [08:47:39] [PASSED] 0x4693 (ALDERLAKE_S) [08:47:39] [PASSED] 0x46A0 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46A1 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46A2 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46A3 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46A6 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46A8 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46AA (ALDERLAKE_P) [08:47:39] [PASSED] 0x462A (ALDERLAKE_P) [08:47:39] [PASSED] 0x4626 (ALDERLAKE_P) [08:47:39] [PASSED] 0x4628 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46B0 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46B1 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46B2 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46B3 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46C0 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46C1 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46C2 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46C3 (ALDERLAKE_P) [08:47:39] [PASSED] 0x46D0 (ALDERLAKE_N) [08:47:39] [PASSED] 0x46D1 (ALDERLAKE_N) [08:47:39] [PASSED] 0x46D2 (ALDERLAKE_N) [08:47:39] [PASSED] 0x46D3 (ALDERLAKE_N) [08:47:39] [PASSED] 0x46D4 (ALDERLAKE_N) [08:47:39] [PASSED] 0xA721 (ALDERLAKE_P) [08:47:39] [PASSED] 0xA7A1 (ALDERLAKE_P) [08:47:39] [PASSED] 0xA7A9 (ALDERLAKE_P) [08:47:39] [PASSED] 0xA7AC (ALDERLAKE_P) [08:47:39] [PASSED] 0xA7AD (ALDERLAKE_P) [08:47:39] [PASSED] 0xA720 (ALDERLAKE_P) [08:47:39] [PASSED] 0xA7A0 (ALDERLAKE_P) [08:47:39] [PASSED] 0xA7A8 (ALDERLAKE_P) [08:47:39] [PASSED] 0xA7AA (ALDERLAKE_P) [08:47:39] [PASSED] 0xA7AB (ALDERLAKE_P) [08:47:39] [PASSED] 0xA780 (ALDERLAKE_S) [08:47:39] [PASSED] 0xA781 (ALDERLAKE_S) [08:47:39] [PASSED] 0xA782 (ALDERLAKE_S) [08:47:39] [PASSED] 0xA783 (ALDERLAKE_S) [08:47:39] [PASSED] 0xA788 (ALDERLAKE_S) [08:47:39] [PASSED] 0xA789 (ALDERLAKE_S) [08:47:39] [PASSED] 0xA78A (ALDERLAKE_S) [08:47:39] [PASSED] 0xA78B (ALDERLAKE_S) [08:47:39] [PASSED] 0x4905 (DG1) [08:47:39] [PASSED] 0x4906 (DG1) [08:47:39] [PASSED] 0x4907 (DG1) [08:47:39] [PASSED] 0x4908 (DG1) [08:47:39] [PASSED] 0x4909 (DG1) [08:47:39] [PASSED] 0x56C0 (DG2) [08:47:39] [PASSED] 0x56C2 (DG2) [08:47:39] [PASSED] 0x56C1 (DG2) [08:47:39] [PASSED] 0x7D51 (METEORLAKE) [08:47:39] [PASSED] 0x7DD1 (METEORLAKE) [08:47:39] [PASSED] 0x7D41 (METEORLAKE) [08:47:39] [PASSED] 0x7D67 (METEORLAKE) [08:47:39] [PASSED] 0xB640 (METEORLAKE) [08:47:39] [PASSED] 0x56A0 (DG2) [08:47:39] [PASSED] 0x56A1 (DG2) [08:47:39] [PASSED] 0x56A2 (DG2) [08:47:39] [PASSED] 0x56BE (DG2) [08:47:39] [PASSED] 0x56BF (DG2) [08:47:39] [PASSED] 0x5690 (DG2) [08:47:39] [PASSED] 0x5691 (DG2) [08:47:39] [PASSED] 0x5692 (DG2) [08:47:39] [PASSED] 0x56A5 (DG2) [08:47:39] [PASSED] 0x56A6 (DG2) [08:47:39] [PASSED] 0x56B0 (DG2) [08:47:39] [PASSED] 0x56B1 (DG2) [08:47:39] [PASSED] 0x56BA (DG2) [08:47:39] [PASSED] 0x56BB (DG2) [08:47:39] [PASSED] 0x56BC (DG2) [08:47:39] [PASSED] 0x56BD (DG2) [08:47:39] [PASSED] 0x5693 (DG2) [08:47:39] [PASSED] 0x5694 (DG2) [08:47:39] [PASSED] 0x5695 (DG2) [08:47:39] [PASSED] 0x56A3 (DG2) [08:47:39] [PASSED] 0x56A4 (DG2) [08:47:39] [PASSED] 0x56B2 (DG2) [08:47:39] [PASSED] 0x56B3 (DG2) [08:47:39] [PASSED] 0x5696 (DG2) [08:47:39] [PASSED] 0x5697 (DG2) [08:47:39] [PASSED] 0xB69 (PVC) [08:47:39] [PASSED] 0xB6E (PVC) [08:47:39] [PASSED] 0xBD4 (PVC) [08:47:39] [PASSED] 0xBD5 (PVC) [08:47:39] [PASSED] 0xBD6 (PVC) [08:47:39] [PASSED] 0xBD7 (PVC) [08:47:39] [PASSED] 0xBD8 (PVC) [08:47:39] [PASSED] 0xBD9 (PVC) [08:47:39] [PASSED] 0xBDA (PVC) [08:47:39] [PASSED] 0xBDB (PVC) [08:47:39] [PASSED] 0xBE0 (PVC) [08:47:39] [PASSED] 0xBE1 (PVC) [08:47:39] [PASSED] 0xBE5 (PVC) [08:47:39] [PASSED] 0x7D40 (METEORLAKE) [08:47:39] [PASSED] 0x7D45 (METEORLAKE) [08:47:39] [PASSED] 0x7D55 (METEORLAKE) [08:47:39] [PASSED] 0x7D60 (METEORLAKE) [08:47:39] [PASSED] 0x7DD5 (METEORLAKE) [08:47:39] [PASSED] 0x6420 (LUNARLAKE) [08:47:39] [PASSED] 0x64A0 (LUNARLAKE) [08:47:39] [PASSED] 0x64B0 (LUNARLAKE) [08:47:39] [PASSED] 0xE202 (BATTLEMAGE) [08:47:39] [PASSED] 0xE209 (BATTLEMAGE) [08:47:39] [PASSED] 0xE20B (BATTLEMAGE) [08:47:39] [PASSED] 0xE20C (BATTLEMAGE) [08:47:39] [PASSED] 0xE20D (BATTLEMAGE) [08:47:39] [PASSED] 0xE210 (BATTLEMAGE) [08:47:39] [PASSED] 0xE211 (BATTLEMAGE) [08:47:39] [PASSED] 0xE212 (BATTLEMAGE) [08:47:39] [PASSED] 0xE216 (BATTLEMAGE) [08:47:39] [PASSED] 0xE220 (BATTLEMAGE) [08:47:39] [PASSED] 0xE221 (BATTLEMAGE) [08:47:39] [PASSED] 0xE222 (BATTLEMAGE) [08:47:39] [PASSED] 0xE223 (BATTLEMAGE) [08:47:39] [PASSED] 0xB080 (PANTHERLAKE) [08:47:39] [PASSED] 0xB081 (PANTHERLAKE) [08:47:39] [PASSED] 0xB082 (PANTHERLAKE) [08:47:39] [PASSED] 0xB083 (PANTHERLAKE) [08:47:39] [PASSED] 0xB084 (PANTHERLAKE) [08:47:39] [PASSED] 0xB085 (PANTHERLAKE) [08:47:39] [PASSED] 0xB086 (PANTHERLAKE) [08:47:39] [PASSED] 0xB087 (PANTHERLAKE) [08:47:39] [PASSED] 0xB08F (PANTHERLAKE) [08:47:39] [PASSED] 0xB090 (PANTHERLAKE) [08:47:39] [PASSED] 0xB0A0 (PANTHERLAKE) [08:47:39] [PASSED] 0xB0A1 (PANTHERLAKE) [08:47:39] [PASSED] 0xB0B0 (PANTHERLAKE) [08:47:39] [PASSED] 0xFD80 (PANTHERLAKE) [08:47:39] [PASSED] 0xFD81 (PANTHERLAKE) [08:47:39] [PASSED] 0xD740 (NOVALAKE_S) [08:47:39] [PASSED] 0xD741 (NOVALAKE_S) [08:47:39] [PASSED] 0xD742 (NOVALAKE_S) [08:47:39] [PASSED] 0xD743 (NOVALAKE_S) [08:47:39] [PASSED] 0xD745 (NOVALAKE_S) [08:47:39] [PASSED] 0xD74A (NOVALAKE_S) [08:47:39] [PASSED] 0xD74B (NOVALAKE_S) [08:47:39] [PASSED] 0x674C (CRESCENTISLAND) [08:47:39] [PASSED] 0x674D (CRESCENTISLAND) [08:47:39] [PASSED] 0x674E (CRESCENTISLAND) [08:47:39] [PASSED] 0x674F (CRESCENTISLAND) [08:47:39] [PASSED] 0x6750 (CRESCENTISLAND) [08:47:39] [PASSED] 0x6751 (CRESCENTISLAND) [08:47:39] [PASSED] 0x6752 (CRESCENTISLAND) [08:47:39] [PASSED] 0xD750 (NOVALAKE_P) [08:47:39] [PASSED] 0xD751 (NOVALAKE_P) [08:47:39] [PASSED] 0xD752 (NOVALAKE_P) [08:47:39] [PASSED] 0xD753 (NOVALAKE_P) [08:47:39] [PASSED] 0xD754 (NOVALAKE_P) [08:47:39] [PASSED] 0xD755 (NOVALAKE_P) [08:47:39] [PASSED] 0xD756 (NOVALAKE_P) [08:47:39] [PASSED] 0xD757 (NOVALAKE_P) [08:47:39] [PASSED] 0xD75F (NOVALAKE_P) [08:47:39] =============== [PASSED] check_platform_desc =============== [08:47:39] ===================== [PASSED] xe_pci ====================== [08:47:39] ============= xe_rtp_tables_test (5 subtests) ============== [08:47:39] ================== xe_rtp_table_gt_test =================== [08:47:39] [PASSED] gt_was/14011060649 [08:47:39] [PASSED] gt_was/14011059788 [08:47:39] [PASSED] gt_was/14015795083 [08:47:39] [PASSED] gt_was/16021867713 [08:47:39] [PASSED] gt_was/14019449301 [08:47:39] [PASSED] gt_was/16028005424 [08:47:39] [PASSED] gt_was/14026578760 [08:47:39] [PASSED] gt_was/1409420604 [08:47:39] [PASSED] gt_was/1408615072 [08:47:39] [PASSED] gt_was/22010523718 [08:47:39] [PASSED] gt_was/14011006942 [08:47:39] [PASSED] gt_was/14014830051 [08:47:39] [PASSED] gt_was/18018781329 [08:47:39] [PASSED] gt_was/1509235366 [08:47:39] [PASSED] gt_was/18018781329 [08:47:39] [PASSED] gt_was/16016694945 [08:47:39] [PASSED] gt_was/14018575942 [08:47:39] [PASSED] gt_was/22016670082 [08:47:39] [PASSED] gt_was/22016670082 [08:47:39] [PASSED] gt_was/14017421178 [08:47:39] [PASSED] gt_was/16025250150 [08:47:39] [PASSED] gt_was/14021871409 [08:47:39] [PASSED] gt_was/16021865536 [08:47:39] [PASSED] gt_was/14021486841 [08:47:39] [PASSED] gt_was/14025160223 [08:47:39] [PASSED] gt_was/14026144927, 16029437861, 14026127056 [08:47:39] [PASSED] gt_was/14025635424 [08:47:39] [PASSED] gt_was/16028005424 [08:47:39] ============== [PASSED] xe_rtp_table_gt_test =============== [08:47:39] ================== xe_rtp_table_gt_test =================== [08:47:39] [PASSED] gt_tunings/Tuning: Blend Fill Caching Optimization Disable [08:47:39] [PASSED] gt_tunings/Tuning: 32B Access Enable [08:47:39] [PASSED] gt_tunings/Tuning: L3 cache [08:47:39] [PASSED] gt_tunings/Tuning: L3 cache - media [08:47:39] [PASSED] gt_tunings/Tuning: Compression Overfetch [08:47:39] [PASSED] gt_tunings/Tuning: Compression Overfetch - media [08:47:39] [PASSED] gt_tunings/Tuning: Enable compressible partial write overfetch in L3 [08:47:39] [PASSED] gt_tunings/Tuning: Enable compressible partial write overfetch in L3 - media [08:47:39] [PASSED] gt_tunings/Tuning: L2 Overfetch Compressible Only [08:47:39] [PASSED] gt_tunings/Tuning: L2 Overfetch Compressible Only - media [08:47:39] [PASSED] gt_tunings/Tuning: Stateless compression control [08:47:39] [PASSED] gt_tunings/Tuning: Stateless compression control - media [08:47:39] [PASSED] gt_tunings/Tuning: L3 RW flush all Cache [08:47:39] [PASSED] gt_tunings/Tuning: L3 RW flush all cache - media [08:47:39] [PASSED] gt_tunings/Tuning: Set STLB Bank Hash Mode to 4KB [08:47:39] [PASSED] gt_tunings/Tuning: Force All Non-Compressible Memory Reads to be 256B Overfetches [08:47:39] ============== [PASSED] xe_rtp_table_gt_test =============== [08:47:39] ================== xe_rtp_table_oob_test ================== [08:47:39] [PASSED] oob_was/1607983814 [08:47:39] [PASSED] oob_was/16010904313 [08:47:39] [PASSED] oob_was/18022495364 [08:47:39] [PASSED] oob_was/22012773006 [08:47:39] [PASSED] oob_was/14014475959 [08:47:39] [PASSED] oob_was/22011391025 [08:47:39] [PASSED] oob_was/22012727170 [08:47:39] [PASSED] oob_was/22012727685 [08:47:39] [PASSED] oob_was/22016596838 [08:47:39] [PASSED] oob_was/18020744125 [08:47:39] [PASSED] oob_was/1409600907 [08:47:39] [PASSED] oob_was/22014953428 [08:47:39] [PASSED] oob_was/16017236439 [08:47:39] [PASSED] oob_was/14019821291 [08:47:39] [PASSED] oob_was/14015076503 [08:47:39] [PASSED] oob_was/22016122933 [08:47:39] [PASSED] oob_was/14018913170 [08:47:39] [PASSED] oob_was/14018094691 [08:47:39] [PASSED] oob_was/18024947630 [08:47:39] [PASSED] oob_was/16022287689 [08:47:39] [PASSED] oob_was/13011645652 [08:47:39] [PASSED] oob_was/14022293748 [08:47:39] [PASSED] oob_was/22019794406 [08:47:39] [PASSED] oob_was/22019338487 [08:47:39] [PASSED] oob_was/16023588340 [08:47:39] [PASSED] oob_was/14019789679 [08:47:39] [PASSED] oob_was/14022866841 [08:47:39] [PASSED] oob_was/16021333562 [08:47:39] [PASSED] oob_was/14016712196 [08:47:39] [PASSED] oob_was/14015568240 [08:47:39] [PASSED] oob_was/18013179988 [08:47:39] [PASSED] oob_was/1508761755 [08:47:39] [PASSED] oob_was/16023105232 [08:47:39] [PASSED] oob_was/16026508708 [08:47:39] [PASSED] oob_was/14020001231 [08:47:39] [PASSED] oob_was/16023683509 [08:47:39] [PASSED] oob_was/14025515070 [08:47:39] [PASSED] oob_was/15015404425_disable [08:47:39] [PASSED] oob_was/16026007364 [08:47:39] [PASSED] oob_was/14020316580 [08:47:39] [PASSED] oob_was/14025883347 [08:47:39] [PASSED] oob_was/16029380221 [08:47:39] [PASSED] oob_was/22022079272 [08:47:39] [PASSED] oob_was/16029897822 [08:47:39] [PASSED] oob_was/14026539277 [08:47:39] [PASSED] oob_was/14027054324 [08:47:39] [PASSED] oob_was/14025941587 [08:47:39] [PASSED] oob_was/16030224309 [08:47:39] [PASSED] oob_was/14028709524 [08:47:39] ============== [PASSED] xe_rtp_table_oob_test ============== [08:47:39] ================ xe_rtp_table_dev_oob_test ================ [08:47:39] [PASSED] device_oob_was/22010954014 [08:47:39] [PASSED] device_oob_was/15015404425 [08:47:39] [PASSED] device_oob_was/22019338487_display [08:47:39] [PASSED] device_oob_was/14022085890 [08:47:39] [PASSED] device_oob_was/14026633728 [08:47:39] [PASSED] device_oob_was/14026746987 [08:47:39] [PASSED] device_oob_was/14026779378 [08:47:39] ============ [PASSED] xe_rtp_table_dev_oob_test ============ [08:47:39] ========== xe_rtp_table_missing_upper_bound_test ========== [08:47:39] [PASSED] register_whitelist/WaAllowPMDepthAndInvocationCountAccessFromUMD, 1408556865 [08:47:39] [PASSED] register_whitelist/1508744258, 14012131227, 1808121037 [08:47:39] [PASSED] register_whitelist/1806527549 [08:47:39] [PASSED] register_whitelist/allow_read_ctx_timestamp [08:47:39] [PASSED] register_whitelist/allow_read_queue_timestamp [08:47:39] [PASSED] register_whitelist/16014440446 [08:47:39] [PASSED] register_whitelist/16017236439 [08:47:39] [PASSED] register_whitelist/16020183090 [08:47:39] [PASSED] register_whitelist/14024997852 [08:47:39] [PASSED] register_whitelist/14024997852 [08:47:39] ====== [PASSED] xe_rtp_table_missing_upper_bound_test ====== [08:47:39] =============== [PASSED] xe_rtp_tables_test ================ [08:47:39] =================== xe_rtp (3 subtests) ==================== [08:47:39] =================== xe_rtp_rules_tests ==================== [08:47:39] [PASSED] no [08:47:39] [PASSED] yes [08:47:39] [PASSED] no-and-no [08:47:39] [PASSED] no-and-yes [08:47:39] [PASSED] yes-and-no [08:47:39] [PASSED] yes-and-yes [08:47:39] [PASSED] no-or-no [08:47:39] [PASSED] no-or-yes [08:47:39] [PASSED] yes-or-no [08:47:39] [PASSED] yes-or-yes [08:47:39] [PASSED] no-yes-or-yes-no [08:47:39] [PASSED] no-yes-or-yes-yes [08:47:39] [PASSED] yes-yes-or-no-yes [08:47:39] [PASSED] yes-yes-or-yes-yes [08:47:39] [PASSED] no-no-or-yes-or-no [08:47:39] [PASSED] or [08:47:39] [PASSED] or-yes [08:47:39] [PASSED] or-no [08:47:39] [PASSED] yes-or [08:47:39] [PASSED] no-or [08:47:39] [PASSED] no-or-or-yes [08:47:39] [PASSED] yes-or-or-no [08:47:39] [PASSED] no-or-or-no [08:47:39] [PASSED] missing-context-engine-class [08:47:39] [PASSED] missing-context-engine-class-or-yes [08:47:39] [PASSED] missing-context-engine-class-or-or-yes [08:47:39] =============== [PASSED] xe_rtp_rules_tests ================ [08:47:39] =============== xe_rtp_process_to_sr_tests ================ [08:47:39] [PASSED] coalesce-same-reg [08:47:39] [PASSED] coalesce-same-reg-literal-and-func [08:47:39] [PASSED] no-match-no-add [08:47:39] [PASSED] two-regs-two-entries [08:47:39] [PASSED] clr-one-set-other [08:47:39] [PASSED] set-field [08:47:39] [PASSED] conflict-duplicate [08:47:39] [PASSED] conflict-not-disjoint [08:47:39] [PASSED] conflict-not-disjoint-literal-and-func [08:47:39] [PASSED] conflict-reg-type [08:47:39] [PASSED] bad-mcr-reg-forced-to-regular [08:47:39] [PASSED] bad-regular-reg-forced-to-mcr [08:47:39] =========== [PASSED] xe_rtp_process_to_sr_tests ============ [08:47:39] ================== xe_rtp_process_tests =================== [08:47:39] [PASSED] active1 [08:47:39] [PASSED] active2 [08:47:39] [PASSED] active-inactive [08:47:39] [PASSED] inactive-active [08:47:39] [PASSED] inactive-active-inactive [08:47:39] [PASSED] inactive-inactive-inactive [08:47:39] ============== [PASSED] xe_rtp_process_tests =============== [08:47:39] ===================== [PASSED] xe_rtp ====================== [08:47:39] ==================== xe_wa (1 subtest) ===================== [08:47:39] ======================== xe_wa_gt ========================= [08:47:39] [PASSED] TIGERLAKE B0 [08:47:39] [PASSED] DG1 A0 [08:47:39] [PASSED] DG1 B0 [08:47:39] [PASSED] ALDERLAKE_S A0 [08:47:39] [PASSED] ALDERLAKE_S B0 [08:47:39] [PASSED] ALDERLAKE_S C0 [08:47:39] [PASSED] ALDERLAKE_S D0 [08:47:39] [PASSED] ALDERLAKE_P A0 [08:47:39] [PASSED] ALDERLAKE_P B0 [08:47:39] [PASSED] ALDERLAKE_P C0 [08:47:39] [PASSED] ALDERLAKE_S RPLS D0 [08:47:39] [PASSED] ALDERLAKE_P RPLU E0 [08:47:39] [PASSED] DG2 G10 C0 [08:47:39] [PASSED] DG2 G11 B1 [08:47:39] [PASSED] DG2 G12 A1 [08:47:39] [PASSED] METEORLAKE 12.70(Xe_LPG) A0 13.00(Xe_LPM+) A0 [08:47:39] [PASSED] METEORLAKE 12.71(Xe_LPG) A0 13.00(Xe_LPM+) A0 [08:47:39] [PASSED] METEORLAKE 12.74(Xe_LPG+) A0 13.00(Xe_LPM+) A0 [08:47:39] [PASSED] LUNARLAKE 20.04(Xe2_LPG) A0 20.00(Xe2_LPM) A0 [08:47:39] [PASSED] LUNARLAKE 20.04(Xe2_LPG) B0 20.00(Xe2_LPM) A0 [08:47:39] [PASSED] BATTLEMAGE 20.01(Xe2_HPG) A0 13.01(Xe2_HPM) A1 [08:47:39] [PASSED] PANTHERLAKE 30.00(Xe3_LPG) A0 30.00(Xe3_LPM) A0 [08:47:39] ==================== [PASSED] xe_wa_gt ===================== [08:47:39] ====================== [PASSED] xe_wa ====================== [08:47:39] ============================================================ [08:47:39] Testing complete. Ran 840 tests: passed: 811, skipped: 29 [08:47:39] Elapsed time: 41.332s total, 2.577s configuring, 37.989s building, 0.715s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/drm/tests/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/tests/.kunitconfig [08:47:39] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [08:47:42] 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 [08:48:07] Starting KUnit Kernel (1/1)... [08:48:07] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [08:48:07] ============ drm_test_pick_cmdline (2 subtests) ============ [08:48:07] [PASSED] drm_test_pick_cmdline_res_1920_1080_60 [08:48:07] =============== drm_test_pick_cmdline_named =============== [08:48:07] [PASSED] NTSC [08:48:07] [PASSED] NTSC-J [08:48:07] [PASSED] PAL [08:48:07] [PASSED] PAL-M [08:48:07] =========== [PASSED] drm_test_pick_cmdline_named =========== [08:48:07] ============== [PASSED] drm_test_pick_cmdline ============== [08:48:07] == drm_test_atomic_get_connector_for_encoder (1 subtest) === [08:48:07] [PASSED] drm_test_drm_atomic_get_connector_for_encoder [08:48:07] ==== [PASSED] drm_test_atomic_get_connector_for_encoder ==== [08:48:07] =========== drm_validate_clone_mode (2 subtests) =========== [08:48:07] ============== drm_test_check_in_clone_mode =============== [08:48:07] [PASSED] in_clone_mode [08:48:07] [PASSED] not_in_clone_mode [08:48:07] ========== [PASSED] drm_test_check_in_clone_mode =========== [08:48:07] =============== drm_test_check_valid_clones =============== [08:48:07] [PASSED] not_in_clone_mode [08:48:07] [PASSED] valid_clone [08:48:07] [PASSED] invalid_clone [08:48:07] =========== [PASSED] drm_test_check_valid_clones =========== [08:48:07] ============= [PASSED] drm_validate_clone_mode ============= [08:48:07] ============= drm_validate_modeset (1 subtest) ============= [08:48:07] [PASSED] drm_test_check_connector_changed_modeset [08:48:07] ============== [PASSED] drm_validate_modeset =============== [08:48:07] ====== drm_test_bridge_get_current_state (1 subtest) ======= [08:48:07] [PASSED] drm_test_drm_bridge_get_current_state_atomic [08:48:07] ======== [PASSED] drm_test_bridge_get_current_state ======== [08:48:07] ====== drm_test_bridge_helper_reset_crtc (3 subtests) ====== [08:48:07] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic [08:48:07] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic_disabled [08:48:07] [PASSED] drm_test_drm_bridge_helper_hdmi_output_bus_fmts [08:48:07] ======== [PASSED] drm_test_bridge_helper_reset_crtc ======== [08:48:07] ============== drm_bridge_alloc (2 subtests) =============== [08:48:07] [PASSED] drm_test_drm_bridge_alloc_basic [08:48:07] [PASSED] drm_test_drm_bridge_alloc_get_put [08:48:07] ================ [PASSED] drm_bridge_alloc ================= [08:48:07] ============= drm_bridge_bus_fmt (5 subtests) ============== [08:48:07] [PASSED] drm_test_bridge_rgb_yuv_rgb [08:48:07] [PASSED] drm_test_bridge_must_convert_to_yuv444 [08:48:07] [PASSED] drm_test_bridge_hdmi_auto_rgb [08:48:07] [PASSED] drm_test_bridge_auto_first [08:48:07] [PASSED] drm_test_bridge_rgb_yuv_no_path [08:48:07] =============== [PASSED] drm_bridge_bus_fmt ================ [08:48:07] ============= drm_cmdline_parser (40 subtests) ============= [08:48:07] [PASSED] drm_test_cmdline_force_d_only [08:48:07] [PASSED] drm_test_cmdline_force_D_only_dvi [08:48:07] [PASSED] drm_test_cmdline_force_D_only_hdmi [08:48:07] [PASSED] drm_test_cmdline_force_D_only_not_digital [08:48:07] [PASSED] drm_test_cmdline_force_e_only [08:48:07] [PASSED] drm_test_cmdline_res [08:48:07] [PASSED] drm_test_cmdline_res_vesa [08:48:07] [PASSED] drm_test_cmdline_res_vesa_rblank [08:48:07] [PASSED] drm_test_cmdline_res_rblank [08:48:07] [PASSED] drm_test_cmdline_res_bpp [08:48:07] [PASSED] drm_test_cmdline_res_refresh [08:48:07] [PASSED] drm_test_cmdline_res_bpp_refresh [08:48:07] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced [08:48:07] [PASSED] drm_test_cmdline_res_bpp_refresh_margins [08:48:07] [PASSED] drm_test_cmdline_res_bpp_refresh_force_off [08:48:07] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on [08:48:07] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_analog [08:48:07] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_digital [08:48:07] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced_margins_force_on [08:48:07] [PASSED] drm_test_cmdline_res_margins_force_on [08:48:07] [PASSED] drm_test_cmdline_res_vesa_margins [08:48:07] [PASSED] drm_test_cmdline_name [08:48:07] [PASSED] drm_test_cmdline_name_bpp [08:48:07] [PASSED] drm_test_cmdline_name_option [08:48:07] [PASSED] drm_test_cmdline_name_bpp_option [08:48:07] [PASSED] drm_test_cmdline_rotate_0 [08:48:07] [PASSED] drm_test_cmdline_rotate_90 [08:48:07] [PASSED] drm_test_cmdline_rotate_180 [08:48:07] [PASSED] drm_test_cmdline_rotate_270 [08:48:07] [PASSED] drm_test_cmdline_hmirror [08:48:07] [PASSED] drm_test_cmdline_vmirror [08:48:07] [PASSED] drm_test_cmdline_margin_options [08:48:07] [PASSED] drm_test_cmdline_multiple_options [08:48:07] [PASSED] drm_test_cmdline_bpp_extra_and_option [08:48:07] [PASSED] drm_test_cmdline_extra_and_option [08:48:07] [PASSED] drm_test_cmdline_freestanding_options [08:48:07] [PASSED] drm_test_cmdline_freestanding_force_e_and_options [08:48:07] [PASSED] drm_test_cmdline_panel_orientation [08:48:07] ================ drm_test_cmdline_invalid ================= [08:48:07] [PASSED] margin_only [08:48:07] [PASSED] interlace_only [08:48:07] [PASSED] res_missing_x [08:48:07] [PASSED] res_missing_y [08:48:07] [PASSED] res_bad_y [08:48:07] [PASSED] res_missing_y_bpp [08:48:07] [PASSED] res_bad_bpp [08:48:07] [PASSED] res_bad_refresh [08:48:07] [PASSED] res_bpp_refresh_force_on_off [08:48:07] [PASSED] res_invalid_mode [08:48:07] [PASSED] res_bpp_wrong_place_mode [08:48:07] [PASSED] name_bpp_refresh [08:48:07] [PASSED] name_refresh [08:48:07] [PASSED] name_refresh_wrong_mode [08:48:07] [PASSED] name_refresh_invalid_mode [08:48:07] [PASSED] rotate_multiple [08:48:07] [PASSED] rotate_invalid_val [08:48:07] [PASSED] rotate_truncated [08:48:07] [PASSED] invalid_option [08:48:07] [PASSED] invalid_tv_option [08:48:07] [PASSED] truncated_tv_option [08:48:07] ============ [PASSED] drm_test_cmdline_invalid ============= [08:48:07] =============== drm_test_cmdline_tv_options =============== [08:48:07] [PASSED] NTSC [08:48:07] [PASSED] NTSC_443 [08:48:07] [PASSED] NTSC_J [08:48:07] [PASSED] PAL [08:48:07] [PASSED] PAL_M [08:48:07] [PASSED] PAL_N [08:48:07] [PASSED] SECAM [08:48:07] [PASSED] MONO_525 [08:48:07] [PASSED] MONO_625 [08:48:07] =========== [PASSED] drm_test_cmdline_tv_options =========== [08:48:07] =============== [PASSED] drm_cmdline_parser ================ [08:48:07] ========== drmm_connector_hdmi_init (20 subtests) ========== [08:48:07] [PASSED] drm_test_connector_hdmi_init_valid [08:48:07] [PASSED] drm_test_connector_hdmi_init_bpc_8 [08:48:07] [PASSED] drm_test_connector_hdmi_init_bpc_10 [08:48:07] [PASSED] drm_test_connector_hdmi_init_bpc_12 [08:48:07] [PASSED] drm_test_connector_hdmi_init_bpc_invalid [08:48:07] [PASSED] drm_test_connector_hdmi_init_bpc_null [08:48:07] [PASSED] drm_test_connector_hdmi_init_formats_empty [08:48:07] [PASSED] drm_test_connector_hdmi_init_formats_no_rgb [08:48:07] === drm_test_connector_hdmi_init_formats_yuv420_allowed === [08:48:07] [PASSED] supported_formats=0x9 yuv420_allowed=1 [08:48:07] [PASSED] supported_formats=0x9 yuv420_allowed=0 [08:48:07] [PASSED] supported_formats=0x5 yuv420_allowed=1 [08:48:07] [PASSED] supported_formats=0x5 yuv420_allowed=0 [08:48:07] === [PASSED] drm_test_connector_hdmi_init_formats_yuv420_allowed === [08:48:07] [PASSED] drm_test_connector_hdmi_init_null_ddc [08:48:07] [PASSED] drm_test_connector_hdmi_init_null_product [08:48:07] [PASSED] drm_test_connector_hdmi_init_null_vendor [08:48:07] [PASSED] drm_test_connector_hdmi_init_product_length_exact [08:48:07] [PASSED] drm_test_connector_hdmi_init_product_length_too_long [08:48:07] [PASSED] drm_test_connector_hdmi_init_product_valid [08:48:07] [PASSED] drm_test_connector_hdmi_init_vendor_length_exact [08:48:07] [PASSED] drm_test_connector_hdmi_init_vendor_length_too_long [08:48:07] [PASSED] drm_test_connector_hdmi_init_vendor_valid [08:48:07] ========= drm_test_connector_hdmi_init_type_valid ========= [08:48:07] [PASSED] HDMI-A [08:48:07] [PASSED] HDMI-B [08:48:07] ===== [PASSED] drm_test_connector_hdmi_init_type_valid ===== [08:48:07] ======== drm_test_connector_hdmi_init_type_invalid ======== [08:48:07] [PASSED] Unknown [08:48:07] [PASSED] VGA [08:48:07] [PASSED] DVI-I [08:48:07] [PASSED] DVI-D [08:48:07] [PASSED] DVI-A [08:48:07] [PASSED] Composite [08:48:07] [PASSED] SVIDEO [08:48:07] [PASSED] LVDS [08:48:07] [PASSED] Component [08:48:07] [PASSED] DIN [08:48:07] [PASSED] DP [08:48:07] [PASSED] TV [08:48:07] [PASSED] eDP [08:48:07] [PASSED] Virtual [08:48:07] [PASSED] DSI [08:48:07] [PASSED] DPI [08:48:07] [PASSED] Writeback [08:48:07] [PASSED] SPI [08:48:07] [PASSED] USB [08:48:07] ==== [PASSED] drm_test_connector_hdmi_init_type_invalid ==== [08:48:07] ============ [PASSED] drmm_connector_hdmi_init ============= [08:48:07] ============= drmm_connector_init (3 subtests) ============= [08:48:07] [PASSED] drm_test_drmm_connector_init [08:48:07] [PASSED] drm_test_drmm_connector_init_null_ddc [08:48:07] ========= drm_test_drmm_connector_init_type_valid ========= [08:48:07] [PASSED] Unknown [08:48:07] [PASSED] VGA [08:48:07] [PASSED] DVI-I [08:48:07] [PASSED] DVI-D [08:48:07] [PASSED] DVI-A [08:48:07] [PASSED] Composite [08:48:07] [PASSED] SVIDEO [08:48:07] [PASSED] LVDS [08:48:07] [PASSED] Component [08:48:07] [PASSED] DIN [08:48:07] [PASSED] DP [08:48:07] [PASSED] HDMI-A [08:48:07] [PASSED] HDMI-B [08:48:07] [PASSED] TV [08:48:07] [PASSED] eDP [08:48:07] [PASSED] Virtual [08:48:07] [PASSED] DSI [08:48:07] [PASSED] DPI [08:48:07] [PASSED] Writeback [08:48:07] [PASSED] SPI [08:48:07] [PASSED] USB [08:48:07] ===== [PASSED] drm_test_drmm_connector_init_type_valid ===== [08:48:07] =============== [PASSED] drmm_connector_init =============== [08:48:07] ========= drm_connector_dynamic_init (6 subtests) ========== [08:48:07] [PASSED] drm_test_drm_connector_dynamic_init [08:48:07] [PASSED] drm_test_drm_connector_dynamic_init_null_ddc [08:48:07] [PASSED] drm_test_drm_connector_dynamic_init_not_added [08:48:07] [PASSED] drm_test_drm_connector_dynamic_init_properties [08:48:07] ===== drm_test_drm_connector_dynamic_init_type_valid ====== [08:48:07] [PASSED] Unknown [08:48:07] [PASSED] VGA [08:48:07] [PASSED] DVI-I [08:48:07] [PASSED] DVI-D [08:48:07] [PASSED] DVI-A [08:48:07] [PASSED] Composite [08:48:07] [PASSED] SVIDEO [08:48:07] [PASSED] LVDS [08:48:07] [PASSED] Component [08:48:07] [PASSED] DIN [08:48:07] [PASSED] DP [08:48:07] [PASSED] HDMI-A [08:48:07] [PASSED] HDMI-B [08:48:07] [PASSED] TV [08:48:07] [PASSED] eDP [08:48:07] [PASSED] Virtual [08:48:07] [PASSED] DSI [08:48:07] [PASSED] DPI [08:48:07] [PASSED] Writeback [08:48:07] [PASSED] SPI [08:48:07] [PASSED] USB [08:48:07] = [PASSED] drm_test_drm_connector_dynamic_init_type_valid == [08:48:07] ======== drm_test_drm_connector_dynamic_init_name ========= [08:48:07] [PASSED] Unknown [08:48:07] [PASSED] VGA [08:48:07] [PASSED] DVI-I [08:48:07] [PASSED] DVI-D [08:48:07] [PASSED] DVI-A [08:48:07] [PASSED] Composite [08:48:07] [PASSED] SVIDEO [08:48:07] [PASSED] LVDS [08:48:07] [PASSED] Component [08:48:07] [PASSED] DIN [08:48:07] [PASSED] DP [08:48:07] [PASSED] HDMI-A [08:48:07] [PASSED] HDMI-B [08:48:07] [PASSED] TV [08:48:07] [PASSED] eDP [08:48:07] [PASSED] Virtual [08:48:07] [PASSED] DSI [08:48:07] [PASSED] DPI [08:48:07] [PASSED] Writeback [08:48:07] [PASSED] SPI [08:48:07] [PASSED] USB [08:48:07] ==== [PASSED] drm_test_drm_connector_dynamic_init_name ===== [08:48:07] =========== [PASSED] drm_connector_dynamic_init ============ [08:48:07] ==== drm_connector_dynamic_register_early (4 subtests) ===== [08:48:07] [PASSED] drm_test_drm_connector_dynamic_register_early_on_list [08:48:07] [PASSED] drm_test_drm_connector_dynamic_register_early_defer [08:48:07] [PASSED] drm_test_drm_connector_dynamic_register_early_no_init [08:48:07] [PASSED] drm_test_drm_connector_dynamic_register_early_no_mode_object [08:48:07] ====== [PASSED] drm_connector_dynamic_register_early ======= [08:48:07] ======= drm_connector_dynamic_register (7 subtests) ======== [08:48:07] [PASSED] drm_test_drm_connector_dynamic_register_on_list [08:48:07] [PASSED] drm_test_drm_connector_dynamic_register_no_defer [08:48:07] [PASSED] drm_test_drm_connector_dynamic_register_no_init [08:48:07] [PASSED] drm_test_drm_connector_dynamic_register_mode_object [08:48:07] [PASSED] drm_test_drm_connector_dynamic_register_sysfs [08:48:07] [PASSED] drm_test_drm_connector_dynamic_register_sysfs_name [08:48:07] [PASSED] drm_test_drm_connector_dynamic_register_debugfs [08:48:07] ========= [PASSED] drm_connector_dynamic_register ========== [08:48:07] = drm_connector_attach_broadcast_rgb_property (2 subtests) = [08:48:07] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property [08:48:07] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector [08:48:07] === [PASSED] drm_connector_attach_broadcast_rgb_property === [08:48:07] ========== drm_get_tv_mode_from_name (2 subtests) ========== [08:48:07] ========== drm_test_get_tv_mode_from_name_valid =========== [08:48:07] [PASSED] NTSC [08:48:07] [PASSED] NTSC-443 [08:48:07] [PASSED] NTSC-J [08:48:07] [PASSED] PAL [08:48:07] [PASSED] PAL-M [08:48:07] [PASSED] PAL-N [08:48:07] [PASSED] SECAM [08:48:07] [PASSED] Mono [08:48:07] ====== [PASSED] drm_test_get_tv_mode_from_name_valid ======= [08:48:07] [PASSED] drm_test_get_tv_mode_from_name_truncated [08:48:07] ============ [PASSED] drm_get_tv_mode_from_name ============ [08:48:07] = drm_test_connector_hdmi_compute_mode_clock (12 subtests) = [08:48:07] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb [08:48:07] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc [08:48:07] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1 [08:48:07] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc [08:48:07] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1 [08:48:07] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_double [08:48:07] = drm_test_connector_hdmi_compute_mode_clock_yuv420_valid = [08:48:07] [PASSED] VIC 96 [08:48:07] [PASSED] VIC 97 [08:48:07] [PASSED] VIC 101 [08:48:07] [PASSED] VIC 102 [08:48:07] [PASSED] VIC 106 [08:48:07] [PASSED] VIC 107 [08:48:07] === [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_valid === [08:48:07] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc [08:48:07] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc [08:48:07] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc [08:48:07] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc [08:48:07] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc [08:48:07] === [PASSED] drm_test_connector_hdmi_compute_mode_clock ==== [08:48:07] == drm_hdmi_connector_get_broadcast_rgb_name (2 subtests) == [08:48:07] === drm_test_drm_hdmi_connector_get_broadcast_rgb_name ==== [08:48:07] [PASSED] Automatic [08:48:07] [PASSED] Full [08:48:07] [PASSED] Limited 16:235 [08:48:07] === [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name === [08:48:07] [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name_invalid [08:48:07] ==== [PASSED] drm_hdmi_connector_get_broadcast_rgb_name ==== [08:48:07] == drm_hdmi_connector_get_output_format_name (2 subtests) == [08:48:07] === drm_test_drm_hdmi_connector_get_output_format_name ==== [08:48:07] [PASSED] RGB [08:48:07] [PASSED] YUV 4:2:0 [08:48:07] [PASSED] YUV 4:2:2 [08:48:07] [PASSED] YUV 4:4:4 [08:48:07] === [PASSED] drm_test_drm_hdmi_connector_get_output_format_name === [08:48:07] [PASSED] drm_test_drm_hdmi_connector_get_output_format_name_invalid [08:48:07] ==== [PASSED] drm_hdmi_connector_get_output_format_name ==== [08:48:07] ============= drm_damage_helper (21 subtests) ============== [08:48:07] [PASSED] drm_test_damage_iter_no_damage [08:48:07] [PASSED] drm_test_damage_iter_no_damage_fractional_src [08:48:07] [PASSED] drm_test_damage_iter_no_damage_src_moved [08:48:07] [PASSED] drm_test_damage_iter_no_damage_fractional_src_moved [08:48:07] [PASSED] drm_test_damage_iter_no_damage_not_visible [08:48:07] [PASSED] drm_test_damage_iter_no_damage_no_crtc [08:48:07] [PASSED] drm_test_damage_iter_no_damage_no_fb [08:48:07] [PASSED] drm_test_damage_iter_simple_damage [08:48:07] [PASSED] drm_test_damage_iter_single_damage [08:48:07] [PASSED] drm_test_damage_iter_single_damage_intersect_src [08:48:07] [PASSED] drm_test_damage_iter_single_damage_outside_src [08:48:07] [PASSED] drm_test_damage_iter_single_damage_fractional_src [08:48:07] [PASSED] drm_test_damage_iter_single_damage_intersect_fractional_src [08:48:07] [PASSED] drm_test_damage_iter_single_damage_outside_fractional_src [08:48:07] [PASSED] drm_test_damage_iter_single_damage_src_moved [08:48:07] [PASSED] drm_test_damage_iter_single_damage_fractional_src_moved [08:48:07] [PASSED] drm_test_damage_iter_damage [08:48:07] [PASSED] drm_test_damage_iter_damage_one_intersect [08:48:07] [PASSED] drm_test_damage_iter_damage_one_outside [08:48:07] [PASSED] drm_test_damage_iter_damage_src_moved [08:48:07] [PASSED] drm_test_damage_iter_damage_not_visible [08:48:07] ================ [PASSED] drm_damage_helper ================ [08:48:07] ============== drm_dp_mst_helper (3 subtests) ============== [08:48:07] ============== drm_test_dp_mst_calc_pbn_mode ============== [08:48:07] [PASSED] Clock 154000 BPP 30 DSC disabled [08:48:07] [PASSED] Clock 234000 BPP 30 DSC disabled [08:48:07] [PASSED] Clock 297000 BPP 24 DSC disabled [08:48:07] [PASSED] Clock 332880 BPP 24 DSC enabled [08:48:07] [PASSED] Clock 324540 BPP 24 DSC enabled [08:48:07] ========== [PASSED] drm_test_dp_mst_calc_pbn_mode ========== [08:48:07] ============== drm_test_dp_mst_calc_pbn_div =============== [08:48:07] [PASSED] Link rate 2000000 lane count 4 [08:48:07] [PASSED] Link rate 2000000 lane count 2 [08:48:07] [PASSED] Link rate 2000000 lane count 1 [08:48:07] [PASSED] Link rate 1350000 lane count 4 [08:48:07] [PASSED] Link rate 1350000 lane count 2 [08:48:07] [PASSED] Link rate 1350000 lane count 1 [08:48:07] [PASSED] Link rate 1000000 lane count 4 [08:48:07] [PASSED] Link rate 1000000 lane count 2 [08:48:07] [PASSED] Link rate 1000000 lane count 1 [08:48:07] [PASSED] Link rate 810000 lane count 4 [08:48:07] [PASSED] Link rate 810000 lane count 2 [08:48:07] [PASSED] Link rate 810000 lane count 1 [08:48:07] [PASSED] Link rate 540000 lane count 4 [08:48:07] [PASSED] Link rate 540000 lane count 2 [08:48:07] [PASSED] Link rate 540000 lane count 1 [08:48:07] [PASSED] Link rate 270000 lane count 4 [08:48:07] [PASSED] Link rate 270000 lane count 2 [08:48:07] [PASSED] Link rate 270000 lane count 1 [08:48:07] [PASSED] Link rate 162000 lane count 4 [08:48:07] [PASSED] Link rate 162000 lane count 2 [08:48:07] [PASSED] Link rate 162000 lane count 1 [08:48:07] ========== [PASSED] drm_test_dp_mst_calc_pbn_div =========== [08:48:07] ========= drm_test_dp_mst_sideband_msg_req_decode ========= [08:48:07] [PASSED] DP_ENUM_PATH_RESOURCES with port number [08:48:07] [PASSED] DP_POWER_UP_PHY with port number [08:48:07] [PASSED] DP_POWER_DOWN_PHY with port number [08:48:07] [PASSED] DP_ALLOCATE_PAYLOAD with SDP stream sinks [08:48:07] [PASSED] DP_ALLOCATE_PAYLOAD with port number [08:48:07] [PASSED] DP_ALLOCATE_PAYLOAD with VCPI [08:48:07] [PASSED] DP_ALLOCATE_PAYLOAD with PBN [08:48:07] [PASSED] DP_QUERY_PAYLOAD with port number [08:48:07] [PASSED] DP_QUERY_PAYLOAD with VCPI [08:48:07] [PASSED] DP_REMOTE_DPCD_READ with port number [08:48:07] [PASSED] DP_REMOTE_DPCD_READ with DPCD address [08:48:07] [PASSED] DP_REMOTE_DPCD_READ with max number of bytes [08:48:07] [PASSED] DP_REMOTE_DPCD_WRITE with port number [08:48:07] [PASSED] DP_REMOTE_DPCD_WRITE with DPCD address [08:48:07] [PASSED] DP_REMOTE_DPCD_WRITE with data array [08:48:07] [PASSED] DP_REMOTE_I2C_READ with port number [08:48:07] [PASSED] DP_REMOTE_I2C_READ with I2C device ID [08:48:07] [PASSED] DP_REMOTE_I2C_READ with transactions array [08:48:07] [PASSED] DP_REMOTE_I2C_WRITE with port number [08:48:07] [PASSED] DP_REMOTE_I2C_WRITE with I2C device ID [08:48:07] [PASSED] DP_REMOTE_I2C_WRITE with data array [08:48:07] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream ID [08:48:07] [PASSED] DP_QUERY_STREAM_ENC_STATUS with client ID [08:48:07] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream event [08:48:07] [PASSED] DP_QUERY_STREAM_ENC_STATUS with valid stream event [08:48:07] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream behavior [08:48:07] [PASSED] DP_QUERY_STREAM_ENC_STATUS with a valid stream behavior [08:48:07] ===== [PASSED] drm_test_dp_mst_sideband_msg_req_decode ===== [08:48:07] ================ [PASSED] drm_dp_mst_helper ================ [08:48:07] ================== drm_exec (7 subtests) =================== [08:48:07] [PASSED] sanitycheck [08:48:07] [PASSED] test_lock [08:48:07] [PASSED] test_lock_unlock [08:48:07] [PASSED] test_duplicates [08:48:07] [PASSED] test_prepare [08:48:07] [PASSED] test_prepare_array [08:48:07] [PASSED] test_multiple_loops [08:48:07] ==================== [PASSED] drm_exec ===================== [08:48:07] =========== drm_format_helper_test (17 subtests) =========== [08:48:07] ============== drm_test_fb_xrgb8888_to_gray8 ============== [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ========== [PASSED] drm_test_fb_xrgb8888_to_gray8 ========== [08:48:07] ============= drm_test_fb_xrgb8888_to_rgb332 ============== [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb332 ========== [08:48:07] ============= drm_test_fb_xrgb8888_to_rgb565 ============== [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb565 ========== [08:48:07] ============ drm_test_fb_xrgb8888_to_xrgb1555 ============= [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ======== [PASSED] drm_test_fb_xrgb8888_to_xrgb1555 ========= [08:48:07] ============ drm_test_fb_xrgb8888_to_argb1555 ============= [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ======== [PASSED] drm_test_fb_xrgb8888_to_argb1555 ========= [08:48:07] ============ drm_test_fb_xrgb8888_to_rgba5551 ============= [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ======== [PASSED] drm_test_fb_xrgb8888_to_rgba5551 ========= [08:48:07] ============= drm_test_fb_xrgb8888_to_rgb888 ============== [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb888 ========== [08:48:07] ============= drm_test_fb_xrgb8888_to_bgr888 ============== [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ========= [PASSED] drm_test_fb_xrgb8888_to_bgr888 ========== [08:48:07] ============ drm_test_fb_xrgb8888_to_argb8888 ============= [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ======== [PASSED] drm_test_fb_xrgb8888_to_argb8888 ========= [08:48:07] =========== drm_test_fb_xrgb8888_to_xrgb2101010 =========== [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ======= [PASSED] drm_test_fb_xrgb8888_to_xrgb2101010 ======= [08:48:07] =========== drm_test_fb_xrgb8888_to_argb2101010 =========== [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ======= [PASSED] drm_test_fb_xrgb8888_to_argb2101010 ======= [08:48:07] ============== drm_test_fb_xrgb8888_to_mono =============== [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ========== [PASSED] drm_test_fb_xrgb8888_to_mono =========== [08:48:07] ==================== drm_test_fb_swab ===================== [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ================ [PASSED] drm_test_fb_swab ================= [08:48:07] ============ drm_test_fb_xrgb8888_to_xbgr8888 ============= [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ======== [PASSED] drm_test_fb_xrgb8888_to_xbgr8888 ========= [08:48:07] ============ drm_test_fb_xrgb8888_to_abgr8888 ============= [08:48:07] [PASSED] single_pixel_source_buffer [08:48:07] [PASSED] single_pixel_clip_rectangle [08:48:07] [PASSED] well_known_colors [08:48:07] [PASSED] destination_pitch [08:48:07] ======== [PASSED] drm_test_fb_xrgb8888_to_abgr8888 ========= [08:48:07] ================= drm_test_fb_clip_offset ================= [08:48:07] [PASSED] pass through [08:48:07] [PASSED] horizontal offset [08:48:07] [PASSED] vertical offset [08:48:07] [PASSED] horizontal and vertical offset [08:48:07] [PASSED] horizontal offset (custom pitch) [08:48:07] [PASSED] vertical offset (custom pitch) [08:48:07] [PASSED] horizontal and vertical offset (custom pitch) [08:48:07] ============= [PASSED] drm_test_fb_clip_offset ============= [08:48:07] =================== drm_test_fb_memcpy ==================== [08:48:07] [PASSED] single_pixel_source_buffer: XR24 little-endian (0x34325258) [08:48:07] [PASSED] single_pixel_source_buffer: XRA8 little-endian (0x38415258) [08:48:07] [PASSED] single_pixel_source_buffer: YU24 little-endian (0x34325559) [08:48:07] [PASSED] single_pixel_clip_rectangle: XB24 little-endian (0x34324258) [08:48:07] [PASSED] single_pixel_clip_rectangle: XRA8 little-endian (0x38415258) [08:48:07] [PASSED] single_pixel_clip_rectangle: YU24 little-endian (0x34325559) [08:48:07] [PASSED] well_known_colors: XB24 little-endian (0x34324258) [08:48:07] [PASSED] well_known_colors: XRA8 little-endian (0x38415258) [08:48:07] [PASSED] well_known_colors: YU24 little-endian (0x34325559) [08:48:07] [PASSED] destination_pitch: XB24 little-endian (0x34324258) [08:48:07] [PASSED] destination_pitch: XRA8 little-endian (0x38415258) [08:48:07] [PASSED] destination_pitch: YU24 little-endian (0x34325559) [08:48:07] =============== [PASSED] drm_test_fb_memcpy ================ [08:48:07] ============= [PASSED] drm_format_helper_test ============== [08:48:07] ================= drm_format (18 subtests) ================= [08:48:07] [PASSED] drm_test_format_block_width_invalid [08:48:07] [PASSED] drm_test_format_block_width_one_plane [08:48:07] [PASSED] drm_test_format_block_width_two_plane [08:48:07] [PASSED] drm_test_format_block_width_three_plane [08:48:07] [PASSED] drm_test_format_block_width_tiled [08:48:07] [PASSED] drm_test_format_block_height_invalid [08:48:07] [PASSED] drm_test_format_block_height_one_plane [08:48:07] [PASSED] drm_test_format_block_height_two_plane [08:48:07] [PASSED] drm_test_format_block_height_three_plane [08:48:07] [PASSED] drm_test_format_block_height_tiled [08:48:07] [PASSED] drm_test_format_min_pitch_invalid [08:48:07] [PASSED] drm_test_format_min_pitch_one_plane_8bpp [08:48:07] [PASSED] drm_test_format_min_pitch_one_plane_16bpp [08:48:07] [PASSED] drm_test_format_min_pitch_one_plane_24bpp [08:48:07] [PASSED] drm_test_format_min_pitch_one_plane_32bpp [08:48:07] [PASSED] drm_test_format_min_pitch_two_plane [08:48:07] [PASSED] drm_test_format_min_pitch_three_plane_8bpp [08:48:07] [PASSED] drm_test_format_min_pitch_tiled [08:48:07] =================== [PASSED] drm_format ==================== [08:48:07] ============== drm_framebuffer (10 subtests) =============== [08:48:07] ========== drm_test_framebuffer_check_src_coords ========== [08:48:07] [PASSED] Success: source fits into fb [08:48:07] [PASSED] Fail: overflowing fb with x-axis coordinate [08:48:07] [PASSED] Fail: overflowing fb with y-axis coordinate [08:48:07] [PASSED] Fail: overflowing fb with source width [08:48:07] [PASSED] Fail: overflowing fb with source height [08:48:07] ====== [PASSED] drm_test_framebuffer_check_src_coords ====== [08:48:07] [PASSED] drm_test_framebuffer_cleanup [08:48:07] =============== drm_test_framebuffer_create =============== [08:48:07] [PASSED] ABGR8888 normal sizes [08:48:07] [PASSED] ABGR8888 max sizes [08:48:07] [PASSED] ABGR8888 pitch greater than min required [08:48:07] [PASSED] ABGR8888 pitch less than min required [08:48:07] [PASSED] ABGR8888 Invalid width [08:48:07] [PASSED] ABGR8888 Invalid buffer handle [08:48:07] [PASSED] No pixel format [08:48:07] [PASSED] ABGR8888 Width 0 [08:48:07] [PASSED] ABGR8888 Height 0 [08:48:07] [PASSED] ABGR8888 Out of bound height * pitch combination [08:48:07] [PASSED] ABGR8888 Large buffer offset [08:48:07] [PASSED] ABGR8888 Buffer offset for inexistent plane [08:48:07] [PASSED] ABGR8888 Invalid flag [08:48:07] [PASSED] ABGR8888 Set DRM_MODE_FB_MODIFIERS without modifiers [08:48:07] [PASSED] ABGR8888 Valid buffer modifier [08:48:07] [PASSED] ABGR8888 Invalid buffer modifier(DRM_FORMAT_MOD_SAMSUNG_64_32_TILE) [08:48:07] [PASSED] ABGR8888 Extra pitches without DRM_MODE_FB_MODIFIERS [08:48:07] [PASSED] ABGR8888 Extra pitches with DRM_MODE_FB_MODIFIERS [08:48:07] [PASSED] NV12 Normal sizes [08:48:07] [PASSED] NV12 Max sizes [08:48:07] [PASSED] NV12 Invalid pitch [08:48:07] [PASSED] NV12 Invalid modifier/missing DRM_MODE_FB_MODIFIERS flag [08:48:07] [PASSED] NV12 different modifier per-plane [08:48:07] [PASSED] NV12 with DRM_FORMAT_MOD_SAMSUNG_64_32_TILE [08:48:07] [PASSED] NV12 Valid modifiers without DRM_MODE_FB_MODIFIERS [08:48:07] [PASSED] NV12 Modifier for inexistent plane [08:48:07] [PASSED] NV12 Handle for inexistent plane [08:48:07] [PASSED] NV12 Handle for inexistent plane without DRM_MODE_FB_MODIFIERS [08:48:07] [PASSED] YVU420 DRM_MODE_FB_MODIFIERS set without modifier [08:48:07] [PASSED] YVU420 Normal sizes [08:48:07] [PASSED] YVU420 Max sizes [08:48:07] [PASSED] YVU420 Invalid pitch [08:48:07] [PASSED] YVU420 Different pitches [08:48:07] [PASSED] YVU420 Different buffer offsets/pitches [08:48:07] [PASSED] YVU420 Modifier set just for plane 0, without DRM_MODE_FB_MODIFIERS [08:48:07] [PASSED] YVU420 Modifier set just for planes 0, 1, without DRM_MODE_FB_MODIFIERS [08:48:07] [PASSED] YVU420 Modifier set just for plane 0, 1, with DRM_MODE_FB_MODIFIERS [08:48:07] [PASSED] YVU420 Valid modifier [08:48:07] [PASSED] YVU420 Different modifiers per plane [08:48:07] [PASSED] YVU420 Modifier for inexistent plane [08:48:07] [PASSED] YUV420_10BIT Invalid modifier(DRM_FORMAT_MOD_LINEAR) [08:48:07] [PASSED] X0L2 Normal sizes [08:48:07] [PASSED] X0L2 Max sizes [08:48:07] [PASSED] X0L2 Invalid pitch [08:48:07] [PASSED] X0L2 Pitch greater than minimum required [08:48:07] [PASSED] X0L2 Handle for inexistent plane [08:48:07] [PASSED] X0L2 Offset for inexistent plane, without DRM_MODE_FB_MODIFIERS set [08:48:07] [PASSED] X0L2 Modifier without DRM_MODE_FB_MODIFIERS set [08:48:07] [PASSED] X0L2 Valid modifier [08:48:07] [PASSED] X0L2 Modifier for inexistent plane [08:48:07] =========== [PASSED] drm_test_framebuffer_create =========== [08:48:07] [PASSED] drm_test_framebuffer_free [08:48:07] [PASSED] drm_test_framebuffer_init [08:48:07] [PASSED] drm_test_framebuffer_init_bad_format [08:48:07] [PASSED] drm_test_framebuffer_init_dev_mismatch [08:48:07] [PASSED] drm_test_framebuffer_lookup [08:48:07] [PASSED] drm_test_framebuffer_lookup_inexistent [08:48:07] [PASSED] drm_test_framebuffer_modifiers_not_supported [08:48:07] ================= [PASSED] drm_framebuffer ================= [08:48:07] ================ drm_gem_shmem (8 subtests) ================ [08:48:07] [PASSED] drm_gem_shmem_test_obj_create [08:48:07] [PASSED] drm_gem_shmem_test_obj_create_private [08:48:07] [PASSED] drm_gem_shmem_test_pin_pages [08:48:07] [PASSED] drm_gem_shmem_test_vmap [08:48:07] [PASSED] drm_gem_shmem_test_get_sg_table [08:48:07] [PASSED] drm_gem_shmem_test_get_pages_sgt [08:48:07] [PASSED] drm_gem_shmem_test_madvise [08:48:07] [PASSED] drm_gem_shmem_test_purge [08:48:07] ================== [PASSED] drm_gem_shmem ================== [08:48:07] === drm_atomic_helper_connector_hdmi_check (29 subtests) === [08:48:07] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode [08:48:07] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode_vic_1 [08:48:07] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode [08:48:07] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode_vic_1 [08:48:07] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode [08:48:07] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode_vic_1 [08:48:07] ====== drm_test_check_broadcast_rgb_cea_mode_yuv420 ======= [08:48:07] [PASSED] Automatic [08:48:07] [PASSED] Full [08:48:07] [PASSED] Limited 16:235 [08:48:07] == [PASSED] drm_test_check_broadcast_rgb_cea_mode_yuv420 === [08:48:07] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_changed [08:48:07] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_not_changed [08:48:07] [PASSED] drm_test_check_disable_connector [08:48:07] [PASSED] drm_test_check_hdmi_funcs_reject_rate [08:48:07] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_rgb [08:48:07] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_yuv420 [08:48:07] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422 [08:48:07] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420 [08:48:07] [PASSED] drm_test_check_driver_unsupported_fallback_yuv420 [08:48:07] [PASSED] drm_test_check_output_bpc_crtc_mode_changed [08:48:07] [PASSED] drm_test_check_output_bpc_crtc_mode_not_changed [08:48:07] [PASSED] drm_test_check_output_bpc_dvi [08:48:07] [PASSED] drm_test_check_output_bpc_format_vic_1 [08:48:07] [PASSED] drm_test_check_output_bpc_format_display_8bpc_only [08:48:07] [PASSED] drm_test_check_output_bpc_format_display_rgb_only [08:48:07] [PASSED] drm_test_check_output_bpc_format_driver_8bpc_only [08:48:07] [PASSED] drm_test_check_output_bpc_format_driver_rgb_only [08:48:07] [PASSED] drm_test_check_tmds_char_rate_rgb_8bpc [08:48:07] [PASSED] drm_test_check_tmds_char_rate_rgb_10bpc [08:48:07] [PASSED] drm_test_check_tmds_char_rate_rgb_12bpc [08:48:07] ============ drm_test_check_hdmi_color_format ============= [08:48:07] [PASSED] AUTO -> RGB [08:48:07] [PASSED] YCBCR422 -> YUV422 [08:48:07] [PASSED] YCBCR420 -> YUV420 [08:48:07] [PASSED] YCBCR444 -> YUV444 [08:48:07] [PASSED] RGB -> RGB [08:48:07] ======== [PASSED] drm_test_check_hdmi_color_format ========= [08:48:07] ======== drm_test_check_hdmi_color_format_420_only ======== [08:48:07] [PASSED] RGB should fail [08:48:07] [PASSED] YUV444 should fail [08:48:07] [PASSED] YUV422 should fail [08:48:07] [PASSED] YUV420 should work [08:48:07] ==== [PASSED] drm_test_check_hdmi_color_format_420_only ==== [08:48:07] ===== [PASSED] drm_atomic_helper_connector_hdmi_check ====== [08:48:07] === drm_atomic_helper_connector_hdmi_reset (6 subtests) ==== [08:48:07] [PASSED] drm_test_check_broadcast_rgb_value [08:48:07] [PASSED] drm_test_check_bpc_8_value [08:48:07] [PASSED] drm_test_check_bpc_10_value [08:48:07] [PASSED] drm_test_check_bpc_12_value [08:48:07] [PASSED] drm_test_check_format_value [08:48:07] [PASSED] drm_test_check_tmds_char_value [08:48:07] ===== [PASSED] drm_atomic_helper_connector_hdmi_reset ====== [08:48:07] = drm_atomic_helper_connector_hdmi_mode_valid (7 subtests) = [08:48:07] [PASSED] drm_test_check_mode_valid [08:48:07] [PASSED] drm_test_check_mode_valid_reject [08:48:07] [PASSED] drm_test_check_mode_valid_reject_rate [08:48:07] [PASSED] drm_test_check_mode_valid_reject_max_clock [08:48:07] [PASSED] drm_test_check_mode_valid_yuv420_only_max_clock [08:48:07] [PASSED] drm_test_check_mode_valid_reject_yuv420_only_connector [08:48:07] [PASSED] drm_test_check_mode_valid_accept_yuv420_also_connector_rgb [08:48:07] === [PASSED] drm_atomic_helper_connector_hdmi_mode_valid === [08:48:07] = drm_atomic_helper_connector_hdmi_infoframes (5 subtests) = [08:48:07] [PASSED] drm_test_check_infoframes [08:48:07] [PASSED] drm_test_check_reject_avi_infoframe [08:48:07] [PASSED] drm_test_check_reject_hdr_infoframe_bpc_8 [08:48:07] [PASSED] drm_test_check_reject_hdr_infoframe_bpc_10 [08:48:07] [PASSED] drm_test_check_reject_audio_infoframe [08:48:07] === [PASSED] drm_atomic_helper_connector_hdmi_infoframes === [08:48:07] ================= drm_managed (2 subtests) ================= [08:48:07] [PASSED] drm_test_managed_release_action [08:48:07] [PASSED] drm_test_managed_run_action [08:48:07] =================== [PASSED] drm_managed =================== [08:48:07] =================== drm_mm (6 subtests) ==================== [08:48:07] [PASSED] drm_test_mm_init [08:48:07] [PASSED] drm_test_mm_debug [08:48:07] [PASSED] drm_test_mm_align32 [08:48:07] [PASSED] drm_test_mm_align64 [08:48:07] [PASSED] drm_test_mm_lowest [08:48:07] [PASSED] drm_test_mm_highest [08:48:07] ===================== [PASSED] drm_mm ====================== [08:48:07] ============= drm_modes_analog_tv (5 subtests) ============= [08:48:07] [PASSED] drm_test_modes_analog_tv_mono_576i [08:48:07] [PASSED] drm_test_modes_analog_tv_ntsc_480i [08:48:07] [PASSED] drm_test_modes_analog_tv_ntsc_480i_inlined [08:48:07] [PASSED] drm_test_modes_analog_tv_pal_576i [08:48:07] [PASSED] drm_test_modes_analog_tv_pal_576i_inlined [08:48:07] =============== [PASSED] drm_modes_analog_tv =============== [08:48:07] ============== drm_panic_helper (3 subtests) =============== [08:48:07] ============= drm_test_panic_screen_user_map ============== [08:48:07] [PASSED] Panic screen user, mode: 1024 x 768 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen user, mode: 494 x 494 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen user, mode: 1920 x 1080 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen user, mode: 1024 x 768 RG16 little-endian (0x36314752) [08:48:07] [PASSED] Panic screen user, mode: 1024 x 768 RG24 little-endian (0x34324752) [08:48:07] [PASSED] Panic screen kmsg, mode: 1024 x 768 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen kmsg, mode: 494 x 494 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen kmsg, mode: 1920 x 1080 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen kmsg, mode: 1024 x 768 RG16 little-endian (0x36314752) [08:48:07] [PASSED] Panic screen kmsg, mode: 1024 x 768 RG24 little-endian (0x34324752) [08:48:07] ========= [PASSED] drm_test_panic_screen_user_map ========== [08:48:07] ============= drm_test_panic_screen_user_page ============= [08:48:07] [PASSED] Panic screen user, mode: 1024 x 768 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen user, mode: 494 x 494 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen user, mode: 1920 x 1080 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen user, mode: 1024 x 768 RG16 little-endian (0x36314752) [08:48:07] [PASSED] Panic screen user, mode: 1024 x 768 RG24 little-endian (0x34324752) [08:48:07] [PASSED] Panic screen kmsg, mode: 1024 x 768 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen kmsg, mode: 494 x 494 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen kmsg, mode: 1920 x 1080 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen kmsg, mode: 1024 x 768 RG16 little-endian (0x36314752) [08:48:07] [PASSED] Panic screen kmsg, mode: 1024 x 768 RG24 little-endian (0x34324752) [08:48:07] ========= [PASSED] drm_test_panic_screen_user_page ========= [08:48:07] ========== drm_test_panic_screen_user_set_pixel =========== [08:48:07] [PASSED] Panic screen user, mode: 1024 x 768 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen user, mode: 494 x 494 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen user, mode: 1920 x 1080 XR24 little-endian (0x34325258) [08:48:07] [PASSED] Panic screen user, mode: 1024 x 768 RG16 little-endian (0x36314752) [08:48:07] [PASSED] Panic screen user, mode: 1024 x 768 RG24 little-endian (0x34324752) [08:48:07] [PASSED] Panic screen kmsg, mode: 1024 x 768 XR24 little-endian (0x34325258) [08:48:08] [PASSED] Panic screen kmsg, mode: 494 x 494 XR24 little-endian (0x34325258) [08:48:08] [PASSED] Panic screen kmsg, mode: 1920 x 1080 XR24 little-endian (0x34325258) [08:48:08] [PASSED] Panic screen kmsg, mode: 1024 x 768 RG16 little-endian (0x36314752) [08:48:08] [PASSED] Panic screen kmsg, mode: 1024 x 768 RG24 little-endian (0x34324752) [08:48:08] ====== [PASSED] drm_test_panic_screen_user_set_pixel ======= [08:48:08] ================ [PASSED] drm_panic_helper ================= [08:48:08] ============== drm_plane_helper (2 subtests) =============== [08:48:08] =============== drm_test_check_plane_state ================ [08:48:08] [PASSED] clipping_simple [08:48:08] [PASSED] clipping_rotate_reflect [08:48:08] [PASSED] positioning_simple [08:48:08] [PASSED] upscaling [08:48:08] [PASSED] downscaling [08:48:08] [PASSED] rounding1 [08:48:08] [PASSED] rounding2 [08:48:08] [PASSED] rounding3 [08:48:08] [PASSED] rounding4 [08:48:08] =========== [PASSED] drm_test_check_plane_state ============ [08:48:08] =========== drm_test_check_invalid_plane_state ============ [08:48:08] [PASSED] positioning_invalid [08:48:08] [PASSED] upscaling_invalid [08:48:08] [PASSED] downscaling_invalid [08:48:08] ======= [PASSED] drm_test_check_invalid_plane_state ======== [08:48:08] ================ [PASSED] drm_plane_helper ================= [08:48:08] ====== drm_connector_helper_tv_get_modes (1 subtest) ======= [08:48:08] ====== drm_test_connector_helper_tv_get_modes_check ======= [08:48:08] [PASSED] None [08:48:08] [PASSED] PAL [08:48:08] [PASSED] NTSC [08:48:08] [PASSED] Both, NTSC Default [08:48:08] [PASSED] Both, PAL Default [08:48:08] [PASSED] Both, NTSC Default, with PAL on command-line [08:48:08] [PASSED] Both, PAL Default, with NTSC on command-line [08:48:08] == [PASSED] drm_test_connector_helper_tv_get_modes_check === [08:48:08] ======== [PASSED] drm_connector_helper_tv_get_modes ======== [08:48:08] ================== drm_rect (9 subtests) =================== [08:48:08] [PASSED] drm_test_rect_clip_scaled_div_by_zero [08:48:08] [PASSED] drm_test_rect_clip_scaled_not_clipped [08:48:08] [PASSED] drm_test_rect_clip_scaled_clipped [08:48:08] [PASSED] drm_test_rect_clip_scaled_signed_vs_unsigned [08:48:08] ================= drm_test_rect_intersect ================= [08:48:08] [PASSED] top-left x bottom-right: 2x2+1+1 x 2x2+0+0 [08:48:08] [PASSED] top-right x bottom-left: 2x2+0+0 x 2x2+1-1 [08:48:08] [PASSED] bottom-left x top-right: 2x2+1-1 x 2x2+0+0 [08:48:08] [PASSED] bottom-right x top-left: 2x2+0+0 x 2x2+1+1 [08:48:08] [PASSED] right x left: 2x1+0+0 x 3x1+1+0 [08:48:08] [PASSED] left x right: 3x1+1+0 x 2x1+0+0 [08:48:08] [PASSED] up x bottom: 1x2+0+0 x 1x3+0-1 [08:48:08] [PASSED] bottom x up: 1x3+0-1 x 1x2+0+0 [08:48:08] [PASSED] touching corner: 1x1+0+0 x 2x2+1+1 [08:48:08] [PASSED] touching side: 1x1+0+0 x 1x1+1+0 [08:48:08] [PASSED] equal rects: 2x2+0+0 x 2x2+0+0 [08:48:08] [PASSED] inside another: 2x2+0+0 x 1x1+1+1 [08:48:08] [PASSED] far away: 1x1+0+0 x 1x1+3+6 [08:48:08] [PASSED] points intersecting: 0x0+5+10 x 0x0+5+10 [08:48:08] [PASSED] points not intersecting: 0x0+0+0 x 0x0+5+10 [08:48:08] ============= [PASSED] drm_test_rect_intersect ============= [08:48:08] ================ drm_test_rect_calc_hscale ================ [08:48:08] [PASSED] normal use [08:48:08] [PASSED] out of max range [08:48:08] [PASSED] out of min range [08:48:08] [PASSED] zero dst [08:48:08] [PASSED] negative src [08:48:08] [PASSED] negative dst [08:48:08] ============ [PASSED] drm_test_rect_calc_hscale ============ [08:48:08] ================ drm_test_rect_calc_vscale ================ [08:48:08] [PASSED] normal use [08:48:08] [PASSED] out of max range [08:48:08] [PASSED] out of min range [08:48:08] [PASSED] zero dst [08:48:08] [PASSED] negative src [08:48:08] [PASSED] negative dst [08:48:08] ============ [PASSED] drm_test_rect_calc_vscale ============ [08:48:08] ================== drm_test_rect_rotate =================== [08:48:08] [PASSED] reflect-x [08:48:08] [PASSED] reflect-y [08:48:08] [PASSED] rotate-0 [08:48:08] [PASSED] rotate-90 [08:48:08] [PASSED] rotate-180 [08:48:08] [PASSED] rotate-270 [08:48:08] ============== [PASSED] drm_test_rect_rotate =============== [08:48:08] ================ drm_test_rect_rotate_inv ================= [08:48:08] [PASSED] reflect-x [08:48:08] [PASSED] reflect-y [08:48:08] [PASSED] rotate-0 [08:48:08] [PASSED] rotate-90 [08:48:08] [PASSED] rotate-180 [08:48:08] [PASSED] rotate-270 [08:48:08] ============ [PASSED] drm_test_rect_rotate_inv ============= [08:48:08] ==================== [PASSED] drm_rect ===================== [08:48:08] ============ drm_sysfb_modeset_test (1 subtest) ============ [08:48:08] ============ drm_test_sysfb_build_fourcc_list ============= [08:48:08] [PASSED] no native formats [08:48:08] [PASSED] XRGB8888 as native format [08:48:08] [PASSED] remove duplicates [08:48:08] [PASSED] convert alpha formats [08:48:08] [PASSED] random formats [08:48:08] ======== [PASSED] drm_test_sysfb_build_fourcc_list ========= [08:48:08] ============= [PASSED] drm_sysfb_modeset_test ============== [08:48:08] ================== drm_fixp (2 subtests) =================== [08:48:08] [PASSED] drm_test_int2fixp [08:48:08] [PASSED] drm_test_sm2fixp [08:48:08] ==================== [PASSED] drm_fixp ===================== [08:48:08] ============================================================ [08:48:08] Testing complete. Ran 667 tests: passed: 667 [08:48:08] Elapsed time: 28.172s total, 2.569s configuring, 25.187s building, 0.409s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig [08:48:08] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [08:48:10] 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 [08:48:20] Starting KUnit Kernel (1/1)... [08:48:20] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [08:48:20] ================= ttm_device (5 subtests) ================== [08:48:20] [PASSED] ttm_device_init_basic [08:48:20] [PASSED] ttm_device_init_multiple [08:48:20] [PASSED] ttm_device_fini_basic [08:48:20] [PASSED] ttm_device_init_no_vma_man [08:48:20] ================== ttm_device_init_pools ================== [08:48:20] [PASSED] No DMA allocations, no DMA32 required [08:48:20] [PASSED] DMA allocations, DMA32 required [08:48:20] [PASSED] No DMA allocations, DMA32 required [08:48:20] [PASSED] DMA allocations, no DMA32 required [08:48:20] ============== [PASSED] ttm_device_init_pools ============== [08:48:20] =================== [PASSED] ttm_device ==================== [08:48:20] ================== ttm_pool (8 subtests) =================== [08:48:20] ================== ttm_pool_alloc_basic =================== [08:48:20] [PASSED] One page [08:48:20] [PASSED] More than one page [08:48:20] [PASSED] Above the allocation limit [08:48:20] [PASSED] One page, with coherent DMA mappings enabled [08:48:20] [PASSED] Above the allocation limit, with coherent DMA mappings enabled [08:48:20] ============== [PASSED] ttm_pool_alloc_basic =============== [08:48:20] ============== ttm_pool_alloc_basic_dma_addr ============== [08:48:20] [PASSED] One page [08:48:20] [PASSED] More than one page [08:48:20] [PASSED] Above the allocation limit [08:48:20] [PASSED] One page, with coherent DMA mappings enabled [08:48:20] [PASSED] Above the allocation limit, with coherent DMA mappings enabled [08:48:20] ========== [PASSED] ttm_pool_alloc_basic_dma_addr ========== [08:48:20] [PASSED] ttm_pool_alloc_order_caching_match [08:48:20] [PASSED] ttm_pool_alloc_caching_mismatch [08:48:20] [PASSED] ttm_pool_alloc_order_mismatch [08:48:20] [PASSED] ttm_pool_free_dma_alloc [08:48:20] [PASSED] ttm_pool_free_no_dma_alloc [08:48:20] [PASSED] ttm_pool_fini_basic [08:48:20] ==================== [PASSED] ttm_pool ===================== [08:48:20] ================ ttm_resource (8 subtests) ================= [08:48:20] ================= ttm_resource_init_basic ================= [08:48:20] [PASSED] Init resource in TTM_PL_SYSTEM [08:48:20] [PASSED] Init resource in TTM_PL_VRAM [08:48:20] [PASSED] Init resource in a private placement [08:48:20] [PASSED] Init resource in TTM_PL_SYSTEM, set placement flags [08:48:20] ============= [PASSED] ttm_resource_init_basic ============= [08:48:20] [PASSED] ttm_resource_init_pinned [08:48:20] [PASSED] ttm_resource_fini_basic [08:48:20] [PASSED] ttm_resource_manager_init_basic [08:48:20] [PASSED] ttm_resource_manager_usage_basic [08:48:20] [PASSED] ttm_resource_manager_set_used_basic [08:48:20] [PASSED] ttm_sys_man_alloc_basic [08:48:20] [PASSED] ttm_sys_man_free_basic [08:48:20] ================== [PASSED] ttm_resource =================== [08:48:20] =================== ttm_tt (15 subtests) =================== [08:48:20] ==================== ttm_tt_init_basic ==================== [08:48:20] [PASSED] Page-aligned size [08:48:20] [PASSED] Extra pages requested [08:48:20] ================ [PASSED] ttm_tt_init_basic ================ [08:48:20] [PASSED] ttm_tt_init_misaligned [08:48:20] [PASSED] ttm_tt_fini_basic [08:48:20] [PASSED] ttm_tt_fini_sg [08:48:20] [PASSED] ttm_tt_fini_shmem [08:48:20] [PASSED] ttm_tt_create_basic [08:48:20] [PASSED] ttm_tt_create_invalid_bo_type [08:48:20] [PASSED] ttm_tt_create_ttm_exists [08:48:20] [PASSED] ttm_tt_create_failed [08:48:20] [PASSED] ttm_tt_destroy_basic [08:48:20] [PASSED] ttm_tt_populate_null_ttm [08:48:20] [PASSED] ttm_tt_populate_populated_ttm [08:48:20] [PASSED] ttm_tt_unpopulate_basic [08:48:20] [PASSED] ttm_tt_unpopulate_empty_ttm [08:48:20] [PASSED] ttm_tt_swapin_basic [08:48:20] ===================== [PASSED] ttm_tt ====================== [08:48:20] =================== ttm_bo (14 subtests) =================== [08:48:20] =========== ttm_bo_reserve_optimistic_no_ticket =========== [08:48:20] [PASSED] Cannot be interrupted and sleeps [08:48:20] [PASSED] Cannot be interrupted, locks straight away [08:48:20] [PASSED] Can be interrupted, sleeps [08:48:20] ======= [PASSED] ttm_bo_reserve_optimistic_no_ticket ======= [08:48:20] [PASSED] ttm_bo_reserve_locked_no_sleep [08:48:20] [PASSED] ttm_bo_reserve_no_wait_ticket [08:48:20] [PASSED] ttm_bo_reserve_double_resv [08:48:20] [PASSED] ttm_bo_reserve_interrupted [08:48:20] [PASSED] ttm_bo_reserve_deadlock [08:48:20] [PASSED] ttm_bo_unreserve_basic [08:48:20] [PASSED] ttm_bo_unreserve_pinned [08:48:20] [PASSED] ttm_bo_unreserve_bulk [08:48:20] [PASSED] ttm_bo_fini_basic [08:48:20] [PASSED] ttm_bo_fini_shared_resv [08:48:20] [PASSED] ttm_bo_pin_basic [08:48:20] [PASSED] ttm_bo_pin_unpin_resource [08:48:20] [PASSED] ttm_bo_multiple_pin_one_unpin [08:48:20] ===================== [PASSED] ttm_bo ====================== [08:48:20] ============== ttm_bo_validate (22 subtests) =============== [08:48:20] ============== ttm_bo_init_reserved_sys_man =============== [08:48:20] [PASSED] Buffer object for userspace [08:48:20] [PASSED] Kernel buffer object [08:48:20] [PASSED] Shared buffer object [08:48:20] ========== [PASSED] ttm_bo_init_reserved_sys_man =========== [08:48:20] ============== ttm_bo_init_reserved_mock_man ============== [08:48:20] [PASSED] Buffer object for userspace [08:48:20] [PASSED] Kernel buffer object [08:48:20] [PASSED] Shared buffer object [08:48:20] ========== [PASSED] ttm_bo_init_reserved_mock_man ========== [08:48:20] [PASSED] ttm_bo_init_reserved_resv [08:48:20] ================== ttm_bo_validate_basic ================== [08:48:20] [PASSED] Buffer object for userspace [08:48:20] [PASSED] Kernel buffer object [08:48:20] [PASSED] Shared buffer object [08:48:20] ============== [PASSED] ttm_bo_validate_basic ============== [08:48:20] [PASSED] ttm_bo_validate_invalid_placement [08:48:20] ============= ttm_bo_validate_same_placement ============== [08:48:20] [PASSED] System manager [08:48:20] [PASSED] VRAM manager [08:48:20] ========= [PASSED] ttm_bo_validate_same_placement ========== [08:48:20] [PASSED] ttm_bo_validate_failed_alloc [08:48:20] [PASSED] ttm_bo_validate_pinned [08:48:20] [PASSED] ttm_bo_validate_busy_placement [08:48:20] ================ ttm_bo_validate_multihop ================= [08:48:20] [PASSED] Buffer object for userspace [08:48:20] [PASSED] Kernel buffer object [08:48:20] [PASSED] Shared buffer object [08:48:20] ============ [PASSED] ttm_bo_validate_multihop ============= [08:48:20] ========== ttm_bo_validate_no_placement_signaled ========== [08:48:20] [PASSED] Buffer object in system domain, no page vector [08:48:20] [PASSED] Buffer object in system domain with an existing page vector [08:48:20] ====== [PASSED] ttm_bo_validate_no_placement_signaled ====== [08:48:20] ======== ttm_bo_validate_no_placement_not_signaled ======== [08:48:20] [PASSED] Buffer object for userspace [08:48:20] [PASSED] Kernel buffer object [08:48:20] [PASSED] Shared buffer object [08:48:20] ==== [PASSED] ttm_bo_validate_no_placement_not_signaled ==== [08:48:20] [PASSED] ttm_bo_validate_move_fence_signaled [08:48:20] ========= ttm_bo_validate_move_fence_not_signaled ========= [08:48:20] [PASSED] Waits for GPU [08:48:20] [PASSED] Tries to lock straight away [08:48:20] ===== [PASSED] ttm_bo_validate_move_fence_not_signaled ===== [08:48:20] [PASSED] ttm_bo_validate_swapout [08:48:20] [PASSED] ttm_bo_validate_happy_evict [08:48:20] [PASSED] ttm_bo_validate_all_pinned_evict [08:48:20] [PASSED] ttm_bo_validate_allowed_only_evict [08:48:20] [PASSED] ttm_bo_validate_deleted_evict [08:48:20] [PASSED] ttm_bo_validate_busy_domain_evict [08:48:20] [PASSED] ttm_bo_validate_evict_gutting [08:48:20] [PASSED] ttm_bo_validate_recrusive_evict [08:48:20] ================= [PASSED] ttm_bo_validate ================= [08:48:20] ============================================================ [08:48:20] Testing complete. Ran 102 tests: passed: 102 [08:48:20] Elapsed time: 12.690s total, 2.490s configuring, 9.985s building, 0.173s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/dma-buf/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/dma-buf/.kunitconfig [08:48:21] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [08:48:23] 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 [08:48:32] Starting KUnit Kernel (1/1)... [08:48:32] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [08:48:32] =============== dma-buf-fence (12 subtests) ================ [08:48:32] [PASSED] test_sanitycheck [08:48:32] [PASSED] test_signaling [08:48:32] [PASSED] test_add_callback [08:48:32] [PASSED] test_late_add_callback [08:48:32] [PASSED] test_rm_callback [08:48:32] [PASSED] test_late_rm_callback [08:48:32] [PASSED] test_status [08:48:32] [PASSED] test_error [08:48:32] [PASSED] test_wait [08:48:32] [PASSED] test_wait_timeout [08:48:32] [PASSED] test_stub [08:48:32] [SKIPPED] test_race_signal_callback (requires at least 2 CPUs) [08:48:32] ================== [PASSED] dma-buf-fence ================== [08:48:32] ============ dma-buf-fence-chain (11 subtests) ============= [08:48:32] [PASSED] test_sanitycheck [08:48:32] [PASSED] test_find_seqno [08:48:32] [PASSED] test_find_signaled [08:48:32] [PASSED] test_find_out_of_order [08:48:37] [PASSED] test_find_gap [08:48:37] [PASSED] test_find_race [08:48:37] [PASSED] test_signal_forward [08:48:37] [PASSED] test_signal_backward [08:48:37] [PASSED] test_wait_forward [08:48:37] [PASSED] test_wait_backward [08:48:37] [PASSED] test_wait_random [08:48:37] =============== [PASSED] dma-buf-fence-chain =============== [08:48:37] ============ dma-buf-fence-unwrap (11 subtests) ============ [08:48:37] [PASSED] test_sanitycheck [08:48:37] [PASSED] test_unwrap_array [08:48:37] [PASSED] test_unwrap_chain [08:48:37] [PASSED] test_unwrap_chain_array [08:48:37] [PASSED] test_unwrap_merge [08:48:37] [PASSED] test_unwrap_merge_duplicate [08:48:37] [PASSED] test_unwrap_merge_seqno [08:48:37] [PASSED] test_unwrap_merge_order [08:48:37] [PASSED] test_unwrap_merge_complex [08:48:37] [PASSED] test_unwrap_merge_complex_seqno [08:48:37] [PASSED] test_dedup_empty [08:48:37] ============== [PASSED] dma-buf-fence-unwrap =============== [08:48:37] ================ dma-buf-resv (5 subtests) ================= [08:48:37] [PASSED] test_sanitycheck [08:48:37] ===================== test_signaling ====================== [08:48:37] [PASSED] kernel [08:48:37] [PASSED] write [08:48:37] [PASSED] read [08:48:37] [PASSED] bookkeep [08:48:37] ================= [PASSED] test_signaling ================== [08:48:37] ====================== test_for_each ====================== [08:48:37] [PASSED] kernel [08:48:37] [PASSED] write [08:48:37] [PASSED] read [08:48:37] [PASSED] bookkeep [08:48:37] ================== [PASSED] test_for_each ================== [08:48:37] ================= test_for_each_unlocked ================== [08:48:37] [PASSED] kernel [08:48:37] [PASSED] write [08:48:37] [PASSED] read [08:48:37] [PASSED] bookkeep [08:48:37] ============= [PASSED] test_for_each_unlocked ============== [08:48:37] ===================== test_get_fences ===================== [08:48:37] [PASSED] kernel [08:48:37] [PASSED] write [08:48:37] [PASSED] read [08:48:37] [PASSED] bookkeep [08:48:37] ================= [PASSED] test_get_fences ================= [08:48:37] ================== [PASSED] dma-buf-resv =================== [08:48:37] ============================================================ [08:48:37] Testing complete. Ran 51 tests: passed: 50, skipped: 1 [08:48:37] Elapsed time: 16.673s total, 2.518s configuring, 8.784s building, 5.351s running
+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel
Patchwork
CI✗ CI.checksparse: warning for Migrate on fault for device pages (rev9)
In reply to [email protected]== Series Details ==
== Series Details ==
Series: Migrate on fault for device pages (rev9)
URL : https://patchwork.freedesktop.org/series/165953/
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 dabb4c72ce501c30b3e57854bb05415bfe9047f4 Sparse version: 0.6.4 (Ubuntu: 0.6.4-4ubuntu3)
Fast mode used, each commit won't be checked separately. +/kernel/Makefile:1292: C=1 specified, but sparse is not available or not up to date
+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel
Patchwork
CI✓ Xe.CI.BAT: success for Migrate on fault for device pages (rev9)
In reply to [email protected]== Series Details ==
== Series Details ==
Series: Migrate on fault for device pages (rev9)
URL : https://patchwork.freedesktop.org/series/165953/
State : success
== Summary ==
CI Bug Log - changes from xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779_BAT -> xe-pw-165953v9_BAT
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Participating hosts (14 -> 15)
------------------------------
Additional (1): bat-bmg-2
Known issues
------------
Here are the changes found in xe-pw-165953v9_BAT that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@fbdev@write:
- bat-bmg-2: NOTRUN -> [SKIP][1] ([Intel XE#2134]) +4 other tests skip
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/bat-bmg-2/igt@[email protected]
* igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- bat-bmg-2: NOTRUN -> [SKIP][2] ([Intel XE#2233])
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/bat-bmg-2/igt@[email protected]
* igt@kms_cursor_legacy@basic-flip-after-cursor-legacy:
- bat-bmg-2: NOTRUN -> [SKIP][3] ([Intel XE#2489] / [Intel XE#3419]) +13 other tests skip
[3]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/bat-bmg-2/igt@[email protected]
* igt@kms_flip@basic-flip-vs-modeset:
- bat-bmg-2: NOTRUN -> [SKIP][4] ([Intel XE#2482]) +3 other tests skip
[4]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/bat-bmg-2/igt@[email protected]
* igt@kms_frontbuffer_tracking@basic:
- bat-bmg-2: NOTRUN -> [SKIP][5] ([Intel XE#2434] / [Intel XE#2548] / [Intel XE#6314])
[5]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/bat-bmg-2/igt@[email protected]
* igt@kms_psr@psr-sprite-plane-onoff:
- bat-bmg-2: NOTRUN -> [SKIP][6] ([Intel XE#2234] / [Intel XE#2850]) +2 other tests skip
[6]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/bat-bmg-2/igt@[email protected]
* igt@xe_exec_multi_queue@priority:
- bat-bmg-2: NOTRUN -> [SKIP][7] ([Intel XE#8364]) +13 other tests skip
[7]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/bat-bmg-2/igt@[email protected]
* igt@xe_live_ktest@xe_bo@xe_ccs_migrate_kunit:
- bat-bmg-2: NOTRUN -> [SKIP][8] ([Intel XE#2229])
[8]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/bat-bmg-2/igt@xe_live_ktest@xe_bo@xe_ccs_migrate_kunit.html
* igt@xe_pat@pat-index-xehpc:
- bat-bmg-2: NOTRUN -> [SKIP][9] ([Intel XE#1420] / [Intel XE#7590])
[9]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/bat-bmg-2/igt@[email protected]
* igt@xe_pat@pat-index-xelp:
- bat-bmg-2: NOTRUN -> [SKIP][10] ([Intel XE#2245] / [Intel XE#7590])
[10]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/bat-bmg-2/igt@[email protected]
* igt@xe_pat@pat-index-xelpg:
- bat-bmg-2: NOTRUN -> [SKIP][11] ([Intel XE#2236] / [Intel XE#7590])
[11]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/bat-bmg-2/igt@[email protected]
[Intel XE#1420]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1420
[Intel XE#2134]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2134
[Intel XE#2229]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2229
[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#2236]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2236
[Intel XE#2245]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2245
[Intel XE#2434]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2434
[Intel XE#2482]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2482
[Intel XE#2489]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2489
[Intel XE#2548]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2548
[Intel XE#2850]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2850
[Intel XE#3419]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3419
[Intel XE#6314]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6314
[Intel XE#7590]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7590
[Intel XE#8364]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8364
Build changes
-------------
* Linux: xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779 -> xe-pw-165953v9
IGT_9175: 9175
xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779: 0f5e7199aaceed05aa49dad4c97df2677e32f779
xe-pw-165953v9: 165953v9
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/index.html
Patchwork
CI✗ Xe.CI.FULL: failure for Migrate on fault for device pages (rev9)
In reply to [email protected]== Series Details ==
== Series Details ==
Series: Migrate on fault for device pages (rev9)
URL : https://patchwork.freedesktop.org/series/165953/
State : failure
== Summary ==
CI Bug Log - changes from xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779_FULL -> xe-pw-165953v9_FULL
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with xe-pw-165953v9_FULL absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes
introduced in xe-pw-165953v9_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 (3 -> 3)
------------------------------
No changes in participating hosts
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in xe-pw-165953v9_FULL:
### IGT changes ###
#### Possible regressions ####
* igt@fbdev@unaligned-read:
- shard-bmg: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_flip@2x-flip-vs-panning@ac-dp2-hdmi-a3:
- shard-bmg: [PASS][3] -> [DMESG-WARN][4]
[3]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@kms_flip@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@kms_flip@[email protected]
* igt@kms_pm_rpm@modeset-non-lpsp:
- shard-bmg: [PASS][5] -> [SKIP][6]
[5]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
Known issues
------------
Here are the changes found in xe-pw-165953v9_FULL that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@core_hotunplug@hotreplug:
- shard-bmg: [PASS][7] -> [SKIP][8] ([Intel XE#8749])
[7]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_big_fb@linear-8bpp-rotate-270:
- shard-ptl: NOTRUN -> [SKIP][9] ([Intel XE#5901])
[9]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
- shard-lnl: NOTRUN -> [SKIP][10] ([Intel XE#1407])
[10]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip:
- shard-ptl: NOTRUN -> [SKIP][11] ([Intel XE#5808]) +2 other tests skip
[11]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip.html
- shard-lnl: NOTRUN -> [SKIP][12] ([Intel XE#1124]) +2 other tests skip
[12]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip.html
* igt@kms_bw@connected-linear-tiling-4-displays-target-2160x1440p:
- shard-ptl: NOTRUN -> [SKIP][13] ([Intel XE#7679])
[13]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
- shard-lnl: NOTRUN -> [SKIP][14] ([Intel XE#8365])
[14]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_ccs@bad-pixel-format-4-tiled-dg2-mc-ccs:
- shard-lnl: NOTRUN -> [SKIP][15] ([Intel XE#2887]) +2 other tests skip
[15]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_ccs@bad-rotation-90-y-tiled-gen12-rc-ccs:
- shard-ptl: NOTRUN -> [SKIP][16] ([Intel XE#5822]) +6 other tests skip
[16]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-7/igt@[email protected]
* igt@kms_ccs@crc-primary-suspend-4-tiled-dg2-mc-ccs:
- shard-lnl: NOTRUN -> [SKIP][17] ([Intel XE#3432])
[17]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_chamelium_color@ctm-0-25:
- shard-ptl: NOTRUN -> [SKIP][18] ([Intel XE#5824])
[18]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-7/igt@[email protected]
* igt@kms_chamelium_hpd@dp-hpd-fast:
- shard-lnl: NOTRUN -> [SKIP][19] ([Intel XE#373])
[19]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_chamelium_hpd@hdmi-hpd-for-each-pipe:
- shard-ptl: NOTRUN -> [SKIP][20] ([Intel XE#2252]) +2 other tests skip
[20]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-7/igt@[email protected]
* igt@kms_chamelium_sharpness_filter@filter-basic:
- shard-ptl: NOTRUN -> [SKIP][21] ([Intel XE#6507])
[21]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
- shard-lnl: NOTRUN -> [SKIP][22] ([Intel XE#6507] / [Intel XE#7358])
[22]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_content_protection@atomic-dpms@pipe-a-dp-2:
- shard-bmg: NOTRUN -> [FAIL][23] ([Intel XE#1178] / [Intel XE#3304] / [Intel XE#7374])
[23]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-9/igt@kms_content_protection@[email protected]
* igt@kms_content_protection@mei-interface:
- shard-ptl: NOTRUN -> [SKIP][24] ([Intel XE#5845])
[24]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-7/igt@[email protected]
* igt@kms_cursor_crc@cursor-random-32x10:
- shard-ptl: NOTRUN -> [SKIP][25] ([Intel XE#5900]) +1 other test skip
[25]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
- shard-lnl: NOTRUN -> [SKIP][26] ([Intel XE#1424])
[26]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_dsc@dsc-basic-ultrajoiner:
- shard-ptl: NOTRUN -> [SKIP][27] ([Intel XE#5907])
[27]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
- shard-lnl: NOTRUN -> [SKIP][28] ([Intel XE#8265])
[28]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_flip@2x-blocking-absolute-wf_vblank:
- shard-ptl: NOTRUN -> [SKIP][29] ([Intel XE#2316])
[29]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@kms_flip@2x-blocking-absolute-wf_vblank.html
- shard-lnl: NOTRUN -> [SKIP][30] ([Intel XE#1421])
[30]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@kms_flip@2x-blocking-absolute-wf_vblank.html
* igt@kms_flip@2x-flip-vs-panning@ad-dp2-hdmi-a3:
- shard-bmg: [PASS][31] -> [DMESG-FAIL][32] ([Intel XE#7774]) +1 other test dmesg-fail
[31]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@kms_flip@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@kms_flip@[email protected]
* igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-32bpp-4tiledg2rcccs-upscaling:
- shard-lnl: NOTRUN -> [SKIP][33] ([Intel XE#7178] / [Intel XE#7349])
[33]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-32bpp-4tiledg2rcccs-upscaling.html
* igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-64bpp-yftile-downscaling:
- shard-ptl: NOTRUN -> [SKIP][34] ([Intel XE#7178]) +3 other tests skip
[34]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-7/igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-64bpp-yftile-downscaling.html
* igt@kms_flip_scaled_crc@flip-64bpp-linear-to-32bpp-linear-downscaling:
- shard-ptl: NOTRUN -> [SKIP][35] ([Intel XE#5828]) +1 other test skip
[35]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@kms_flip_scaled_crc@flip-64bpp-linear-to-32bpp-linear-downscaling.html
- shard-lnl: NOTRUN -> [SKIP][36] ([Intel XE#1397] / [Intel XE#1745] / [Intel XE#7385] / [Intel XE#9144])
[36]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@kms_flip_scaled_crc@flip-64bpp-linear-to-32bpp-linear-downscaling.html
* igt@kms_flip_scaled_crc@flip-64bpp-linear-to-32bpp-linear-downscaling@pipe-a-default-mode:
- shard-lnl: NOTRUN -> [SKIP][37] ([Intel XE#1397] / [Intel XE#7385] / [Intel XE#9144])
[37]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@kms_flip_scaled_crc@flip-64bpp-linear-to-32bpp-linear-downscaling@pipe-a-default-mode.html
* igt@kms_force_connector_basic@force-connector-state:
- shard-lnl: NOTRUN -> [SKIP][38] ([Intel XE#352])
[38]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-indfb-pgflip-blt:
- shard-ptl: NOTRUN -> [SKIP][39] ([Intel XE#5812]) +18 other tests skip
[39]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-7/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-shrfb-draw-render:
- shard-lnl: NOTRUN -> [SKIP][40] ([Intel XE#656] / [Intel XE#7905]) +5 other tests skip
[40]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-shrfb-draw-render.html
* igt@kms_frontbuffer_tracking@fbcdrrs-rgb101010-draw-mmap-wc:
- shard-ptl: NOTRUN -> [SKIP][41] ([Intel XE#5800] / [Intel XE#6312]) +2 other tests skip
[41]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-7/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcdrrs-rgb101010-draw-render:
- shard-lnl: NOTRUN -> [SKIP][42] ([Intel XE#6312] / [Intel XE#651]) +1 other test skip
[42]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcdrrshdr-1p-primscrn-shrfb-pgflip-blt:
- shard-ptl: NOTRUN -> [SKIP][43] ([Intel XE#6312])
[43]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@kms_frontbuffer_tracking@fbcdrrshdr-1p-primscrn-shrfb-pgflip-blt.html
- shard-lnl: NOTRUN -> [SKIP][44] ([Intel XE#6312])
[44]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@kms_frontbuffer_tracking@fbcdrrshdr-1p-primscrn-shrfb-pgflip-blt.html
* igt@kms_frontbuffer_tracking@fbcdrrshdr-2p-scndscrn-spr-indfb-draw-blt:
- shard-lnl: NOTRUN -> [SKIP][45] ([Intel XE#7905]) +4 other tests skip
[45]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@kms_frontbuffer_tracking@fbcdrrshdr-2p-scndscrn-spr-indfb-draw-blt.html
* igt@kms_frontbuffer_tracking@fbcpsrhdr-tiling-4:
- shard-ptl: NOTRUN -> [SKIP][46] ([Intel XE#7865]) +3 other tests skip
[46]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-7/igt@[email protected]
* igt@kms_frontbuffer_tracking@hdr-1p-offscreen-pri-indfb-draw-mmap-wc:
- shard-lnl: NOTRUN -> [SKIP][47] ([Intel XE#7865])
[47]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@kms_frontbuffer_tracking@hdr-1p-offscreen-pri-indfb-draw-mmap-wc.html
* igt@kms_frontbuffer_tracking@psrhdr-argb161616f-draw-render:
- shard-ptl: NOTRUN -> [SKIP][48] ([Intel XE#7061]) +1 other test skip
[48]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
- shard-lnl: NOTRUN -> [SKIP][49] ([Intel XE#7061])
[49]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_mst@mst-suspend-read-crc:
- shard-bmg: NOTRUN -> [SKIP][50] ([Intel XE#8348])
[50]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_plane@pixel-format-x-tiled-modifier:
- shard-ptl: NOTRUN -> [SKIP][51] ([Intel XE#7283]) +1 other test skip
[51]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
* igt@kms_plane@pixel-format-x-tiled-modifier@pipe-b-plane-5:
- shard-lnl: NOTRUN -> [SKIP][52] ([Intel XE#8303]) +1 other test skip
[52]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@kms_plane@[email protected]
* igt@kms_plane@pixel-format-y-tiled-ccs-modifier:
- shard-lnl: NOTRUN -> [SKIP][53] ([Intel XE#7283])
[53]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_psr2_sf@fbc-pr-cursor-plane-move-continuous-sf:
- shard-ptl: NOTRUN -> [SKIP][54] ([Intel XE#7304]) +1 other test skip
[54]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-7/igt@[email protected]
* igt@kms_psr2_sf@fbc-psr2-cursor-plane-update-sf:
- shard-lnl: NOTRUN -> [SKIP][55] ([Intel XE#2893] / [Intel XE#4608] / [Intel XE#7304])
[55]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@kms_psr2_sf@fbc-psr2-cursor-plane-update-sf@pipe-a-edp-1:
- shard-ptl: NOTRUN -> [SKIP][56] ([Intel XE#5858])
[56]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@kms_psr2_sf@[email protected]
- shard-lnl: NOTRUN -> [SKIP][57] ([Intel XE#4608])
[57]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@kms_psr2_sf@[email protected]
* igt@kms_psr2_sf@fbc-psr2-cursor-plane-update-sf@pipe-b-edp-1:
- shard-ptl: NOTRUN -> [SKIP][58] ([Intel XE#5858] / [Intel XE#7304]) +1 other test skip
[58]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@kms_psr2_sf@[email protected]
- shard-lnl: NOTRUN -> [SKIP][59] ([Intel XE#4608] / [Intel XE#7304])
[59]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@kms_psr2_sf@[email protected]
* igt@kms_psr2_su@frontbuffer-xrgb8888:
- shard-ptl: NOTRUN -> [SKIP][60] ([Intel XE#7413])
[60]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
- shard-lnl: NOTRUN -> [SKIP][61] ([Intel XE#1128] / [Intel XE#7413])
[61]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@xe_configfs@ctx-restore-post-bb:
- shard-bmg: [PASS][62] -> [ABORT][63] ([Intel XE#9463])
[62]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-4/igt@[email protected]
[63]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-1/igt@[email protected]
* igt@xe_evict_ccs@evict-overcommit-standalone-instantfree-samefd:
- shard-ptl: NOTRUN -> [SKIP][64] ([Intel XE#6144])
[64]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
- shard-lnl: NOTRUN -> [SKIP][65] ([Intel XE#6540] / [Intel XE#688])
[65]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@xe_exec_balancer@many-execqueues-cm-parallel-userptr:
- shard-lnl: NOTRUN -> [SKIP][66] ([Intel XE#7482]) +2 other tests skip
[66]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@xe_exec_balancer@once-cm-virtual-userptr-invalidate-race:
- shard-ptl: NOTRUN -> [SKIP][67] ([Intel XE#7482]) +2 other tests skip
[67]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
* igt@xe_exec_basic@multigpu-no-exec-bindexecqueue-rebind:
- shard-lnl: NOTRUN -> [SKIP][68] ([Intel XE#1392])
[68]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@xe_exec_basic@multigpu-once-null:
- shard-ptl: NOTRUN -> [SKIP][69] ([Intel XE#5575] / [Intel XE#7484]) +3 other tests skip
[69]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-7/igt@[email protected]
* igt@xe_exec_fault_mode@many-multi-queue-userptr-rebind:
- shard-ptl: NOTRUN -> [SKIP][70] ([Intel XE#8374]) +2 other tests skip
[70]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
- shard-lnl: NOTRUN -> [SKIP][71] ([Intel XE#8374]) +1 other test skip
[71]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@xe_exec_multi_queue@many-queues-preempt-mode-close-fd-smem:
- shard-lnl: NOTRUN -> [SKIP][72] ([Intel XE#8364]) +7 other tests skip
[72]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@xe_exec_multi_queue@two-queues-preempt-mode-fault-dyn-priority:
- shard-ptl: NOTRUN -> [SKIP][73] ([Intel XE#8364]) +9 other tests skip
[73]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@xe_exec_multi_queue@two-queues-preempt-mode-fault-dyn-priority.html
* igt@xe_exec_reset@gt-reset-fault-injection:
- shard-bmg: [PASS][74] -> [ABORT][75] ([Intel XE#9145] / [Intel XE#9463])
[74]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-2/igt@[email protected]
[75]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-7/igt@[email protected]
* igt@xe_exec_system_allocator@process-many-execqueues-mmap-free-huge:
- shard-bmg: [PASS][76] -> [SKIP][77] ([Intel XE#8589]) +157 other tests skip
[76]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@xe_exec_system_allocator@process-many-execqueues-mmap-free-huge.html
[77]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@xe_exec_system_allocator@process-many-execqueues-mmap-free-huge.html
* igt@xe_oa@oa-tlb-invalidate:
- shard-ptl: NOTRUN -> [SKIP][78] ([Intel XE#6069])
[78]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
- shard-lnl: NOTRUN -> [SKIP][79] ([Intel XE#2248] / [Intel XE#7325] / [Intel XE#7393])
[79]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@xe_pm@d3hot-i2c:
- shard-ptl: NOTRUN -> [SKIP][80] ([Intel XE#5742] / [Intel XE#7400])
[80]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-7/igt@[email protected]
* igt@xe_pm@s4-vm-bind-unbind-all:
- shard-lnl: [PASS][81] -> [ABORT][82] ([Intel XE#9362])
[81]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-lnl-3/igt@[email protected]
[82]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-2/igt@[email protected]
* igt@xe_pm@s4-vm-bind-userptr:
- shard-ptl: [PASS][83] -> [ABORT][84] ([Intel XE#9362])
[83]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-ptl-6/igt@[email protected]
[84]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-5/igt@[email protected]
* igt@xe_query@multigpu-query-topology:
- shard-ptl: NOTRUN -> [SKIP][85] ([Intel XE#6019])
[85]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
- shard-lnl: NOTRUN -> [SKIP][86] ([Intel XE#944])
[86]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@xe_sriov_auto_provisioning@exclusive-ranges:
- shard-lnl: NOTRUN -> [SKIP][87] ([Intel XE#4130] / [Intel XE#7366])
[87]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
* igt@xe_vm@large-split-misaligned-binds-536870912:
- shard-bmg: [PASS][88] -> [ABORT][89] ([Intel XE#6652] / [Intel XE#7893])
[88]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-5/igt@[email protected]
[89]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
#### Possible fixes ####
* igt@kms_ccs@crc-primary-suspend-4-tiled-bmg-ccs:
- shard-bmg: [INCOMPLETE][90] ([Intel XE#7084] / [Intel XE#8150]) -> [PASS][91] +1 other test pass
[90]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-5/igt@[email protected]
[91]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_ccs@crc-primary-suspend-4-tiled-lnl-ccs@pipe-c-edp-1:
- shard-ptl: [DMESG-WARN][92] ([Intel XE#9391]) -> [PASS][93] +1 other test pass
[92]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-ptl-2/igt@kms_ccs@[email protected]
[93]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-2/igt@kms_ccs@[email protected]
* igt@kms_hdr@invalid-hdr:
- shard-bmg: [SKIP][94] ([Intel XE#1503]) -> [PASS][95]
[94]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-4/igt@[email protected]
[95]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-8/igt@[email protected]
* igt@kms_vrr@flip-suspend@pipe-a-edp-1:
- shard-ptl: [FAIL][96] ([Intel XE#4227] / [Intel XE#7397]) -> [PASS][97] +1 other test pass
[96]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-ptl-1/igt@kms_vrr@[email protected]
[97]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-5/igt@kms_vrr@[email protected]
* igt@xe_pm@s4-multiple-execs:
- shard-ptl: [ABORT][98] ([Intel XE#9362]) -> [PASS][99] +1 other test pass
[98]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-ptl-4/igt@[email protected]
[99]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-ptl-8/igt@[email protected]
- shard-lnl: [ABORT][100] ([Intel XE#9362]) -> [PASS][101]
[100]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-lnl-2/igt@[email protected]
[101]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-lnl-5/igt@[email protected]
#### Warnings ####
* igt@kms_big_fb@4-tiled-64bpp-rotate-270:
- shard-bmg: [SKIP][102] ([Intel XE#2327]) -> [SKIP][103] ([Intel XE#8589])
[102]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[103]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-0-hflip:
- shard-bmg: [SKIP][104] ([Intel XE#1124]) -> [SKIP][105] ([Intel XE#8589]) +1 other test skip
[104]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[105]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_bw@linear-tiling-1-displays-target-1920x1080p:
- shard-bmg: [SKIP][106] ([Intel XE#367]) -> [SKIP][107] ([Intel XE#8589])
[106]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[107]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_ccs@crc-sprite-planes-basic-4-tiled-lnl-ccs:
- shard-bmg: [SKIP][108] ([Intel XE#2652]) -> [SKIP][109] ([Intel XE#8589])
[108]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[109]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_ccs@random-ccs-data-4-tiled-dg2-rc-ccs-cc:
- shard-bmg: [SKIP][110] ([Intel XE#2887]) -> [SKIP][111] ([Intel XE#8589]) +3 other tests skip
[110]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[111]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_chamelium_color_pipeline@plane-fixed-matrix-yuv-rgb-bt2020-lim-lut1d:
- shard-bmg: [SKIP][112] ([Intel XE#7358]) -> [SKIP][113] ([Intel XE#8589])
[112]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@kms_chamelium_color_pipeline@plane-fixed-matrix-yuv-rgb-bt2020-lim-lut1d.html
[113]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@kms_chamelium_color_pipeline@plane-fixed-matrix-yuv-rgb-bt2020-lim-lut1d.html
* igt@kms_chamelium_frames@hdmi-frame-dump:
- shard-bmg: [SKIP][114] ([Intel XE#2252]) -> [SKIP][115] ([Intel XE#8589]) +1 other test skip
[114]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[115]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_cursor_crc@cursor-sliding-32x10:
- shard-bmg: [SKIP][116] ([Intel XE#2320]) -> [SKIP][117] ([Intel XE#8589]) +2 other tests skip
[116]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[117]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_dirtyfb@drrs-dirtyfb-ioctl:
- shard-bmg: [SKIP][118] ([Intel XE#1508]) -> [SKIP][119] ([Intel XE#8589])
[118]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[119]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_feature_discovery@psr2:
- shard-bmg: [SKIP][120] ([Intel XE#2374] / [Intel XE#6128]) -> [SKIP][121] ([Intel XE#8589])
[120]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[121]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs-upscaling:
- shard-bmg: [SKIP][122] ([Intel XE#7178] / [Intel XE#7351]) -> [SKIP][123] ([Intel XE#8589])
[122]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs-upscaling.html
[123]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs-upscaling.html
* igt@kms_flip_scaled_crc@flip-nv12-linear-to-nv12-linear-reflect-x:
- shard-bmg: [SKIP][124] ([Intel XE#7179]) -> [SKIP][125] ([Intel XE#8589])
[124]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@kms_flip_scaled_crc@flip-nv12-linear-to-nv12-linear-reflect-x.html
[125]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@kms_flip_scaled_crc@flip-nv12-linear-to-nv12-linear-reflect-x.html
* igt@kms_frontbuffer_tracking@drrs-2p-primscrn-pri-indfb-draw-blt:
- shard-bmg: [SKIP][126] ([Intel XE#2311]) -> [SKIP][127] ([Intel XE#8589]) +14 other tests skip
[126]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@kms_frontbuffer_tracking@drrs-2p-primscrn-pri-indfb-draw-blt.html
[127]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@kms_frontbuffer_tracking@drrs-2p-primscrn-pri-indfb-draw-blt.html
* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-spr-indfb-onoff:
- shard-bmg: [SKIP][128] ([Intel XE#4141]) -> [SKIP][129] ([Intel XE#8589]) +2 other tests skip
[128]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[129]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_frontbuffer_tracking@psr-argb161616f-draw-mmap-wc:
- shard-bmg: [SKIP][130] ([Intel XE#7061] / [Intel XE#7356]) -> [SKIP][131] ([Intel XE#8589])
[130]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[131]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_frontbuffer_tracking@psrhdr-1p-primscrn-pri-shrfb-draw-render:
- shard-bmg: [SKIP][132] ([Intel XE#2313]) -> [SKIP][133] ([Intel XE#8589]) +14 other tests skip
[132]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@kms_frontbuffer_tracking@psrhdr-1p-primscrn-pri-shrfb-draw-render.html
[133]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@kms_frontbuffer_tracking@psrhdr-1p-primscrn-pri-shrfb-draw-render.html
* igt@kms_frontbuffer_tracking@psrhdr-argb161616f-draw-blt:
- shard-bmg: [SKIP][134] ([Intel XE#7061]) -> [SKIP][135] ([Intel XE#8589])
[134]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[135]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_hdr@brightness-with-hdr:
- shard-bmg: [SKIP][136] ([Intel XE#3374] / [Intel XE#3544]) -> [SKIP][137] ([Intel XE#3544])
[136]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-7/igt@[email protected]
[137]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_pm_dc@dc5-pageflip-negative:
- shard-bmg: [SKIP][138] ([Intel XE#6927] / [Intel XE#8854]) -> [SKIP][139] ([Intel XE#8589])
[138]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[139]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_psr2_sf@pr-overlay-plane-update-sf-dmg-area:
- shard-bmg: [SKIP][140] ([Intel XE#1489]) -> [SKIP][141] ([Intel XE#8589])
[140]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[141]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_psr2_su@page_flip-nv12:
- shard-bmg: [SKIP][142] ([Intel XE#2387] / [Intel XE#7429]) -> [SKIP][143] ([Intel XE#8589])
[142]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@kms_psr2_su@page_flip-nv12.html
[143]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@kms_psr2_su@page_flip-nv12.html
* igt@kms_psr@fbc-psr2-basic:
- shard-bmg: [SKIP][144] ([Intel XE#2234] / [Intel XE#2850]) -> [SKIP][145] ([Intel XE#8589]) +1 other test skip
[144]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[145]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@kms_scaling_modes@scaling-mode-full:
- shard-bmg: [SKIP][146] ([Intel XE#2413]) -> [SKIP][147] ([Intel XE#8589])
[146]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[147]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@xe_evict@evict-small-multi-queue-priority-cm:
- shard-bmg: [SKIP][148] ([Intel XE#8370]) -> [SKIP][149] ([Intel XE#8589])
[148]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[149]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@xe_exec_basic@multigpu-once-bindexecqueue:
- shard-bmg: [SKIP][150] ([Intel XE#2322] / [Intel XE#7372]) -> [SKIP][151] ([Intel XE#8589])
[150]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[151]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@xe_exec_fault_mode@twice-multi-queue-userptr-invalidate:
- shard-bmg: [SKIP][152] ([Intel XE#8374]) -> [SKIP][153] ([Intel XE#8589]) +3 other tests skip
[152]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[153]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@xe_exec_multi_queue@many-queues-preempt-mode-fault-userptr-invalidate:
- shard-bmg: [SKIP][154] ([Intel XE#8364]) -> [SKIP][155] ([Intel XE#8589]) +6 other tests skip
[154]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@xe_exec_multi_queue@many-queues-preempt-mode-fault-userptr-invalidate.html
[155]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@xe_exec_multi_queue@many-queues-preempt-mode-fault-userptr-invalidate.html
* igt@xe_exec_threads@threads-multi-queue-mixed-rebind:
- shard-bmg: [SKIP][156] ([Intel XE#8378]) -> [SKIP][157] ([Intel XE#8589])
[156]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[157]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@xe_pat@xa-app-transient-media-on:
- shard-bmg: [SKIP][158] ([Intel XE#7590]) -> [SKIP][159] ([Intel XE#8589]) +1 other test skip
[158]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[159]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
* igt@xe_pxp@pxp-termination-key-update-post-termination-irq:
- shard-bmg: [SKIP][160] ([Intel XE#4733] / [Intel XE#7417]) -> [SKIP][161] ([Intel XE#8589])
[160]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779/shard-bmg-6/igt@[email protected]
[161]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/shard-bmg-5/igt@[email protected]
[Intel XE#1124]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1124
[Intel XE#1128]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1128
[Intel XE#1178]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1178
[Intel XE#1392]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1392
[Intel XE#1397]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1397
[Intel XE#1407]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1407
[Intel XE#1421]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1421
[Intel XE#1424]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1424
[Intel XE#1489]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1489
[Intel XE#1503]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1503
[Intel XE#1508]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1508
[Intel XE#1745]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1745
[Intel XE#2234]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2234
[Intel XE#2248]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2248
[Intel XE#2252]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2252
[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#2316]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2316
[Intel XE#2320]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2320
[Intel XE#2322]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2322
[Intel XE#2327]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2327
[Intel XE#2374]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2374
[Intel XE#2387]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2387
[Intel XE#2413]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2413
[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#2893]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2893
[Intel XE#3304]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3304
[Intel XE#3374]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3374
[Intel XE#3432]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3432
[Intel XE#352]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/352
[Intel XE#3544]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3544
[Intel XE#367]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/367
[Intel XE#373]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/373
[Intel XE#4130]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4130
[Intel XE#4141]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4141
[Intel XE#4227]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4227
[Intel XE#4608]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4608
[Intel XE#4733]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4733
[Intel XE#5575]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5575
[Intel XE#5742]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5742
[Intel XE#5800]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5800
[Intel XE#5808]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5808
[Intel XE#5812]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5812
[Intel XE#5822]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5822
[Intel XE#5824]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5824
[Intel XE#5828]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5828
[Intel XE#5845]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5845
[Intel XE#5858]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5858
[Intel XE#5900]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5900
[Intel XE#5901]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5901
[Intel XE#5907]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5907
[Intel XE#6019]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6019
[Intel XE#6069]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6069
[Intel XE#6128]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6128
[Intel XE#6144]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6144
[Intel XE#6312]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6312
[Intel XE#6507]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6507
[Intel XE#651]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/651
[Intel XE#6540]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6540
[Intel XE#656]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/656
[Intel XE#6652]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6652
[Intel XE#688]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/688
[Intel XE#6927]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6927
[Intel XE#7061]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7061
[Intel XE#7084]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7084
[Intel XE#7178]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7178
[Intel XE#7179]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7179
[Intel XE#7283]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7283
[Intel XE#7304]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7304
[Intel XE#7325]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7325
[Intel XE#7349]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7349
[Intel XE#7351]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7351
[Intel XE#7356]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7356
[Intel XE#7358]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7358
[Intel XE#7366]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7366
[Intel XE#7372]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7372
[Intel XE#7374]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7374
[Intel XE#7385]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7385
[Intel XE#7393]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7393
[Intel XE#7397]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7397
[Intel XE#7400]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7400
[Intel XE#7413]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7413
[Intel XE#7417]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7417
[Intel XE#7429]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7429
[Intel XE#7482]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7482
[Intel XE#7484]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7484
[Intel XE#7590]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7590
[Intel XE#7679]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7679
[Intel XE#7774]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7774
[Intel XE#7865]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7865
[Intel XE#7893]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7893
[Intel XE#7905]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7905
[Intel XE#8150]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8150
[Intel XE#8265]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8265
[Intel XE#8303]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8303
[Intel XE#8348]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8348
[Intel XE#8364]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8364
[Intel XE#8365]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8365
[Intel XE#8370]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8370
[Intel XE#8374]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8374
[Intel XE#8378]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8378
[Intel XE#8589]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8589
[Intel XE#8749]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8749
[Intel XE#8854]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8854
[Intel XE#9144]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/9144
[Intel XE#9145]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/9145
[Intel XE#9362]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/9362
[Intel XE#9391]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/9391
[Intel XE#944]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/944
[Intel XE#9463]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/9463
Build changes
-------------
* Linux: xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779 -> xe-pw-165953v9
IGT_9175: 9175
xe-6049-0f5e7199aaceed05aa49dad4c97df2677e32f779: 0f5e7199aaceed05aa49dad4c97df2677e32f779
xe-pw-165953v9: 165953v9
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-165953v9/index.html
[email protected]
AI reviewRe: [PATCH v17 03/12] mm/hmm: preparations for HMM to participate in migration
In reply to [email protected]Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] mm/hmm: memset() in hmm_range_fault_locked() wipes collected pfns on retry - [Low] mm/hmm: build…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] mm/hmm: memset() in hmm_range_fault_locked() wipes collected pfns on retry
- [Low] mm/hmm: build failure in hmm_range_fault_locked() when !CONFIG_MIGRATION --
commit 9e255c525419b859ce3c5e39d7de2c6153874013
Author: Mika Penttilä <[email protected]>
mm/hmm: preparations for HMM to participate in migration
This commit prepares hmm_range_fault() to participate in page migration by capturing the VMA during page table walks, managing MMU_NOTIFY_MIGRATE invalidations, and clearing range->hmm_pfns at the start of migrating faults.
Quoted 4 lines
mm/hmm.c +0
-0
[ ... ]
Quoted 21 lines
mm/hmm.c +11
-2@@ -694,19 +774,45 @@ static int hmm_range_fault_locked(struct hmm_range *range, bool *locked) {struct hmm_vma_walk hmm_vma_walk = { .range = range, - .locked = locked, + .mmlocked = locked, .last = range->start, }; -struct mm_struct *mm = range->notifier->mm; +/* +* Could be serving a device fault or come from migrate +* entry point. For the former we have not resolved the vma +* yet, and the latter we don't have a notifier (but have a vma). +* +*/ +struct mm_struct *mm =hmm_range_fault_mm (range);int ret; +/* Migration is incompatible with mmap lock drop */ +if (locked &&hmm_select_migrate (range)) +return -EINVAL ;
mm/hmm.c static int hmm_range_fault_locked(struct hmm_range *range, bool *locked) · line 801
Quoted 10 lines
mm/hmm.c +10
-0+ +/* +* Migration takes its requests only from default_flags, so the input +* pfns carry nothing. Clear them so that collected entries can be +* told apart reliably during the walk and on rollback. +*/ +if (hmm_select_migrate (range)) { +WARN_ON_ONCE (range->pfn_flags_mask); +WARN_ON_ONCE (range->dev_private_owner != + range->migrate->pgmap_owner);
[Severity: Low]
Will this break the build when CONFIG_HMM_MIRROR=y and CONFIG_MIGRATION=n?
Several Kconfig options (such as CONFIG_INFINIBAND_ON_DEMAND_PAGING and CONFIG_DRM_AMDGPU_USERPTR) select CONFIG_HMM_MIRROR without depending on CONFIG_MIGRATION. In include/linux/hmm.h, struct migrate_vma is only forward-declared, and in include/linux/migrate.h, its definition is guarded by #ifdef CONFIG_MIGRATION while a stub is provided for hmm_select_migrate() when !CONFIG_MIGRATION.
Even though hmm_select_migrate(range) returns 0 when CONFIG_MIGRATION is disabled, the compiler still type-checks range->migrate->pgmap_owner inside hmm_range_fault_locked() in mm/hmm.c and fails due to dereferencing a pointer to an incomplete type.
Should this check be moved into a helper in include/linux/migrate.h with a matching !CONFIG_MIGRATION stub?
Quoted 7 lines
mm/hmm.c +5
-0+memset (range->hmm_pfns,0 , + ((range->end - range->start) >>PAGE_SHIFT ) * +sizeof (*range->hmm_pfns)); + } +mmap_assert_locked (mm);
mm/hmm.c static int hmm_range_fault_locked(struct hmm_range *range, bool *locked) · line 815
Quoted 10 lines
mm/hmm.c +5
-3do { /* If range is no longer valid force retry. */ - if (mmu_interval_check_retry(range->notifier, - range->notifier_seq)) - return -EBUSY; + if (range->notifier && mmu_interval_check_retry(range->notifier, + range->notifier_seq)) { + ret = -EBUSY; + break; + }
[Severity: High]
Can unconditionally calling memset() on range->hmm_pfns in hmm_range_fault_locked() cause a self-deadlock on the folio lock or leak locked folios when a migrating hmm_range_fault() call is retried after -EBUSY?
When migration is enabled in this series with range->notifier set (such as in dmirror_range_fault() in lib/test_hmm.c), walk_page_range() collects present pages by locking each folio, elevating its reference count, installing a migration PTE, and marking range->hmm_pfns[i] with HMM_PFN_VALID | HMM_PFN_MIGRATE.
If a later page in the range needs a fault, walk_page_range() returns HMM_FAULT_PENDING, hmm_vma_migrate_disarm() closes the MMU_NOTIFY_MIGRATE invalidation, and hmm_do_fault() calls handle_mm_fault() while the previously collected folios stay locked by current and mapped as migration PTEs. If handle_mm_fault() or a concurrent operation triggers an MMU notifier invalidation, mmu_interval_check_retry() on the next loop iteration returns true and hmm_range_fault_locked() exits with -EBUSY (or the caller retries after mmu_interval_read_retry() fails).
When the caller retries hmm_range_fault(range) with the same range->hmm_pfns array, the unconditional memset(range->hmm_pfns, 0, ...) at the top of hmm_range_fault_locked() wipes the HMM_PFN_VALID | HMM_PFN_MIGRATE markers for the folios that are still locked and installed as migration PTEs. On the retry walk, hmm_pfn_collected() will return false for those entries, causing hmm_vma_handle_pte() or hmm_vma_walk_pmd() to treat current's own migration entries as another task's migration entries and wait in migration_entry_wait() on a folio already locked by current (or leak the locked folios and migration PTEs if the caller aborts).
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
[email protected]
AI reviewRe: [PATCH v17 04/12] mm/hmm: do the plumbing for HMM to participate in migration
In reply to [email protected]Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] mm/hmm: hmm_vma_walk_pmd() skips remaining PTEs on folio split failure --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] mm/hmm: hmm_vma_walk_pmd() skips remaining PTEs on folio split failure --
commit 467255657c2d81a197c74dccb6095cef3e48051a
Author: Mika Penttilä <[email protected]>
mm/hmm: do the plumbing for HMM to participate in migration
This commit prepares hmm_range_fault() and the HMM pagewalk callbacks for migration collection by adding PMD and PTE locking during the walk and wiring in the migration preparation hooks.
Quoted 4 lines
mm/hmm.c +0
-0
[ ... ]
Quoted 47 lines
mm/hmm.c +27
-6@@ -532,24 +739,65 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,* recover. */ if (pmd_bad (pmd)) { -if (hmm_range_need_fault (hmm_vma_walk, hmm_pfns, npages,0 )) +if (hmm_range_need_fault (hmm_vma_walk, hmm_pfns_start, npages,0 ))return -EFAULT ; -return hmm_pfns_fill (start, end, range,HMM_PFN_ERROR ); +return hmm_pfns_fill (start, end, hmm_vma_walk,HMM_PFN_ERROR ); } - ptep =pte_offset_map (pmdp, addr); -if (!ptep) +if (minfo) { + ptep =pte_offset_map_lock (mm, pmdp, addr, &hmm_vma_walk->ptl); +if (ptep) + hmm_vma_walk->ptelocked = true; + }else { + ptep =pte_offset_map (pmdp, addr); + } +if (!ptep) { + addr = start; goto again; + } +for (; addr < end; addr +=PAGE_SIZE , ptep++, hmm_pfns++) { -int r; r =hmm_vma_handle_pte (walk, addr, end, pmdp, ptep, hmm_pfns);if (r) { -/* hmm_vma_handle_pte() did pte_unmap() */ +/* hmm_vma_handle_pte() did pte_unmap() / pte_unmap_unlock */ +if (unmapped) +flush_tlb_range (walk->vma, start, addr);return r; } + + r =hmm_vma_handle_migrate_prepare (walk, pmdp, ptep, addr, hmm_pfns, &unmapped); +if (r == -EAGAIN ) { +HMM_ASSERT_UNLOCKED (hmm_vma_walk); +if (unmapped) { +flush_tlb_range (walk->vma, start, addr); + unmapped = false; + } + goto again; + } +if (r) {
mm/hmm.c static int hmm_vma_walk_pmd(pmd_t *pmdp, · line 788
Quoted 10 lines
mm/hmm.c +10
-0+/* +* Splitting the folio failed; migrate_vma_split_folio() +* already dropped the PTE lock. Don't migrate the rest +* of the pmd range; addr keeps its valid pfn. +*/ +HMM_ASSERT_UNLOCKED (hmm_vma_walk); +if (unmapped) +flush_tlb_range (walk->vma, start, addr); +return 0 ; + }
[Severity: Medium]
As reported by Sashiko on v16 [1], when hmm_vma_handle_migrate_prepare() returns a non-zero error other than -EAGAIN in hmm_vma_walk_pmd() (such as when migrate_vma_split_folio() fails to split a PTE-mapped large folio in the subsequent patch "mm/hmm: migrate collection in HMM pagewalk - pte level"), does returning 0 here leave the remaining entries in [addr + PAGE_SIZE, end) completely unprocessed?
At the start of a migrating walk, hmm_range_fault_locked() clears range->hmm_pfns[]:
mm/hmm.c:hmm_range_fault_locked() {
...
if (hmm_select_migrate(range)) {
WARN_ON_ONCE(range->pfn_flags_mask);
WARN_ON_ONCE(range->dev_private_owner !=
range->migrate->pgmap_owner);
memset(range->hmm_pfns, 0,
((range->end - range->start) >> PAGE_SHIFT) *
sizeof(*range->hmm_pfns));
}
...
}While the current address addr already ran hmm_vma_handle_pte() and keeps its valid PFN, returning 0 directly from the PTE loop terminates processing for the rest of the PMD range [addr + PAGE_SIZE, end) while reporting success to walk_page_range().
Consequently, for any addresses in [addr + PAGE_SIZE, end), neither hmm_vma_handle_pte() nor hmm_vma_handle_migrate_prepare() is called. Independent migratable pages in that remainder are not collected, unmapped or read-only PTEs are not faulted in even when HMM_PFN_REQ_FAULT is requested, and hmm_range_fault() can return 0 with those range->hmm_pfns[] entries still zeroed and lacking HMM_PFN_VALID.
[1] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
[email protected]
AI reviewRe: [PATCH v17 05/12] mm/hmm: migrate collection in HMM pagewalk - pte level
In reply to [email protected]Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [High] mm/hmm: split of non-anonymous large folios in hmm_vma_handle_migrate_prepare() - [High] mm/hmm…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] mm/hmm: split of non-anonymous large folios in hmm_vma_handle_migrate_prepare()
- [High] mm/hmm: early PMD walk termination on folio split failure in hmm_vma_walk_pmd()
- [High] mm/hmm: reject KSM folios in hmm_vma_handle_migrate_prepare()
--
commit 9b85d918ada9ba7990835bcd807b9973c5976885
Author: Mika Penttilä <[email protected]>
mm/hmm: migrate collection in HMM pagewalk - pte level
This commit implements PTE-level migration preparation and collection in hmm_vma_handle_migrate_prepare(), along with migrate_vma_split_folio() to split PTE-mapped large folios during an HMM page table walk.
Quoted 8 lines
mm/hmm.c +0
-0@@ -495,6 +495,71 @@ static int hmm_vma_handle_absent_pmd(struct mm_walk *walk, unsigned long start,#endif /* CONFIG_ARCH_HAS_PMD_SOFTLEAVES */ #ifdef CONFIG_DEVICE_MIGRATION
[ ... ]
Quoted 8 lines
mm/hmm.c +3
-1@@ -512,8 +582,230 @@ static int hmm_vma_handle_migrate_prepare(const struct mm_walk *walk,unsigned long *hmm_pfn, bool *unmapped) { -// TODO: implement migration entry insertion + struct hmm_vma_walk *hmm_vma_walk = walk->private; +struct hmm_range *range = hmm_vma_walk->range; +struct migrate_vma *migrate = range->migrate;
[ ... ]
Quoted 44 lines
mm/hmm.c +44
-0+if (folio_test_large (folio)) { +int ret; + + ret =migrate_vma_split_folio (folio, + migrate->fault_page, + hmm_vma_walk, + ptep); +if (ret) + goto out_error; +return -EAGAIN ; + } + + pfn =page_to_pfn (page); +if (softleaf_is_device_private_write (entry)) + writable = true; + }else { + pfn =pte_pfn (pte); +if (is_zero_pfn (pfn) && + (minfo &MIGRATE_VMA_SELECT_SYSTEM )) { +/* Like pte_none(): only anonymous memory can be populated */ +if (!vma_is_anonymous (walk->vma)) + goto out; + *hmm_pfn &=HMM_PFN_INOUT_FLAGS ; + *hmm_pfn |=HMM_PFN_MIGRATE ; + goto out; + } + page =vm_normal_page (walk->vma, addr, pte); +if (page && !is_zone_device_page (page) && + !(minfo &MIGRATE_VMA_SELECT_SYSTEM )) { + goto out; + }else if (page &&is_device_coherent_page (page)) { + pgmap =page_pgmap (page); + +if (!(minfo & +MIGRATE_VMA_SELECT_DEVICE_COHERENT ) || + pgmap->owner != migrate->pgmap_owner) + goto out; + } + + folio = page ?page_folio (page) :NULL ; +if (folio &&folio_test_large (folio)) { +int ret; + + ret = migrate_vma_split_folio(folio,
mm/hmm.c static int hmm_vma_handle_migrate_prepare(const struct mm_walk *walk, · line 700
Quoted 10 lines
mm/hmm.c +10
-0+ migrate->fault_page, + hmm_vma_walk, + ptep); +if (ret) + goto out_error; +return -EAGAIN ; + } + + writable =pte_write (pte); + }
[Severity: High]
When walking a private file-backed VMA (which can contain a mix of copy-on-write anonymous pages and read-only pagecache pages), will this attempt to split non-anonymous large pagecache folios before checking folio_test_anon()?
In the pte_present(pte) branch of hmm_vma_handle_migrate_prepare(), migrate_vma_split_folio() is called on any large folio before verifying that the folio is anonymous. If a PTE maps a read-only large file-backed folio in the page cache, migrate_vma_split_folio() drops the PTE lock, takes the sleeping folio_lock(folio) on the pagecache folio while already holding locks on previously collected anonymous folios, and calls split_folio().
For file-backed folios, split_folio() -> __folio_freeze_split_file() takes i_mmap_lock_read() and unmaps the folio without remapping it, leaving the PTEs as pte_none() on the -EAGAIN retry, only for the resulting order-0 pagecache folio to be skipped by the !folio_test_anon() check. Furthermore, if the filesystem sets mapping_min_folio_order() > 0, split_folio() fails with -EINVAL (triggering VM_WARN_ONCE() in __folio_split()) and jumps to out_error.
Should the !page || !folio_test_anon(folio) check happen before attempting to split the folio in the present PTE path?
mm/hmm.c static int hmm_vma_handle_migrate_prepare(const struct mm_walk *walk, · line 704
Quoted 4 lines
mm/hmm.c +4
-0+ +/* Only anonymous memory can be migrated to device memory */ +if (!page || !folio_test_anon (page_folio (page))) + goto out;
[Severity: High]
Can KSM folios pass this check and be collected for device migration?
In include/linux/page-flags.h, FOLIO_MAPPING_KSM is defined as:
FOLIO_MAPPING_ANON | FOLIO_MAPPING_ANON_KSM
Because FOLIO_MAPPING_ANON is set on KSM folios, folio_test_anon() returns true for them. When hmm_range_fault() runs without HMM_PFN_REQ_WRITE (for example during migrate_vma_setup() or a read fault with migration), hmm_vma_handle_pte() does not break CoW on a read-only KSM PTE, and hmm_vma_handle_migrate_prepare() locks and collects the KSM folio.
If the same KSM folio is mapped a second time later in the walked range, hmm_vma_handle_pte() marks the second entry HMM_PFN_VALID before folio_trylock() fails in hmm_vma_handle_migrate_prepare(), and try_to_migrate() later unmaps that second mapping via rmap_walk_ksm(), leaving a stale PFN in range->hmm_pfns. More importantly, migrating a KSM folio to MEMORY_DEVICE_PRIVATE memory updates stable_node->kpfn via folio_migrate_ksm() to a non-CPU-accessible ZONE_DEVICE PFN and installs device-private swap entries into other processes sharing the KSM page, causing ksmd to fault when it later accesses the page in memcmp_pages().
Should hmm_vma_handle_migrate_prepare() also reject folio_test_ksm(folio)?
[ ... ]
Quoted 4 lines
mm/hmm.c +4
-0+set_pte_at (mm, addr, ptep, swp_pte); +folio_remove_rmap_pte (folio, page, walk->vma); +folio_put (folio); + *hmm_pfn |=HMM_PFN_VALID |HMM_PFN_MIGRATE ;
mm/hmm.c static int hmm_vma_handle_migrate_prepare(const struct mm_walk *walk, · line 809
Quoted 10 lines
mm/hmm.c +8
-0+if (pte_present (pte)) + *unmapped = true; + }else { +folio_put (folio); + } +out:return 0 ; +out_error: +return -EFAULT ; }
[Severity: High]
As reported by Sashiko on v16 [1], when migrate_vma_split_folio() fails in hmm_vma_handle_migrate_prepare() and jumps to out_error (-EFAULT), does the caller in hmm_vma_walk_pmd() abort the PMD walk too early and leave the remaining pages in the PMD unprocessed?
In hmm_vma_walk_pmd(), the PTE loop handles non-zero returns from hmm_vma_handle_migrate_prepare() by immediately returning 0:
for (; addr < end; addr += PAGE_SIZE, ptep++, hmm_pfns++) {
r = hmm_vma_handle_pte(walk, addr, end, pmdp, ptep, hmm_pfns);
...
r = hmm_vma_handle_migrate_prepare(walk, pmdp, ptep, addr, hmm_pfns, &unmapped);
if (r == -EAGAIN) {
...
goto again;
}
if (r) {
HMM_ASSERT_UNLOCKED(hmm_vma_walk);
if (unmapped)
flush_tlb_range(walk->vma, start, addr);
return 0;
}
}Because hmm_vma_handle_pte() is called inside the same per-page loop, returning 0 from hmm_vma_walk_pmd() when a split fails at addr skips both hmm_vma_handle_pte() and hmm_vma_handle_migrate_prepare() for all remaining addresses in [addr + PAGE_SIZE, end) of the PMD. As a result, hmm_range_fault() can return 0 (success) while range->hmm_pfns[] entries for [addr + PAGE_SIZE, end) remain zeroed without HMM_PFN_VALID, and pages in that tail of the PMD are neither faulted in (when HMM_PFN_REQ_FAULT is requested) nor migrated.
[1] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
[email protected]
AI reviewRe: [PATCH v17 06/12] mm/hmm: migrate collection in HMM pagewalk - pmd level
In reply to [email protected]Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider: - [High] mm/hmm: missing folio_test_anon() check in hmm_vma_handle_migrate_prepare_pmd() - [High] mm/hmm…
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] mm/hmm: missing folio_test_anon() check in hmm_vma_handle_migrate_prepare_pmd()
- [High] mm/hmm: missing device-coherent checks in hmm_vma_handle_migrate_prepare_pmd()
- [High] mm/hmm: ABBA folio lock deadlock in migrate_vma_split_folio()
- [Medium] mm/hmm: PMD split in hmm_vma_handle_migrate_prepare_pmd() aborts notifier walk --
commit 2ed090a278a29feb7fac7d83140b748506dedc9e
Author: Mika Penttilä <[email protected]>
mm/hmm: migrate collection in HMM pagewalk - pmd level
This commit implements hmm_vma_handle_migrate_prepare_pmd() to collect PMD-mapped THPs or split them into PTEs during HMM pagewalk migration, and factors out __migrate_vma_split_folio() for splitting folios.
Quoted 15 lines
mm/hmm.c +0
-2@@ -511,9 +537,7 @@ static int migrate_vma_split_folio(struct folio *folio,struct hmm_vma_walk *hmm_vma_walk, pte_t *ptep) { - int ret; struct folio *fault_folio = fault_page ? page_folio(fault_page) : NULL; -struct folio *new_fault_folio =NULL ;/* * Take the reference while still holding the PTE lock, so the folio
mm/hmm.c static int migrate_vma_split_folio(struct folio *folio, · line 558
Quoted 8 lines
mm/hmm.c +2
-3@@ -530,44 +554,136 @@ static int migrate_vma_split_folio(struct folio *folio,if (folio != fault_folio)folio_lock (folio); - ret =split_folio (folio); -if (ret) { -if (folio != fault_folio) { +return __migrate_vma_split_folio (folio, fault_page); +}
[Severity: High]
Can calling folio_lock(folio) in migrate_vma_split_folio() cause an ABBA deadlock when another folio is already held locked in the walk?
During a migrating hmm_range_fault() walk, the calling thread already holds folio locks on fault_folio (when called from do_swap_page() -> migrate_to_ram()) as well as on any folios collected at earlier addresses in the range via hmm_vma_handle_migrate_prepare_pmd() or hmm_vma_handle_migrate_prepare().
While normal collection in hmm_vma_handle_migrate_prepare() and hmm_vma_handle_migrate_prepare_pmd() uses folio_trylock() to avoid deadlocking against concurrent migrations or faults, migrate_vma_split_folio() drops the PTE lock and sleeps unconditionally in folio_lock(folio):
Thread 1 Thread 2
holds folio A locked
(fault_folio or earlier entry) holds folio B locked
hmm_vma_handle_migrate_prepare()
migrate_vma_split_folio(folio B)
folio_lock(folio B) migrate_vma_split_folio(folio A)
folio_lock(folio A) (or migration_entry_wait(folio A))
Should migrate_vma_split_folio() also use folio_trylock(folio) and skip migrating the folio if it cannot be locked?
Quoted 28 lines
mm/hmm.c +28
-0+ +static int hmm_vma_handle_migrate_prepare_pmd (const struct mm_walk *walk, +pmd_t *pmdp, +unsigned long start, +unsigned long end, +unsigned long *hmm_pfn) +{ +struct hmm_vma_walk *hmm_vma_walk = walk->private; +struct hmm_range *range = hmm_vma_walk->range; +struct migrate_vma *migrate = range->migrate; +struct folio *fault_folio =NULL ; +enum migrate_vma_info minfo; +struct folio *folio; +unsigned long i; +int r =0 ; + +// Do we want to migrate at all? + minfo =hmm_select_migrate (range); +if (!minfo) +return r; + +WARN_ON_ONCE (!migrate); +HMM_ASSERT_PMD_LOCKED (hmm_vma_walk, true); + + fault_folio = migrate->fault_page ? +page_folio (migrate->fault_page) :NULL ; + +if (pmd_none (*pmdp))
mm/hmm.c static int migrate_vma_split_folio(struct folio *folio, · line 596
Quoted 10 lines
mm/hmm.c +10
-0+return hmm_pfns_fill (start, end, hmm_vma_walk,0 ); + +/* Like at the pte level, NUMA hinting (protnone) pmds are migrated */ +if (!(hmm_pfn[0 ] &HMM_PFN_VALID ) && + !(pmd_trans_huge (*pmdp) &&pmd_protnone (*pmdp))) + goto out; + +if (pmd_trans_huge (*pmdp)) { +if (!(minfo &MIGRATE_VMA_SELECT_SYSTEM )) + goto out;
[Severity: High]
How are PMD-mapped MEMORY_DEVICE_COHERENT folios handled here?
Compound device-coherent folios are mapped as present huge PMDs where pmd_trans_huge(*pmdp) is true (via migrate_vma_insert_huge_pmd_page() and remove_migration_pmd()). At the PTE level, hmm_vma_handle_migrate_prepare() distinguishes system memory from device-coherent pages:
mm/hmm.c:hmm_vma_handle_migrate_prepare() {
...
page = vm_normal_page(walk->vma, addr, pte);
if (page && !is_zone_device_page(page) &&
!(minfo & MIGRATE_VMA_SELECT_SYSTEM)) {
goto out;
} else if (page && is_device_coherent_page(page)) {
pgmap = page_pgmap(page);
if (!(minfo &
MIGRATE_VMA_SELECT_DEVICE_COHERENT) ||
pgmap->owner != migrate->pgmap_owner)
goto out;
}
...
}In hmm_vma_handle_migrate_prepare_pmd(), requiring MIGRATE_VMA_SELECT_SYSTEM for all pmd_trans_huge(*pmdp) entries without checking folio_is_zone_device(folio), folio_is_device_coherent(folio), MIGRATE_VMA_SELECT_DEVICE_COHERENT, or folio->pgmap->owner means that migrating device-coherent memory to system RAM with MIGRATE_VMA_SELECT_DEVICE_COHERENT skips present device-coherent huge PMDs, while migrating with MIGRATE_VMA_SELECT_SYSTEM collects or splits device-coherent huge PMDs regardless of pgmap->owner.
Does the pmd_trans_huge(*pmdp) branch need the same zone_device and device_coherent checks as hmm_vma_handle_migrate_prepare()?
mm/hmm.c static int migrate_vma_split_folio(struct folio *folio, · line 602
Quoted 6 lines
mm/hmm.c +6
-0+ + folio =pmd_folio (*pmdp); +if (is_huge_zero_folio (folio)) +return hmm_pfns_fill (start, end, hmm_vma_walk,0 ); + + }else if (!pmd_present (*pmdp)) {
[Severity: High]
Should hmm_vma_handle_migrate_prepare_pmd() check folio_test_anon(folio) before collecting or splitting a PMD-mapped folio?
At the PTE level, hmm_vma_handle_migrate_prepare() rejects non-anonymous folios:
mm/hmm.c:hmm_vma_handle_migrate_prepare() {
...
/* Only anonymous memory can be migrated to device memory */
if (!page || !folio_test_anon(page_folio(page)))
goto out;
...
}Because hmm_vma_capture_migrate_range() and migrate_vma_setup() allow file and shmem VMAs, a PMD in such a VMA can map a non-anonymous THP. Without a folio_test_anon(folio) check in hmm_vma_handle_migrate_prepare_pmd():
1. If compound migration is selected, the page-cache folio is locked and a PMD migration entry is installed with HMM_PFN_MIGRATE | HMM_PFN_COMPOUND. Holding a page-cache folio locked while hmm_do_fault() -> handle_mm_fault() faults subsequent pages in the VMA inverts the mapping->invalidate_lock -> folio_lock ordering. If the caller later splits the unmapped compound folio in __migrate_device_pages() -> migrate_vma_split_unmapped_folio(), split_huge_pmd_address() zaps the non-anonymous PMD without dropping the extra folio reference, and folio_split_unmapped() triggers VM_WARN_ON_ONCE_FOLIO(!folio_test_anon(folio), folio) before running __folio_freeze_split_anon() on a page-cache folio:
mm/huge_memory.c:folio_split_unmapped() {
VM_WARN_ON_ONCE_FOLIO(folio_mapped(folio), folio);
VM_WARN_ON_ONCE_FOLIO(!folio_test_locked(folio), folio);
VM_WARN_ON_ONCE_FOLIO(!folio_test_large(folio), folio);
VM_WARN_ON_ONCE_FOLIO(!folio_test_anon(folio), folio);
return __folio_freeze_split_anon(folio, new_order, &folio->page,
false, NULL, SPLIT_TYPE_UNIFORM);
}2. If the split fallback is taken, __migrate_vma_split_folio() -> split_folio() -> __folio_freeze_split_file() acquires i_mmap_lock_read(mapping) while holding locks on previously collected folios and unmaps the file folio completely via unmap_folio(). If the split fails after unmapping, hmm_vma_handle_migrate_prepare_pmd() returns 0 with stale HMM_PFN_VALID entries for a zapped PMD; if it succeeds, the re-walk finds pte_none entries and loses the valid PFNs when HMM_PFN_REQ_FAULT is not set.
[ ... ]
Quoted 48 lines
mm/hmm.c +16
-22+split: +spin_unlock (hmm_vma_walk->ptl); + hmm_vma_walk->pmdlocked = false;/* -* Ensure the lock is held on the correct -* folio after the split +* folio_get() above took an extra reference. For the fault folio the +* caller still holds a reference and the lock, which is the +* precondition of __migrate_vma_split_folio(), so drop the extra one. */ -if (!new_fault_folio) { -folio_unlock (folio); +if (folio == fault_folio)folio_put (folio); - }else if (folio != new_fault_folio) { -if (new_fault_folio != fault_folio) { -folio_get (new_fault_folio); -folio_lock (new_fault_folio); - } -folio_unlock (folio); -folio_put (folio); - } -return 0 ; -} +/* Split failed: not migrated, the valid pfns stay as reported */ +if (__migrate_vma_split_folio (folio, migrate->fault_page)) +return 0 ; -static int hmm_vma_handle_migrate_prepare_pmd (const struct mm_walk *walk, -pmd_t *pmdp, -unsigned long start, -unsigned long end, -unsigned long *hmm_pfn) -{ -// TODO: implement migration entry insertion -return 0 ; +/* Re-walked as PTEs from start: drop the pmd-level output */ +for (i =0 ; i < (end - start) >>PAGE_SHIFT ; i++) + hmm_pfn[i] &=HMM_PFN_INOUT_FLAGS ; + + hmm_vma_walk->last = start; +return -EBUSY ; }/*
mm/hmm.c static int hmm_vma_walk_pmd(pmd_t *pmdp, · line 1141
Quoted 10 lines
mm/hmm.c +5
-0@@ -1016,6 +1132,11 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp, hmm_vma_walk->pmdlocked = false; } +/* +* hmm_vma_handle_migrate_prepare_pmd() splits the huge pmd in +* place when needed and returns -EBUSY to re-walk the range as +* PTEs. +*/ return r; }
[Severity: Medium]
When range->notifier is set during a migrating hmm_range_fault() call, does returning -EBUSY out of walk_page_range() after splitting a PMD cause hmm_range_fault_locked() to abort the walk instead of re-walking the split PMD as PTEs?
In hmm_vma_handle_migrate_prepare_pmd(), __migrate_vma_split_folio() calls split_folio() or split_huge_page() -> __folio_split() -> __folio_freeze_split_anon() -> unmap_folio() -> try_to_migrate_one(), which invokes mmu_notifier_invalidate_range_start() with MMU_NOTIFY_CLEAR and range.owner == NULL. Because the event is MMU_NOTIFY_CLEAR rather than MMU_NOTIFY_MIGRATE with range->dev_private_owner, the registered mmu_interval_notifier updates range->notifier->invalidate_seq.
When hmm_vma_handle_migrate_prepare_pmd() and hmm_vma_walk_pmd() return -EBUSY back to hmm_range_fault_locked(), the next iteration of the loop checks mmu_interval_check_retry():
mm/hmm.c:hmm_range_fault_locked() {
...
do {
/* If range is no longer valid force retry. */
if (range->notifier && mmu_interval_check_retry(range->notifier,
range->notifier_seq)) {
ret = -EBUSY;
break;
}
ret = walk_page_range(mm, hmm_vma_walk.last, range->end,
&hmm_walk_ops, &hmm_vma_walk);
...
}Because range->notifier was invalidated by the split, mmu_interval_check_retry() returns true and hmm_range_fault_locked() breaks out with -EBUSY, forcing a full rollback and retry of the range. By contrast, the PTE-level split in hmm_vma_handle_migrate_prepare() returns -EAGAIN and restarts locally at the again label inside hmm_vma_walk_pmd() without returning to hmm_range_fault_locked().
Could hmm_vma_walk_pmd() similarly loop locally to the again label when hmm_vma_handle_migrate_prepare_pmd() splits the PMD?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
[email protected]
AI reviewRe: [PATCH v17 08/12] mm/hmm: implement rollback for device page migration in HMM pagewalk
In reply to [email protected]Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [High] mm/hmm: missing rollback of prior entries when restarting after fault - [High] mm/hmm: missing…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] mm/hmm: missing rollback of prior entries when restarting after fault
- [High] mm/hmm: missing rollback and incomplete walk on folio split failure
- [High] mm/hmm: self-deadlock on -EBUSY retry due to memset() of hmm_pfns --
commit 57b87c4290e06aea8db775c69fa86c746acfe43d
Author: Mika Penttilä <[email protected]>
mm/hmm: implement rollback for device page migration in HMM pagewalk
This commit adds rollback handling to unlock and unreference already collected folios if page tables vanish or change while page table locks are dropped during a migration pagewalk. It also skips migration PTEs installed earlier in the same walk when restarting a PMD walk.
Quoted 4 lines
mm/hmm.c +0
-0
[ ... ]
mm/hmm.c static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, · line 354
Quoted 12 lines
mm/hmm.c +8
-0@@ -331,6 +344,15 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,if (!pte_present (pte)) {const softleaf_t entry =softleaf_from_pte (pte); +/* +* Our own migration entry, collected earlier in this walk: +* keep the collected pfn, don't fault or roll it back. +*/ +if (softleaf_is_migration (entry) &&hmm_select_migrate (range) && +hmm_pfn_collected (*hmm_pfn) && +hmm_pfn_to_page (*hmm_pfn) ==softleaf_to_page (entry)) +return 0 ;
[Severity: High]
When hmm_range_fault_locked() aborts with -EBUSY (or a caller retries hmm_range_fault() after mmu_interval_read_retry() trips) after collecting earlier pages in the range, those folios remain locked, referenced, and mapped as migration PTEs.
When the caller retries hmm_range_fault() with the same range and hmm_pfns array, hmm_range_fault_locked() zeroes range->hmm_pfns:
mm/hmm.c:hmm_range_fault_locked() {
...
if (hmm_select_migrate(range)) {
WARN_ON_ONCE(range->pfn_flags_mask);
WARN_ON_ONCE(range->dev_private_owner !=
range->migrate->pgmap_owner);
memset(range->hmm_pfns, 0,
((range->end - range->start) >> PAGE_SHIFT) *
sizeof(*range->hmm_pfns));
}
...
}On the retry walk, hmm_pfn_collected(*hmm_pfn) evaluates to false for the migration PTEs installed by the current thread on the previous attempt. Does this cause hmm_vma_handle_pte() and hmm_vma_walk_pmd() to treat our own migration entries as belonging to another thread and call hmm_do_fault()->handle_mm_fault()->migration_entry_wait() on folios already locked by current, resulting in a self-deadlock?
Quoted 24 lines
mm/hmm.c +9
-1+/* * Don't fault in device private pages owned by the caller, * just report the PFN. @@ -416,6 +438,9 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, new_pfn_flags =pte_pfn (pte) | cpu_flags; out: +hmm_vma_handle_migrate_prepare_rollback (hmm_vma_walk, addr, + addr +PAGE_SIZE , + hmm_pfn); *hmm_pfn = (*hmm_pfn &HMM_PFN_INOUT_FLAGS ) | new_pfn_flags;return 0 ;@@ -427,7 +452,19 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, }else {pte_unmap (ptep); } -/* Fault any virtual address we were asked to fault */ +/* +* This pte needs a fault, so it is not our migration entry: a pfn +* collected here earlier is gone, roll it back before faulting. +*/ + hmm_vma_handle_migrate_prepare_rollback(hmm_vma_walk, addr,
mm/hmm.c static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, · line 469
Quoted 10 lines
mm/hmm.c +8
-0+ addr + PAGE_SIZE, hmm_pfn); +/* +* Fault any virtual address we were asked to fault. When migrating, +* only this page: later ptes may be our own migration entries or +* caller owned device private pages, which must not be faulted. +*/ +if (hmm_select_migrate (range)) + end = addr +PAGE_SIZE ;return hmm_record_fault (addr, end, required_fault, walk); }
[Severity: High]
As reported by Sashiko on v16 [1], when a PTE fault occurs at addr after earlier PTEs at addresses below addr have already been collected by hmm_vma_handle_migrate_prepare(), the fault path drops hmm_vma_walk->ptl, rolls back only [addr, addr + PAGE_SIZE), and calls hmm_record_fault(), which sets hmm_vma_walk->last = addr and returns HMM_FAULT_PENDING.
In hmm_range_fault_locked(), HMM_FAULT_PENDING disarms the migration invalidation range via hmm_vma_migrate_disarm() and runs hmm_do_fault() without holding any page table spinlock, then resumes walk_page_range() at hmm_vma_walk.last:
mm/hmm.c:hmm_range_fault_locked() {
...
ret = walk_page_range(mm, hmm_vma_walk.last, range->end,
&hmm_walk_ops, &hmm_vma_walk);
if (ret == HMM_FAULT_PENDING) {
hmm_vma_migrate_disarm(&hmm_vma_walk);
ret = hmm_do_fault(mm, &hmm_vma_walk);
...
}Because walk_page_range() restarts at addr rather than range->start, hmm_vma_walk_pmd() is invoked with start = addr (and any earlier PMDs in [range->start, addr) are skipped completely).
If the migration PTEs or PTE page table covering [range->start, addr) were zapped or replaced while locks were dropped during hmm_do_fault(), can those earlier collected entries in range->hmm_pfns ever be revisited or rolled back, or will they leak folio locks and references?
[ ... ]
mm/hmm.c static int hmm_vma_walk_pmd(pmd_t *pmdp, · line 1322
Quoted 13 lines
mm/hmm.c +6
-0@@ -1192,6 +1311,12 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,flush_tlb_range (walk->vma, start, addr); unmapped = false; } +/* +* The pte lock was dropped and the pte table may have +* changed: re-walk from start. Our own migration entries +* are kept, anything else collected is rolled back. +*/ + addr = start; goto again; }if (r) {
[Severity: High]
When hmm_vma_handle_migrate_prepare() attempts to split a large folio via migrate_vma_split_folio(), it unconditionally drops hmm_vma_walk->ptl and sleeps on folio_lock() before calling __migrate_vma_split_folio():
mm/hmm.c:migrate_vma_split_folio() {
...
lazy_mmu_mode_disable();
pte_unmap_unlock(ptep, hmm_vma_walk->ptl);
hmm_vma_walk->ptelocked = false;
if (folio != fault_folio)
folio_lock(folio);
return __migrate_vma_split_folio(folio, fault_page);
}If __migrate_vma_split_folio() fails, hmm_vma_handle_migrate_prepare() returns -EFAULT, and the if (r) branch in hmm_vma_walk_pmd() flushes the TLB and returns 0 immediately:
mm/hmm.c:hmm_vma_walk_pmd() {
...
if (r) {
/*
* Splitting the folio failed; migrate_vma_split_folio()
* already dropped the PTE lock. Don't migrate the rest
* of the pmd range; addr keeps its valid pfn.
*/
HMM_ASSERT_UNLOCKED(hmm_vma_walk);
if (unmapped)
flush_tlb_range(walk->vma, start, addr);
return 0;
}
...
}Since the PTE lock was dropped while waiting on folio_lock(), if migration PTEs or the PTE table in [start, end) vanished during that window, won't returning 0 without re-walking [start, end) skip rolling back those collected folios, and also leave range->hmm_pfns unpopulated for the remaining addresses in [addr + PAGE_SIZE, end)?
[1] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8
[email protected]
AI reviewRe: [PATCH v17 10/12] lib/test_hmm: add a new testcase for the migrate on fault
In reply to [email protected]Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [High] mm: test_hmm: deadlock and folio leak on retry in dmirror_range_fault() - [Medium] mm: test_hmm…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] mm: test_hmm: deadlock and folio leak on retry in dmirror_range_fault()
- [Medium] mm: test_hmm: unmapped device pages on retry in do_fault_and_migrate()
- [Low] lib/test_hmm: excessive stack frame in dmirror_fault_and_migrate_to_device() --
commit 7670468c9cdf50d8e222db90061981491fa308c8
Author: Mika Penttilä <[email protected]>
lib/test_hmm: add a new testcase for the migrate on fault
This commit adds a migrate-on-fault testcase to the HMM test driver and selftests using HMM_PFN_REQ_FAULT | HMM_PFN_REQ_MIGRATE with hmm_range_fault() to fault in and migrate ranges to device-private memory.
Quoted 40 lines
lib/test_hmm.c +11
-3@@ -36,6 +36,7 @@#define DMIRROR_RANGE_FAULT_TIMEOUT 1000#define DEVMEM_CHUNK_SIZE (256 * 1024 * 1024U)#define DEVMEM_CHUNKS_RESERVE 16 +#define PFNS_ARRAY_SIZE 64/* * For device_private pages, dpage is just a dummy struct page @@ -355,6 +356,7 @@ static int dmirror_range_fault(struct dmirror *dmirror,struct mm_struct *mm = dmirror->notifier.mm;unsigned long timeout = jiffies +msecs_to_jiffies (HMM_RANGE_DEFAULT_TIMEOUT ); +bool migrate = range->default_flags &HMM_PFN_REQ_MIGRATE ;int ret;while (true) {@@ -364,9 +366,15 @@ static int dmirror_range_fault(struct dmirror *dmirror, } range->notifier_seq =mmu_interval_read_begin (range->notifier); -mmap_read_lock (mm); - ret =hmm_range_fault (range); -mmap_read_unlock (mm); + +/* mmap lock held for whole migrate on fault operation */ +if (!migrate) { +mmap_read_lock (mm); + ret =hmm_range_fault (range); +mmap_read_unlock (mm); + }else { + ret =hmm_range_fault (range); + }if (ret) {if (ret == -EBUSY )continue ;
lib/test_hmm.c static int dmirror_range_fault(struct dmirror *dmirror, · line 398
Quoted 10 lines
lib/test_hmm.c +3
-1@@ -382,7 +390,9 @@ static int dmirror_range_fault(struct dmirror *dmirror,break ; } - ret =dmirror_do_fault (dmirror, range); +/* update device page table after migration */ +if (!migrate) + ret =dmirror_do_fault (dmirror, range);mutex_unlock (&dmirror->mutex); out:
[Severity: High]
Can retrying inside dmirror_range_fault() when migrate is true cause a self-deadlock and leak folio locks and references?
During the first call to hmm_range_fault(), hmm_vma_handle_migrate_prepare() and hmm_vma_handle_migrate_prepare_pmd() collect present pages by locking the folio, taking a folio reference, installing a migration PTE, and setting HMM_PFN_VALID | HMM_PFN_MIGRATE in range->hmm_pfns.
If hmm_range_fault() returns -EBUSY, or if hmm_range_fault() returns 0 and mmu_interval_read_retry() trips in dmirror_range_fault() (for example, after migrate_vma_split_folio() splits a PTE-mapped large folio and fires MMU_NOTIFY_CLEAR, or due to a concurrent invalidation), dmirror_range_fault() loops back via continue without returning to do_fault_and_migrate() to abort and finalize the already-collected migration entries.
On the next iteration of the loop in dmirror_range_fault(), calling hmm_range_fault() -> hmm_range_fault_locked() zeroes range->hmm_pfns:
mm/hmm.c:hmm_range_fault_locked()
if (hmm_select_migrate(range)) {
WARN_ON_ONCE(range->pfn_flags_mask);
WARN_ON_ONCE(range->dev_private_owner !=
range->migrate->pgmap_owner);
memset(range->hmm_pfns, 0,
((range->end - range->start) >> PAGE_SHIFT) *
sizeof(*range->hmm_pfns));
}When the retry walk visits the migration PTEs installed by the previous attempt, hmm_pfn_collected(*hmm_pfn) evaluates to false in hmm_vma_handle_pte() because *hmm_pfn was zeroed:
mm/hmm.c:hmm_vma_handle_pte()
if (softleaf_is_migration(entry) && hmm_select_migrate(range) && hmm_pfn_collected(*hmm_pfn) && hmm_pfn_to_page(*hmm_pfn) == softleaf_to_page(entry)) return 0;
It then treats its own migration entry as an external migration entry and calls hmm_do_fault() -> handle_mm_fault() -> migration_entry_wait(), waiting forever on the folio lock already held by current. In addition, if any collected PTEs were unmapped before the retry walk (or if the retry walk fails or times out before revisiting them), zeroing range->hmm_pfns prevents hmm_vma_handle_migrate_prepare_rollback() and migrate_hmm_range_setup() / migrate_vma_finalize() from unlocking those folios and dropping their references.
Furthermore, if dmirror_range_fault() times out at time_after(jiffies, timeout) before calling hmm_range_fault() on a subsequent subrange chunk, do_fault_and_migrate() still runs migrate_hmm_range_setup(), migrate_vma_pages(), and migrate_vma_finalize() on the stale src_pfns and migrate->start/end state from the previous chunk.
Should dmirror_range_fault() return -EBUSY to do_fault_and_migrate() when migrate is true so the caller can run the migrate_hmm_range_setup(), migrate_vma_pages(), and migrate_vma_finalize() cleanup before retrying?
[ ... ]
Quoted 42 lines
lib/test_hmm.c +38
-0@@ -1377,6 +1398,127 @@ static int dmirror_migrate_to_device(struct dmirror *dmirror,return ret; } +static int do_fault_and_migrate (struct dmirror *dmirror,struct hmm_range *range) +{ +struct migrate_vma *migrate = range->migrate; +unsigned long timeout = + jiffies +msecs_to_jiffies (HMM_RANGE_DEFAULT_TIMEOUT ); +int ret; + + do { + mmap_read_lock(dmirror->notifier.mm); + + /* Fault-in pages for migration */ + ret = dmirror_range_fault(dmirror, range); + /* + * Set this up even on error: hmm_range_fault() may have collected + * part of the range before failing. + */ + migrate_hmm_range_setup(range); + if (ret) { + /* + * dst[] entries are empty, so this marks every collected + * migration as failed. finalize then restores the source + * mappings and drops the associated locks/references. + */ + migrate_vma_pages(migrate); + migrate_vma_finalize(migrate); + goto unlock; + } + + pr_debug("Migrating from sys mem to device mem\n"); + + dmirror_migrate_alloc_and_copy(migrate, dmirror); + migrate_vma_pages(migrate); + + mutex_lock(&dmirror->mutex); + if (mmu_interval_read_retry(&dmirror->notifier, + range->notifier_seq)) + ret = -EBUSY; + else
lib/test_hmm.c static int dmirror_migrate_to_device(struct dmirror *dmirror, · line 1448
Quoted 10 lines
lib/test_hmm.c +10
-0+ ret =__dmirror_migrate_map_locked (migrate, dmirror); +mutex_unlock (&dmirror->mutex); + +migrate_vma_finalize (migrate); +unlock: +mmap_read_unlock (dmirror->notifier.mm); + }while (ret == -EBUSY && !time_after (jiffies, timeout)); + +return ret; +}
[Severity: Medium]
As reported by Sashiko on v16 [1], when mmu_interval_read_retry() returns true in do_fault_and_migrate() after migrate_vma_pages() has executed, can this leave migrated device-private pages unmapped in dmirror->pt and cause dmirror_fault_and_migrate_to_device() to fail with -ENOENT?
When mmu_interval_read_retry() trips here (for example, due to an invalidation anywhere in the process mm since dmirror->notifier covers the entire address space, or a partial zap, or split_huge_pmd() in migrate_vma_insert_page()), __dmirror_migrate_map_locked() is skipped, while migrate_vma_finalize() still commits any non-zapped migration PTEs to device-private memory (and migrate_vma_insert_page() has already installed device-private PTEs for pte_none or zero-page entries).
On the subsequent -EBUSY retry iteration of do_fault_and_migrate(), those already-committed device-private pages are reported by hmm_vma_handle_pte() as HMM_PFN_VALID without HMM_PFN_MIGRATE because migrate.flags only sets MIGRATE_VMA_SELECT_SYSTEM, and dmirror_range_fault() skips dmirror_do_fault() because HMM_PFN_REQ_MIGRATE is set.
Although the commit message notes that a real device would map committed pages on its next fault, dmirror_fault_and_migrate_to_device() immediately verifies the range by calling dmirror_do_read() directly without a fault retry loop:
mutex_lock(&dmirror->mutex); ret = dmirror_do_read(dmirror, start, end, &bounce); mutex_unlock(&dmirror->mutex);
Wouldn't dmirror_do_read() find no entry in dmirror->pt for those already-migrated pages and fail the ioctl with -ENOENT?
lib/test_hmm.c static int dmirror_migrate_to_device(struct dmirror *dmirror, · line 1458
Quoted 10 lines
lib/test_hmm.c +10
-0+ +static int dmirror_fault_and_migrate_to_device (struct dmirror *dmirror, +struct hmm_dmirror_cmd *cmd) +{ +unsigned long start, size, end, next; +unsigned long src_pfns[PFNS_ARRAY_SIZE ] = {0 }; +unsigned long dst_pfns[PFNS_ARRAY_SIZE ] = {0 }; +struct migrate_vma migrate = {0 }; +struct hmm_range range = {0 }; +struct dmirror_bounce bounce;
[Severity: Low]
Does allocating src_pfns[64] and dst_pfns[64] on the stack in dmirror_fault_and_migrate_to_device() risk triggering -Wframe-larger-than warnings?
On 64-bit architectures, src_pfns and dst_pfns alone consume 1024 bytes of stack space alongside struct migrate_vma, struct hmm_range, and struct dmirror_bounce (exceeding 1230 bytes of local variables before saved registers and inlining do_fault_and_migrate()).
Commit 6046a3bed1c2 ("lib/test_hmm: reduce stack usage") previously had to reduce the 64-element stack arrays in dmirror_migrate_to_device() after hitting a 1408-byte stack frame build failure, and commit 775465fd26a3 ("lib/test_hmm: use kvcalloc() for src/dst pfns allocation") moved dmirror_migrate_to_device() and dmirror_migrate_to_system() to dynamic allocation with kvcalloc(). Should dmirror_fault_and_migrate_to_device() also use kvcalloc() or a smaller PFNS_ARRAY_SIZE?
[1] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=10
[email protected]
AI reviewRe: [PATCH v17 09/12] mm: enable device page migration from HMM pagewalk
In reply to [email protected]Thank you for your contribution! Sashiko AI review found 8 potential issue(s) to consider: - [Critical] mm: hmm_range_fault_locked() zeroes hmm_pfns on -EBUSY migration retry - [Critical] mm/hmm…
Thank you for your contribution! Sashiko AI review found 8 potential issue(s) to consider:
- [Critical] mm: hmm_range_fault_locked() zeroes hmm_pfns on -EBUSY migration retry
- [Critical] mm/hmm: missing rollback of earlier entries after fault in hmm_range_fault()
- [High] mm: missing folio_test_anon() check in hmm_vma_handle_migrate_prepare_pmd()
- [High] mm: early return in hmm_vma_walk_pmd() on folio split failure skips PTEs
- [High] mm/hmm: folio_lock deadlock in migrate_vma_split_folio() and hmm_do_fault()
- [Medium] mm: lost MIGRATE_PFN_WRITE on writable protnone entries in HMM migration
- [Low] mm: build failure on incomplete struct migrate_vma when !CONFIG_MIGRATION
- [Low] mm/migrate_device: unused MIGRATE_VMA_FAULT and MIGRATE_VMA_WRITE flags in migrate_vma_setup() --
commit 00843344cdcc1e298091d82f4ddd5b2d3478ddb1
Author: Mika Penttilä <[email protected]>
mm: enable device page migration from HMM pagewalk
This commit enables migration collection in hmm_range_fault() via hmm_select_migrate(), switches migrate_vma_setup() to use the HMM pagewalk path with new MIGRATE_VMA_FAULT and MIGRATE_VMA_WRITE flags, and removes the old migrate_vma_collect() page table walk helpers.
include/linux/migrate.h enum migrate_vma_info { · line 186
Quoted 11 lines
include/linux/migrate.h +2
-0@@ -181,6 +181,8 @@ enum migrate_vma_info {MIGRATE_VMA_SELECT_DEVICE_PRIVATE =1 <<1 ,MIGRATE_VMA_SELECT_DEVICE_COHERENT =1 <<2 ,MIGRATE_VMA_SELECT_COMPOUND =1 <<3 , +MIGRATE_VMA_FAULT =1 <<4 , + MIGRATE_VMA_WRITE = 1 << 5, };
[Severity: Low]
As reported by Christoph Hellwig on v15 [1], are MIGRATE_VMA_FAULT and MIGRATE_VMA_WRITE in enum migrate_vma_info and their handling in migrate_vma_setup() needed when there are no in-tree callers?
Later patches in the series (for test_hmm and drm/nouveau/svm) drive migrate-on-fault directly through hmm_range_fault() with HMM_PFN_REQ_MIGRATE and migrate_hmm_range_setup(), leaving MIGRATE_VMA_FAULT and MIGRATE_VMA_WRITE unused across the tree.
Quoted 5 lines
include/linux/migrate.h +0
-1@@ -218,10 +220,14 @@ struct migrate_vma {struct page *fault_page; }; -// TODO: enable migration
include/linux/migrate.h struct migrate_vma { · line 231
Quoted 10 lines
include/linux/migrate.h +6
-1static inline enum migrate_vma_info hmm_select_migrate (struct hmm_range *range) { -return 0 ; +enum migrate_vma_info minfo; + + minfo = (range->default_flags &HMM_PFN_REQ_MIGRATE ) ? + range->migrate->flags :0 ; + +return minfo; }
[Severity: Low]
Will mm/hmm.c fail to build when CONFIG_HMM_MIRROR=y and CONFIG_MIGRATION=n?
Several drivers (such as INFINIBAND_ON_DEMAND_PAGING, DRM_AMDGPU_USERPTR, and MSHV_ROOT) select CONFIG_HMM_MIRROR without selecting CONFIG_MIGRATION. When CONFIG_MIGRATION is disabled, struct migrate_vma is only forward-declared in include/linux/hmm.h, but hmm_range_fault_locked() in mm/hmm.c is compiled outside #ifdef CONFIG_DEVICE_MIGRATION and dereferences range->migrate->pgmap_owner:
mm/hmm.c:hmm_range_fault_locked() {
if (hmm_select_migrate(range)) {
WARN_ON_ONCE(range->pfn_flags_mask);
WARN_ON_ONCE(range->dev_private_owner !=
range->migrate->pgmap_owner);
...
}
}In addition, hmm_select_migrate() in include/linux/migrate.h is guarded by #ifdef CONFIG_MIGRATION rather than #ifdef CONFIG_DEVICE_MIGRATION, even though the migration implementation in mm/hmm.c and mm/migrate_device.c depends on CONFIG_DEVICE_MIGRATION.
Should hmm_select_migrate() be guarded by CONFIG_DEVICE_MIGRATION (returning 0 when !CONFIG_DEVICE_MIGRATION), and should the range->migrate dereference in hmm_range_fault_locked() be guarded or moved into a helper?
[ ... ]
Quoted 30 lines
mm/hmm.c +14
-2@@ -1658,14 +1658,43 @@ static int hmm_range_fault_locked(struct hmm_range *range, bool *locked)* the invalidation to finish. * -EFAULT: A page was requested to be valid and could not be made valid * ie it has no backing VMA or it is illegal to access +* -ERANGE: The range crosses multiple VMAs, or space for hmm_pfns array +* is too low. * * This is similar to get_user_pages(), except that it can read the page tables * without mutating them (ie causing faults). * * The mmap lock must be held by the caller and will remain held on return. * New users should prefer hmm_range_fault_unlocked_timeout() unless they -* specifically need to keep the mmap lock held across the call. This helper -* cannot support VMAs whose fault handlers need to drop the mmap lock. +* specifically need to keep the mmap lock held across the call like while +* migrating. This helper cannot support VMAs whose fault handlers need to +* drop the mmap lock. +* +* If want to do migration after faulting, call hmm_range_fault() with +* range.default_flags of HMM_PFN_REQ_MIGRATE, and optionally +* HMM_PFN_REQ_FAULT|HMM_PFN_REQ_WRITE, and initialize range->migrate field. +* range->migrate->vma will be populated during the call, +* and must be stable across the whole migrate process, which is +* why mmap_lock must be held around this call. +* +* When HMM_PFN_REQ_MIGRATE is set, migration collection may be partial on
mm/hmm.c static int hmm_range_fault_locked(struct hmm_range *range, bool *locked) · line 1690
Quoted 10 lines
mm/hmm.c +10
-0+* return and the caller takes responsibility for completing or aborting it. +* +* On success, the caller must call migrate_hmm_range_setup() and may then +* proceed with the normal migrate_vma sequence: prepare destination pages, +* call migrate_vma_pages(), update device mappings as needed, and finally +* call migrate_vma_finalize(). +* +* On -EBUSY, the caller may retry hmm_range_fault() using the same range and +* PFN array without undoing entries collected by the previous attempt. If +* the caller stops retrying, it must abort the partial migration.
[Severity: Critical]
When a caller retries hmm_range_fault() after -EBUSY with the same range and PFN array as documented here, won't hmm_range_fault_locked() wipe out all previously collected entries by unconditionally zeroing range->hmm_pfns?
At the start of hmm_range_fault_locked() in mm/hmm.c:
if (hmm_select_migrate(range)) {
WARN_ON_ONCE(range->pfn_flags_mask);
WARN_ON_ONCE(range->dev_private_owner !=
range->migrate->pgmap_owner);
memset(range->hmm_pfns, 0,
((range->end - range->start) >> PAGE_SHIFT) *
sizeof(*range->hmm_pfns));
}During the first call, hmm_vma_handle_migrate_prepare() and hmm_vma_handle_migrate_prepare_pmd() lock folios, take references, install migration PTEs/PMDs, and record HMM_PFN_VALID | HMM_PFN_MIGRATE in range->hmm_pfns[]. If a later page in the range triggers an mmu_notifier invalidation (for example during hmm_do_fault() or folio splitting) so that mmu_interval_check_retry() returns -EBUSY, retrying hmm_range_fault() zeroes range->hmm_pfns[].
On the retry walk, hmm_pfn_collected() in hmm_vma_handle_pte() and hmm_vma_walk_pmd() evaluates to false for the migration entries installed by the first attempt:
mm/hmm.c:hmm_vma_handle_pte() {
if (softleaf_is_migration(entry) && hmm_select_migrate(range) &&
hmm_pfn_collected(*hmm_pfn) &&
hmm_pfn_to_page(*hmm_pfn) == softleaf_to_page(entry))
return 0;
}With HMM_PFN_REQ_FAULT set, HMM treats its own migration PTE/PMD as a foreign migration entry and calls hmm_do_fault() -> handle_mm_fault() -> migration_entry_wait(), deadlocking on the folio lock already held by current. Without HMM_PFN_REQ_FAULT (or if the retry aborts before reaching those entries), range->hmm_pfns[] remains zeroed, so migrate_hmm_range_setup() never populates migrate->src[] for those pages and leaks the folio locks, folio references, and migration PTEs.
[ ... ]
Quoted 4 lines
mm/migrate_device.c +0
-0
[ ... ]
Quoted 27 lines
mm/migrate_device.c +12
-1@@ -741,9 +243,20 @@ int migrate_vma_setup(struct migrate_vma *args) {const struct vm_area_struct *vma = args->vma;long nr_pages = (args->end - args->start) >>PAGE_SHIFT ; +struct hmm_range range = { + .notifier =NULL , + .hmm_pfns = args->src, + .dev_private_owner = args->pgmap_owner, + .migrate = args, + .default_flags =HMM_PFN_REQ_MIGRATE + }; +int ret; args->start &=PAGE_MASK ; args->end &=PAGE_MASK ; + range.start = args->start; + range.end = args->end; +if (!vma)return -EINVAL ;/* The migrate_vma page walk has no hugetlb support. */ @@ -766,10 +279,24 @@ int migrate_vma_setup(struct migrate_vma *args) args->cpages =0 ; args->npages =0 ; -migrate_vma_collect (args); +if (args->flags &MIGRATE_VMA_FAULT )
mm/migrate_device.c int migrate_vma_setup(struct migrate_vma *args) · line 290
Quoted 10 lines
mm/migrate_device.c +7
-2+ range.default_flags |=HMM_PFN_REQ_FAULT ; -if (args->cpages) -migrate_vma_unmap (args); +if (args->flags &MIGRATE_VMA_WRITE ) + range.default_flags |=HMM_PFN_REQ_FAULT |HMM_PFN_REQ_WRITE ; + + ret =hmm_range_fault (&range); + +migrate_hmm_range_setup (&range);
[Severity: Critical]
As reported by Sashiko on v16 [2], when hmm_range_fault() faults at an address after already collecting earlier PTEs in the range, can concurrent page table zapping cause a use-after-free of destination pages because the walk resumes at hmm_vma_walk.last without re-validating [range->start, hmm_vma_walk.last)?
When HMM_PFN_REQ_MIGRATE | HMM_PFN_REQ_FAULT is used, walk_page_range() collects present pages in [range->start, addr) via hmm_vma_handle_migrate_prepare(), installing migration PTEs and setting HMM_PFN_VALID | HMM_PFN_MIGRATE in range->hmm_pfns[]. When a later address addr requires a fault, hmm_vma_handle_pte() drops the PTE lock, sets hmm_vma_walk.last = addr via hmm_record_fault(), and returns HMM_FAULT_PENDING:
mm/hmm.c:hmm_range_fault_locked() {
ret = walk_page_range(mm, hmm_vma_walk.last, range->end,
&hmm_walk_ops, &hmm_vma_walk);
if (ret == HMM_FAULT_PENDING) {
hmm_vma_migrate_disarm(&hmm_vma_walk);
ret = hmm_do_fault(mm, &hmm_vma_walk);
...
}
}While the PTE spinlock and migration mmu_notifier invalidation are dropped during hmm_do_fault(), a concurrent madvise(MADV_DONTNEED) only requires mmap_read_lock and can clear the migration PTEs in [range->start, addr) via zap_pte_range() -> zap_nonpresent_ptes() without taking the folio lock. When the loop resumes walk_page_range() at hmm_vma_walk.last = addr, hmm_vma_handle_migrate_prepare_rollback() only inspects [addr, end) and never re-checks [range->start, addr).
Those zapped entries keep HMM_PFN_VALID | HMM_PFN_MIGRATE in range->hmm_pfns[] and pass migrate_vma_check_page() because folio_mapped(src) is false. Later, in __migrate_device_finalize(), remove_migration_ptes(src, dst, 0) finds no migration PTEs to replace (so dst is never mapped into the CPU page tables or given a page table refcount), and folio_put(dst) frees the destination folio while the device driver still has it mapped.
[Severity: High]
As reported by Sashiko on v16 [3], can switching migrate_vma_setup() and hmm_range_fault() to the HMM migration path deadlock on folio locks in migrate_vma_split_folio() and hmm_do_fault(), or cause spurious split_folio() -EAGAIN failures?
First, during migration collection, hmm_vma_handle_migrate_prepare() keeps all previously collected folios in the range locked (using folio_trylock() to avoid deadlocks). However, when it encounters a PTE-mapped large folio, it calls migrate_vma_split_folio(), which takes a reference and does a blocking folio_lock() while still holding the locks and migration PTEs on fault_folio and all earlier collected folios:
mm/hmm.c:migrate_vma_split_folio() {
if (folio != fault_folio)
folio_get(folio);
lazy_mmu_mode_disable();
pte_unmap_unlock(ptep, hmm_vma_walk->ptl);
hmm_vma_walk->ptelocked = false;
if (folio != fault_folio)
folio_lock(folio);
return __migrate_vma_split_folio(folio, fault_page);
}If another task holds folio_lock(folio) and waits on one of the earlier migration PTEs via migration_entry_wait() (or tries to lock one of the already-collected folios), both tasks deadlock. Taking folio_get(folio) before folio_lock(folio) also means a concurrent caller blocking on folio_lock(folio) elevates the refcount and causes the lock holder's split_folio() to fail with -EAGAIN.
Second, when HMM_PFN_REQ_FAULT is used with HMM_PFN_REQ_MIGRATE, encountering another thread's migration entry in hmm_vma_handle_pte() or hmm_vma_walk_pmd() (or a swap or device-private entry) invokes hmm_do_fault() -> handle_mm_fault(), which sleeps in migration_entry_wait() or folio_lock() while still holding the locks and migration PTEs on all folios collected earlier in the walk.
[Severity: High]
Does hmm_vma_handle_migrate_prepare_pmd() in mm/hmm.c miss a folio_test_anon(folio) check when collecting or splitting a PMD-mapped THP?
At the PTE level, hmm_vma_handle_migrate_prepare() rejects non-anonymous folios:
mm/hmm.c:hmm_vma_handle_migrate_prepare() {
/* Only anonymous memory can be migrated to device memory */
if (!page || !folio_test_anon(page_folio(page)))
goto out;
}However, hmm_vma_handle_migrate_prepare_pmd() selects any non-zero pmd_trans_huge(*pmdp) folio when MIGRATE_VMA_SELECT_SYSTEM is set:
mm/hmm.c:hmm_vma_handle_migrate_prepare_pmd() {
if (pmd_trans_huge(*pmdp)) {
if (!(minfo & MIGRATE_VMA_SELECT_SYSTEM))
goto out;
folio = pmd_folio(*pmdp);
if (is_huge_zero_folio(folio))
return hmm_pfns_fill(start, end, hmm_vma_walk, 0);
}
}If HMM migration runs on a private file-backed or shmem VMA containing a PMD-mapped page-cache/shmem THP, hmm_vma_handle_migrate_prepare_pmd() locks the non-anonymous folio and either installs a PMD migration entry (holding the file/shmem folio lock across subsequent faults in hmm_do_fault(), which take mapping->invalidate_lock and invert the mapping->invalidate_lock -> folio_lock ordering) or splits the THP even though hmm_vma_handle_migrate_prepare() will reject all of its PTEs.
[Severity: High]
In hmm_vma_walk_pmd() in mm/hmm.c, when splitting a PTE-mapped large folio fails in hmm_vma_handle_migrate_prepare(), doesn't returning 0 immediately skip the remaining PTEs in [addr + PAGE_SIZE, end)?
In the PTE loop of hmm_vma_walk_pmd():
mm/hmm.c:hmm_vma_walk_pmd() {
for (; addr < end; addr += PAGE_SIZE, ptep++, hmm_pfns++) {
...
r = hmm_vma_handle_pte(walk, addr, end, pmdp, ptep, hmm_pfns);
...
r = hmm_vma_handle_migrate_prepare(walk, pmdp, addr, ptep,
hmm_pfns, &unmapped);
if (r == -EAGAIN) {
addr = start;
goto again;
}
if (r) {
HMM_ASSERT_UNLOCKED(hmm_vma_walk);
if (unmapped)
flush_tlb_range(walk->vma, start, addr);
return 0;
}
}
}When migrate_vma_split_folio() fails at addr, it drops the PTE lock and hmm_vma_handle_migrate_prepare() returns -EFAULT. Returning 0 from hmm_vma_walk_pmd() tells walk_page_range() that the entire PMD range [start, end) is complete, leaving [addr + PAGE_SIZE, end) unvisited and unpopulated in range->hmm_pfns[]. Moreover, if an earlier pass in hmm_vma_walk_pmd() had already collected PTEs at addresses above addr before restarting via addr = start; goto again, dropping the PTE lock at addr and returning 0 skips re-verifying and rolling back those collected entries in [addr + PAGE_SIZE, end).
[Severity: Medium]
Can writable protnone PTEs and PMDs lose MIGRATE_PFN_WRITE in migrate->src[] when migrated via migrate_vma_setup() or hmm_range_fault() without HMM_PFN_REQ_FAULT?
For a present protnone PTE or PMD, pte_to_hmm_pfn_flags() and pmd_to_hmm_pfn_flags() return 0, so HMM_PFN_WRITE is not set in *hmm_pfn. Then hmm_vma_handle_migrate_prepare() and hmm_vma_handle_migrate_prepare_pmd() collect the protnone entry, install a writable migration entry if pte_write(pte) or pmd_write(*pmdp) is true, and set HMM_PFN_VALID | HMM_PFN_MIGRATE in *hmm_pfn, but never set HMM_PFN_WRITE:
mm/hmm.c:hmm_vma_handle_migrate_prepare() {
set_pte_at(mm, addr, ptep, swp_pte);
folio_remove_rmap_pte(folio, page, walk->vma);
folio_put(folio);
*hmm_pfn |= HMM_PFN_VALID | HMM_PFN_MIGRATE;
}When migrate_hmm_range_setup() builds migrate->src[i] from range->hmm_pfns[i]:
mm/migrate_device.c:migrate_hmm_range_setup() {
migrate->src[i] |= MIGRATE_PFN_MIGRATE;
migrate->src[i] |= (pfn & HMM_PFN_WRITE) ? MIGRATE_PFN_WRITE : 0;
migrate->src[i] |= (pfn & HMM_PFN_COMPOUND) ? MIGRATE_PFN_COMPOUND : 0;
}MIGRATE_PFN_WRITE is left unset even though the deleted migrate_vma_collect_pmd() and migrate_vma_collect_huge_pmd() helpers preserved MIGRATE_PFN_WRITE whenever pte_write(pte) or pmd_write(*pmdp) was set. Should hmm_vma_handle_migrate_prepare() and hmm_vma_handle_migrate_prepare_pmd() also set HMM_PFN_WRITE on *hmm_pfn when writable is true?
[1] https://lore.kernel.org/r/[email protected]
[2] https://lore.kernel.org/r/[email protected]
[3] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=9
[email protected]
AI reviewRe: [PATCH v17 11/12] Documentation/mm/hmm: document migration through hmm_range_fault()
In reply to [email protected]Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] mm/hmm: incomplete error rollback steps for migrate_hmm_range_setup() in docs --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] mm/hmm: incomplete error rollback steps for migrate_hmm_range_setup() in docs --
commit 908a5d19d6ca6398929f82b830d122f054aa64a3
Author: Mika Penttilä <[email protected]>
Documentation/mm/hmm: document migration through hmm_range_fault()
This commit documents the MIGRATE_VMA_FAULT and MIGRATE_VMA_WRITE flags for migrate_vma_setup(), as well as driving the migration collection phase directly from hmm_range_fault() via HMM_PFN_REQ_MIGRATE and migrate_hmm_range_setup().
Quoted 4 lines
Documentation/mm/hmm.rst +0
-0
[ ... ]
Quoted 6 lines
Documentation/mm/hmm.rst +2
-0@@ -427,6 +434,44 @@ between device driver specific code and shared common code: The lock can now be released. +Migration collection through hmm_range_fault() +==============================================
[ ... ]
Documentation/mm/hmm.rst between device driver specific code and shared common code: · line 473
Quoted 10 lines
Documentation/mm/hmm.rst +10
-0+After hmm_range_fault() returns, the driver calls:: + + void migrate_hmm_range_setup(struct hmm_range *range); + +to translate ``range->hmm_pfns`` into ``migrate->src[]`` (``migrate->dst[]`` is +zeroed) and initialize ``migrate->cpages`` and ``migrate->npages``. From here on +the ``range->migrate`` struct is ready for the rest of the flow (steps 3 +onwards), i.e. migrate_vma_pages() and migrate_vma_finalize(). This should be +called even on error, since hmm_range_fault() may have collected part of the +range before failing.
[Severity: Low]
Could this wording be clarified regarding what needs to be called when hmm_range_fault() returns an error?
In mm/migrate_device.c, migrate_hmm_range_setup() only translates range->hmm_pfns into migrate->src[], zeroes migrate->dst[], initializes migrate->cpages and migrate->npages, and calls migrate_vma_unmap(). Calling migrate_hmm_range_setup() alone on error would leave migration PTEs installed and leave collected folios isolated from the LRU, locked, and with elevated reference counts.
On the other hand, if "This" is read as referring to the rest of the flow (steps 3 onwards), step 3 in Documentation/mm/hmm.rst instructs the driver to allocate destination pages, copy source pages, and populate migrate->dst[], which would commit the partial migration rather than aborting it.
As described in the kernel-doc for hmm_range_fault() in mm/hmm.c:
* On any other error, or when abandoning a retry, the caller must call
* migrate_hmm_range_setup(), migrate_vma_pages() with no valid destination
* entries, and migrate_vma_finalize() to abort the partial migration.
Should this paragraph explicitly state that on error the driver must call migrate_hmm_range_setup(), skip step 3 so migrate->dst[] remains zeroed, and still call migrate_vma_pages() and migrate_vma_finalize() to restore the original PTEs and release the folio locks and references?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=11
[email protected]
AI reviewRe: [PATCH v17 12/12] drm/nouveau/svm: add support for migrate on fault
In reply to [email protected]Thank you for your contribution! Sashiko AI review found 8 potential issue(s) to consider: - [Critical] drm/nouveau/dmem: unserialized access to shared channel drm->ttm.chan - [Critical]…
Thank you for your contribution! Sashiko AI review found 8 potential issue(s) to consider:
- [Critical] drm/nouveau/dmem: unserialized access to shared channel drm->ttm.chan
- [Critical] drm/nouveau/dmem: folio state corrupted after nouveau_dmem_migrate_abort()
- [High] drm/nouveau/dmem: wrong folio pinned by nouveau_dmem_migrate_abort()
- [High] drm/nouveau: unreplayed GPU faults stall CE in nouveau_dmem_fence_poll()
- [High] drm/nouveau/svm: infinite GPU write fault loop in nouveau_dmem_migrate_fault()
- [Medium] drm/nouveau/svm: nouveau_svmm_bind() skips migration on migrate-on-fault
- [Low] drm/nouveau/svm: missing kernel-parameters.txt entry for svm_migrate_on_fault
- [Low] drm/nouveau: unused nouveau_dmem_fence_done() return and incomplete changelog --
commit e30e6f260301c1f7393cda9890d6f9d63fe3f96e
Author: Mika Penttilä <[email protected]>
drm/nouveau/svm: add support for migrate on fault
This commit adds migrate-on-fault support to the nouveau SVM driver using HMM_PFN_REQ_MIGRATE and a new nouveau_dmem_migrate_fault() helper, gated by the svm_migrate_on_fault module parameter. It also introduces a migration channel mutex and polling fence wait with abort handling for DMEM copies.
Quoted 4 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +0
-0
[ ... ]
Quoted 13 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +8
-0@@ -76,6 +79,14 @@ struct nouveau_dmem_migrate {nouveau_migrate_copy_t copy_func;nouveau_clear_page_t clear_func;struct nouveau_channel *chan; +/* +* Serializes the dmem users of chan (CPU faults in migrate_to_ram(), +* migrate on fault, bulk migration, eviction): the copy and clear +* commands they write to its push buffer and the fences they emit. +* Held only around those writes, never across page allocation. +* TTM serializes its own use of the channel with cli->mutex. +*/ +struct mutex lock; };
[ ... ]
Quoted 24 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +24
-0+static int nouveau_dmem_copy (struct nouveau_drm *drm,u64 npages, +enum nouveau_aper dst_aper,u64 dst_addr, +enum nouveau_aper src_aper,u64 src_addr) +{ +int ret; + +mutex_lock (&drm->dmem->migrate.lock); + ret = drm->dmem->migrate.copy_func (drm, npages, dst_aper, dst_addr, + src_aper, src_addr); +mutex_unlock (&drm->dmem->migrate.lock); +return ret; +} + +static int nouveau_dmem_clear (struct nouveau_drm *drm,u32 length, +enum nouveau_aper dst_aper,u64 dst_addr) +{ +int ret; + +mutex_lock (&drm->dmem->migrate.lock); + ret = drm->dmem->migrate.clear_func (drm, length, dst_aper, dst_addr); +mutex_unlock (&drm->dmem->migrate.lock); +return ret; +} +
drivers/gpu/drm/nouveau/nouveau_dmem.c struct nouveau_dmem_dma_info { · line 140
Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +10
-0+static int nouveau_dmem_fence_new (struct nouveau_drm *drm, +struct nouveau_fence **fence) +{ +int ret; + +mutex_lock (&drm->dmem->migrate.lock); + ret =nouveau_fence_new (fence, drm->dmem->migrate.chan); +mutex_unlock (&drm->dmem->migrate.lock); +return ret; +}
[Severity: Critical]
As reported by Sashiko on v16 [1], in drivers/gpu/drm/nouveau/nouveau_dmem.c, nouveau_dmem_migrate_init() sets drm->dmem->migrate.chan = drm->ttm.chan, so DMEM and TTM share the same struct nouveau_channel instance:
drm->dmem->migrate.copy_func = nvc0b5_migrate_copy;
drm->dmem->migrate.clear_func = nvc0b5_migrate_clear;
drm->dmem->migrate.chan = drm->ttm.chan;Meanwhile, in drivers/gpu/drm/nouveau/nouveau_bo.c, nouveau_bo_move_m2mf() uses drm->ttm.chan under cli->mutex without taking drm->dmem->migrate.lock:
struct nouveau_channel *chan = drm->ttm.chan;
struct nouveau_cli *cli = chan->cli;
...
if (drm_drv_uses_atomic_modeset(drm->dev))
mutex_lock(&cli->mutex);
else
mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);Because nouveau_dmem_copy(), nouveau_dmem_clear(), and nouveau_dmem_fence_new() take only drm->dmem->migrate.lock while nouveau_bo_move_m2mf() takes only cli->mutex on the same underlying channel, can concurrent DMEM migrations (from nouveau_dmem_migrate_fault(), nouveau_dmem_migrate_to_ram(), nouveau_dmem_migrate_vma(), or nouveau_dmem_evict_chunk()) and TTM buffer moves race on chan->chan.push, interleave NVA0B5 copy engine methods in the pushbuffer, and corrupt ++fctx->sequence and fctx->pending in nouveau_fence_emit()?
Quoted 16 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +4
-2@@ -139,10 +185,12 @@ static void nouveau_dmem_folio_free(struct folio *folio)spin_unlock (&dmem->lock); } -static void nouveau_dmem_fence_done (struct nouveau_fence **fence) +static int nouveau_dmem_fence_done (struct nouveau_fence **fence) { +int ret =0 ; +if (fence) { -nouveau_fence_wait (*fence, true, false); + ret =nouveau_fence_wait (*fence, true, false);nouveau_fence_unref (fence); }else {/*
drivers/gpu/drm/nouveau/nouveau_dmem.c static void nouveau_dmem_fence_done(struct nouveau_fence **fence) · line 204
Quoted 7 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +3
-0@@ -150,6 +198,54 @@ static void nouveau_dmem_fence_done(struct nouveau_fence **fence)* the hmem object. */ } + +/* 0 on completion, -EBUSY on timeout, or other errno; propagated. */ +return ret; }
[Severity: Low]
This isn't a bug, but nouveau_dmem_fence_done() is changed to return int while its remaining callers in drivers/gpu/drm/nouveau/nouveau_dmem.c (nouveau_dmem_evict_chunk() and nouveau_dmem_migrate_chunk()) ignore the return value.
Also, the commit message only describes adding HMM_PFN_REQ_MIGRATE support, nouveau_dmem_migrate_fault(), and the svm_migrate_on_fault parameter, without mentioning the addition of drm->dmem->migrate.lock or the rework of nouveau_dmem_migrate_to_ram() to use nouveau_dmem_fence_poll() and nouveau_dmem_migrate_abort() even when svm_migrate_on_fault is off. Could the unused return value be dropped and the changelog updated to cover these changes?
Quoted 12 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +12
-0+/* +* Poll the copy fence instead of the lazy (interrupt-driven) wait since +* completion IRQ is randomly missed, hitting the timeout. +* +* Returns 0 on completion, -EBUSY on timeout. Consumes the fence reference. +*/ +static int nouveau_dmem_fence_poll (struct nouveau_fence **fence) +{ +unsigned long deadline = jiffies +30 *HZ ; +int ret =0 ; + +while (!nouveau_fence_done (*fence)) {
drivers/gpu/drm/nouveau/nouveau_dmem.c static void nouveau_dmem_fence_done(struct nouveau_fence **fence) · line 227
Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +10
-0+if (time_after (jiffies, deadline)) { + ret = -EBUSY ; +break ; + } +schedule_timeout_uninterruptible (msecs_to_jiffies (1 )); + } +nouveau_fence_unref (fence); + +return ret; +}
[Severity: High]
As noted in nouveau_dmem_migrate_fault(), when a replayable GPU fault is pending, a copy engine transfer does not make progress until nouveau_svm_fault_replay() is issued. Can nouveau_dmem_fence_poll() stall for 30 seconds and time out in two scenarios?
First, in nouveau_dmem_migrate_to_ram(), migrate_vma_setup() locks sfolio and installs a migration PTE, nouveau_svmm_invalidate() unmaps the page from the GPU, and nouveau_dmem_copy_folio() starts the copy before nouveau_dmem_fence_poll() waits for completion. If the GPU faults on that invalidated address while the copy is in flight, the pending GPU fault stalls the copy engine, while the fault worker in nouveau_svm_fault() blocks in hmm_range_fault() -> migration_entry_wait() waiting for sfolio to be unlocked by migrate_vma_finalize(). Because nouveau_dmem_migrate_to_ram() never calls nouveau_svm_fault_replay(), won't nouveau_dmem_fence_poll() stall until the 30-second timeout, leak the page in nouveau_dmem_migrate_abort(), and return VM_FAULT_SIGBUS?
Second, in nouveau_dmem_migrate_fault(), nouveau_svm_fault_replay() is called once before nouveau_dmem_fence_poll(), while the GPU page table entry is still unmapped (__nouveau_pfns_map_locked() runs only after the fence completes). If the replayed GPU access or another warp immediately refaults on the still unmapped address before the copy finishes, won't the GPU re-enter the faulted state and stall the copy engine while the fault worker is blocked inside nouveau_dmem_fence_poll()?
Quoted 21 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +21
-0+/* +* The copy could not be confirmed (fence timeout or no fence): don't migrate, +* so finalize restores the original ptes and the source stays valid. The copy +* engine may still be using the pages, so keep the destination folios (an +* extra reference that finalize won't drop) and let the caller skip the DMA +* unmap: leaking is safer than freeing memory a wedged engine might write. +*/ +static void nouveau_dmem_migrate_abort (struct nouveau_drm *drm, +struct migrate_vma *args) +{ +unsigned long i; + +for (i =0 ; i < args->npages; i++) { +struct page *dpage =migrate_pfn_to_page (args->dst[i]); + + args->src[i] &= ~MIGRATE_PFN_MIGRATE ; +if (dpage) +folio_get (page_folio (dpage)); + } +NV_ERROR (drm,"svm: copy not confirmed, migration aborted, pages leaked\n" ); +}
[ ... ]
Quoted 15 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +10
-1@@ -264,11 +361,21 @@ static vm_fault_t nouveau_dmem_migrate_to_ram(struct vm_fault *vmf) goto done; } -nouveau_fence_new (&fence, dmem->migrate.chan); +/* +* Commit the migration only once the copy is confirmed. Without a +* fence the copy can't be confirmed: treat it as failed. +*/ + fret =nouveau_dmem_fence_new (drm, &fence); +if (!fret) + fret =nouveau_dmem_fence_poll (&fence); +if (fret) { +nouveau_dmem_migrate_abort (drm, &args); + ret =VM_FAULT_SIGBUS ;
drivers/gpu/drm/nouveau/nouveau_dmem.c static vm_fault_t nouveau_dmem_migrate_to_ram(struct vm_fault *vmf) · line 380
Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +4
-3+ }else { +dma_unmap_page (drm->dev->dev, dma_info.dma_addr, dma_info.size, +DMA_BIDIRECTIONAL ); + }migrate_vma_pages (&args); -nouveau_dmem_fence_done (&fence); -dma_unmap_page (drm->dev->dev, dma_info.dma_addr, dma_info.size, -DMA_BIDIRECTIONAL ); done:migrate_vma_finalize (&args);
[Severity: Critical]
As reported by Sashiko on v16 [2], when nouveau_dmem_fence_new() or nouveau_dmem_fence_poll() fails in nouveau_dmem_migrate_to_ram() or nouveau_dmem_migrate_fault(), nouveau_dmem_migrate_abort() clears MIGRATE_PFN_MIGRATE in args->src[i] while leaving args->dst[i] non-zero, and then the caller invokes migrate_vma_pages() and migrate_vma_finalize().
In mm/migrate_device.c:__migrate_device_pages(), MIGRATE_PFN_MIGRATE is only checked in the !page branch; when both page (from src_pfns[i]) and newpage (from dst_pfns[i]) are non-NULL, __migrate_device_pages() still executes:
folio = page_folio(migrate_pfn_to_page(src_pfns[i+j]));
newfolio = page_folio(migrate_pfn_to_page(dst_pfns[i+j]));
mapping = folio_mapping(folio);
r = folio_migrate_mapping(mapping, newfolio, folio, extra_cnt);
if (r)
src_pfns[i+j] &= ~MIGRATE_PFN_MIGRATE;
else
folio_migrate_flags(newfolio, folio);This removes the source folio from the swap cache via folio_free_swap(), migrates mapping and page flags to newfolio, and calls mem_cgroup_migrate(folio, newfolio), which zeroes folio->memcg_data on the source folio. Then migrate_vma_finalize() sees !(src_pfns[i] & MIGRATE_PFN_MIGRATE) and restores the CPU PTEs to the corrupted source folio whose memcg charge and swapcache state were already moved to the leaked destination folio.
Should nouveau_dmem_migrate_abort() instead unlock and release/leak dst[i] and clear args->dst[i] = 0 (or skip migrate_vma_pages() altogether when aborting) so __migrate_device_pages() does not touch the source folio?
[Severity: High]
In addition, when nouveau_dmem_migrate_abort() is called from nouveau_dmem_migrate_fault() during system-to-VRAM migration, does it pin the wrong folio?
In nouveau_dmem_migrate_fault(), migrate.src[i] is the host system RAM folio that was DMA-mapped into dma_info by nouveau_dmem_migrate_copy_one(), whereas migrate.dst[i] is a device-private VRAM folio. When fret != 0, nouveau_dmem_migrate_fault() skips dma_unmap_page() on dma_info because the copy engine may still be accessing the host DMA mapping, but nouveau_dmem_migrate_abort() only calls folio_get() on migrate.dst[i].
Won't migrate_vma_finalize() drop the migration reference on the DMA-mapped system RAM folio in migrate.src[i] (allowing it to be freed back to the page allocator while still DMA-mapped), while the extra folio_get() on the unmapped device-private folio in migrate.dst[i] prevents chunk->callocated from ever reaching 0 and causes memunmap_pages(&chunk->pagemap) to hang on driver teardown in nouveau_dmem_evict_chunk()?
[ ... ]
Quoted 1 line
drivers/gpu/drm/nouveau/nouveau_dmem.c +0
-0@@ -832,6 +956,238 @@ static void nouveau_dmem_migrate_chunk(struct nouveau_drm *drm,
[ ... ]
Quoted 26 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +26
-0+mutex_lock (&svmm->mutex); +if (fret) { +/* Copy did not complete; don't map a half-copied page. */ + ret = -EIO ; + }else if (mmu_interval_read_retry (notifier, range.notifier_seq)) { + ret = -EBUSY ; + }else { +unsigned long map_addr = migrate.start; +unsigned int page_shift =PAGE_SHIFT + order; + +/* +* If nothing migrated might still be able to mirror. +* In that case use the snapshot hmm_pfn. +* npages == 1 always today. +*/ +if (npages ==1 && !(pfns[0 ] &NVIF_VMM_PFNMAP_V0_V )) + pfns[0 ] =nouveau_dmem_hmm_pfn_to_map (hmm_pfn0, + start, &map_addr, &page_shift); + +/* +* Nothing to map: leave the GPU mapping alone, the +* caller falls back to nouveau_range_fault(). +*/ +if (pfns[0 ] &NVIF_VMM_PFNMAP_V0_V ) { +/* On failure the caller falls back, then cancels */ + ret = __nouveau_pfns_map_locked(svmm, map_addr,
drivers/gpu/drm/nouveau/nouveau_dmem.c static void nouveau_dmem_migrate_chunk(struct nouveau_drm *drm, · line 1160
Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_dmem.c +10
-0+ pfns, n, + page_shift); +if (!ret) { + *out_pfn0 = pfns[0 ]; + *out_addr = map_addr; + *out_shift = page_shift; + } + } + } +mutex_unlock (&svmm->mutex);
[Severity: High]
What happens in nouveau_dmem_migrate_fault() when a GPU write fault (hmm_flags containing HMM_PFN_REQ_WRITE) hits a read-only device-private VRAM PTE owned by drm->dev (for example, a page migrated to VRAM on an earlier GPU read fault when the CPU PTE was read-only, or after fork() or mprotect(PROT_READ))?
In mm/hmm.c:hmm_vma_handle_pte(), when a non-present PTE is a device-private entry owned by range->dev_private_owner, hmm_range_fault() returns 0 with HMM_PFN_VALID but without HMM_PFN_WRITE (because softleaf_is_device_private_write(entry) is false) and without HMM_PFN_MIGRATE.
Then in nouveau_dmem_migrate_fault(), nothing migrates, so it falls back to nouveau_dmem_hmm_pfn_to_map(hmm_pfn0, ...), which encodes pfns[0] with NVIF_VMM_PFNMAP_V0_V | NVIF_VMM_PFNMAP_V0_VRAM but without NVIF_VMM_PFNMAP_V0_W. __nouveau_pfns_map_locked() installs a read-only GPU PTE and returns 0, and nouveau_svm_fault() replays the fault without falling back to nouveau_range_fault(). Won't the GPU write instruction fault again indefinitely in an infinite fault-replay loop because write permission was requested in hmm_flags but not granted in hmm_pfn0?
Quoted 4 lines
drivers/gpu/drm/nouveau/nouveau_svm.c +0
-0
[ ... ]
drivers/gpu/drm/nouveau/nouveau_svm.c struct nouveau_svm { · line 87
Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_svm.c +6
-0@@ -78,6 +79,13 @@ struct nouveau_svm { #define SVM_DBG(s,f,a...) NV_DEBUG((s)->drm, "svm: "f"\n", ##a) #define SVM_ERR(s,f,a...) NV_WARN((s)->drm, "svm: "f"\n", ##a) +/* When set, migrate the faulting range to VRAM on GPU fault (default off). */ +static bool nouveau_svm_migrate_on_fault; +module_param_named (svm_migrate_on_fault, nouveau_svm_migrate_on_fault, bool, +0644 ); +MODULE_PARM_DESC (svm_migrate_on_fault, +"migrate system memory to VRAM on GPU fault (default off)" );
[Severity: Low]
As reported by Sashiko on v16 [3], this adds the nouveau.svm_migrate_on_fault module parameter via module_param_named() in drivers/gpu/drm/nouveau/nouveau_svm.c without an entry in Documentation/admin-guide/kernel-parameters.txt (noting that CONFIG_DRM_NOUVEAU_SVM is marked experimental and depends on STAGING in drivers/gpu/drm/nouveau/Kconfig). Should this parameter be documented in Documentation/admin-guide/kernel-parameters.txt?
drivers/gpu/drm/nouveau/nouveau_svm.c nouveau_svmm_bind(struct drm_device *dev, void *data, · line 198
Quoted 13 lines
drivers/gpu/drm/nouveau/nouveau_svm.c +4
-3@@ -182,9 +190,10 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, addr =max (addr, vma->vm_start); next =min (vma->vm_end, end); -/* This is a best effort so we ignore errors */ -nouveau_dmem_migrate_vma (cli->drm, cli->svm.svmm, vma, addr, - next); +/* Best effort; skipped when migrate-on-fault does the migration. */ +if (!nouveau_svm_migrate_on_fault) +nouveau_dmem_migrate_vma (cli->drm, cli->svm.svmm, vma, + addr, next); addr = next; }
[Severity: Medium]
In drivers/gpu/drm/nouveau/nouveau_svm.c, why does nouveau_svmm_bind() skip nouveau_dmem_migrate_vma() when nouveau_svm_migrate_on_fault is enabled (while still taking mmap_read_lock(mm) and walking the VMAs in the range)?
If pages in the bound range are already mapped to system memory in the GPU page tables (for example from a prior FAULT_ACCESS_PREFETCH fault, an atomic fault in nouveau_atomic_range_fault(), or an in-place fallback mapping in nouveau_dmem_migrate_fault()), subsequent GPU accesses will not fault, so skipping nouveau_dmem_migrate_vma() prevents explicit DRM_IOCTL_NOUVEAU_SVM_BIND requests from ever migrating those pages to VRAM. Furthermore, nouveau_dmem_migrate_vma() migrates compound PMD THPs with MIGRATE_VMA_SELECT_COMPOUND, whereas deferring to nouveau_dmem_migrate_fault() faults one 4KB page at a time without MIGRATE_VMA_SELECT_COMPOUND and splits 2MB THPs. Is it intentional that enabling svm_migrate_on_fault turns the migration ioctl into a no-op?
[1] https://lore.kernel.org/r/[email protected]
[2] https://lore.kernel.org/r/[email protected]
[3] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=12
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Quoted 13 lines · On Tue, Nov 03, 2026 at 08:16:17AM +0200, [email protected] wrote:
From: Mika Penttilä <[email protected]>
Currently, the way device page faulting and migration works is not optimal, if you want to do both fault handling and migration at once.
Being able to migrate not present pages (or pages mapped with incorrect permissions, eg. COW) to the GPU requires doing either of the following sequences:
1.
hmm_range_fault()- fault in non-present pages with correct permissions, etc.
2. migrate_vma_*() - migrate the pages
Quoted 6 lines
Or:
1. migrate_vma_*() - migrate present pages
2. If non-present pages detected by migrate_vma_*():
a) callhmm_range_fault()to fault pages in
b) call migrate_vma_*() again to migrate now present pages
Regarding both sequences, I'm trying to get a better understanding of what the issue is. I assume the caller wants to fault in system memory, and then migrate it to the device. Is that correct?
In my analysis I'm also not going to refer to THPs, since that would make things even more complicated than they are. I think we can come back to THPs later if we think it would be useful.
For the !pte_present() case:
Sequence 1: hmm_range_fault() -> .. -> hmm_vma_handle_pte() handles !pte_present() pages in two ways: faults in swap pages and device private pages belonging to a different device, and waits on migration entries. Then the migrate_vma_*() flow is used to migrate the range.
Sequence 2: migrate_vma_setup() ignores !pte_present() page table entries After this, the caller follows the same steps as in sequence 1 - hmm_range_fault() faults in !pte_present() pages, and migrate_vma_*() is called again to migrate the pages that were faulted in/waited on by hmm_range_fault().
Now, for the CoW case that you mentioned, I'm going to assume that the caller wants write permissions otherwise nothing needs to be done:
Sequence 1: hmm_range_fault() -> hmm_vma_handle_pte() records a fault (hmm_pte_need_fault() returns HMM_NEED_FAULT | HMM_NEED_WRITE_FAULT), handle_mm_fault() -> .. -> do_wp_page() breaks CoW and maps an exclusive folio with write permissions, then the migrate_vma_* flow will take care of
Sequence 2, migrate_vma_setup() installs migration entries for the page, then migrate_vma_finalize() replaces the migration entries with device private entries.
Looks to me that for CoW pages, all that's needed is migrate_vma_*(), and the subsequent calls to hmm_range_fault() and migrate_vma_*() are not necessary. Is that your conclusion too?
Quoted 4 lines
The problem with the first sequence is that you always have to do two page walks even when most of the time the pages are present or zero page mappings so the common case takes a performance hit.
This is the first mention of the zero page. Is the caller specifying HMM_PFN_REQ_WRITE? That makes a difference, because it triggers fault handling for the zero page, and that's an extra walk. Can you give more details here?
Let's count page table walks when a page is mapped with a valid entry, and with the required permissions. Let's say N is the number of mappings for the page (equivalent to the number of VMAs that map the page):
hmm_range_fault() -> .. -> hmm_vma_handle_pte() does one page table walk, migrate_vma_setup() does N page tables walks, to replace all valid mappings of the page with migration entries, migrate_vma_finalize() does N page table walks, to replace the migration entries with device entries.
In total 1 + 2*N walks. Best case scenario, N == 1 (PageAnonExclusive()), that's three walks.
Do you have any data regarding how often the best case scenario happens? That's what you seem to be referring to in your comment.
Now let's count the number of walks for a !pte_present() page mapped in P VMAs, where P != N: one from hmm_range_fault(), if the entry is not a migration entry, another walk in the fault handler, then 2*P walks from the migrate_vma_*() flow.
If it's a migration entry, it requires 1 + 2*P walks, PLUS waiting on migration to complete, which cannot be skipped.
If it's a swap entry, it requires 2 + 2*P walks, PLUS waiting on swap.
If it's a device private entry belonging to a different device, it requires 2 + 2*P walks, plus waiting on the device to sync the memory with the device in migrate_to_ram().
To summarize:
pte_present() 1 + 2*N walks
migration entry 1 + 2*P walks + waiting on migration
swap entry 2 + 2*P walks + waiting on swap
device private 2 + 2*P walks + waiting on device->memory sync
Quoted 6 lines
The second sequence is better for the common case, but far worse if pages aren't present because now you have to walk the page tables three times (once to find the page is not present, once so
hmm_range_fault()can find a non-present page to fault in and once again to setup the migration). It is also tricky to code correctly. One page table walk
Valid entry, the page is mapped in N VMAs: migrate_vma_*() does 2*N walks, best case scenario (PageAnonExclusive) two walks.
!pte_present, the page is mapped in P VMAs:
migrate_vma_setup() -> migrate_vma_collect() will always do one page table walk, regardless of what it finds, valid or invalid entries. migrate_vma_collect() ignores !pte_present() entries, and they will not trigger new walks in the next steps in the migrate_vma_* flow. Worst case is that all the pages are !pte_present(), that's one walk to find them all which I would say it translates to zero extra walks for an individual page.
For hmm_range_fault(), it's the same situation as above: 1 + 2*P or 2 + 2*P walks.
To summarize:
pte_present() 2*N walksmigration_entry 1 + 2*P walks + waiting on migration
swap entry 2 + 2*P walks + waiting on migration
device private 2 + 2*P walks + waiting on device memory->memory sync
I agree with you, this second sequence is better for the common case.
I think it would interesting to know:
1. Is there a relationship between N and P, and if there is, what is it? Are they equal, on average? I doubt it. Is a !pte_present() page likely to be mapped in more VMAs than a pte_present() page, or fewer?
2. What is the likelyhood of P being equal to 1 (PageAnonExclusive)? That would be interesting to know because the larger P is, the contribution of that extra walk (or two walks) to the total time becomes less and less significant.
3. How does the time to do the walk compare to the time spent waiting on migration, or waiting on swap, or waiting on device to memory sync? How often each of them happen? I have a hunch that these will tend to dominate the total time.
Quoted 11 lines
could costs over 1000 cpu cycles on X86-64, which is a significant hit.
We should be able to walk the page table once, faulting pages in as required and replacing them with migration entries if requested.
Add a new flag to HMM APIs,
HMM_PFN_REQ_MIGRATE,
which tells to prepare for migration also during fault handling. For themigrate_vma_setup()call paths, new flags,MIGRATE_VMA_FAULT, andMIGRATE_VMA_WRITEare added to tell to add fault handling to migrate.
Quoted 6 lines
An extra benefit of migrating with
hmm_range_fault()path is the migrate_vma.vma gets populated, so no need to retrieve that separataly.This series avoids the problems in current collecting implementation, where racing
MADV_DONTNEEDcould make the collecting arrays overflow.
Can you provide more details here? How does it happen?
Quoted 4 lines
This is achieved mainly by having a rollback mechanism and populating the collecting array as the last step.
Tested in X86-64 VM with HMM test device, passing the selftests.
Have you tested that this series doesn't regress other architectures?
Quoted 3 lines
The main goal of this patchset is to provide a new feature, migrate efficiently on fault, and not directly improve performance of current
migrate_vma_setup()(which is now routed thru
I'm a bit confused by what 'on fault' means in this context? Userspace accesses a device entry, access that causes a fault, or using hmm_range_fault()? I assume the latter, but it pays to make sure.
Also, can you define efficiently? Usually that's related in some way to performance, but immediately you say that the series doesn't aim to improve performance.
Quoted 3 lines
hmm_range_fault()) callers. That said, the migrate throughput tests from the selftests show that there is at least no regression for currentmigrate_vma_setup()callers.
If the premise of the series is to reduce the number of page table walks in the !pte_present() case, then I think benchmarks that show a performance improvement would make a compelling case for this approach.
Some thoughts, if I may:
- Perhaps the existing test is not the right test to highlight the performance gains?
- Perhaps there are other parts of the migration process that dominate the walks? If so, maybe we should be focusing our attention on those?
- Perhaps the series adds overhead that reduces or cancels the gains from reducing the number of walks?
Thanks,
Alex
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
I try to answer your questions, there are quite a bunch of them!
Quoted 17 lines · On Tue, Nov 03, 2026 at 08:16:17AM +0200, [email protected] wrote:
Quoted 15 lines
From: Mika Penttilä <[email protected]>
Currently, the way device page faulting and migration works is not optimal, if you want to do both fault handling and migration at once.
Being able to migrate not present pages (or pages mapped with incorrect permissions, eg. COW) to the GPU requires doing either of the following sequences:
1.
hmm_range_fault()- fault in non-present pages with correct permissions, etc.
2. migrate_vma_*() - migrate the pagesOr:
Quoted 7 lines
Quoted 4 lines
1. migrate_vma_*() - migrate present pages
2. If non-present pages detected by migrate_vma_*():
a) callhmm_range_fault()to fault pages in
b) call migrate_vma_*() again to migrate now present pagesRegarding both sequences, I'm trying to get a better understanding of what the issue is. I assume the caller wants to fault in system memory, and then migrate it to the device. Is that correct?
Yes that's the common thing to do.
Quoted 26 lines
In my analysis I'm also not going to refer to THPs, since that would make things even more complicated than they are. I think we can come back to THPs later if we think it would be useful.
For the !pte_present() case:
Sequence 1:
hmm_range_fault()-> .. ->hmm_vma_handle_pte()handles !pte_present() pages in two ways: faults in swap pages and device private pages belonging to a different device, and waits on migration entries. Then the migrate_vma_*() flow is used to migrate the range.Sequence 2:
migrate_vma_setup()ignores !pte_present() page table entries After this, the caller follows the same steps as in sequence 1 -hmm_range_fault()faults in !pte_present() pages, and migrate_vma_*() is called again to migrate the pages that were faulted in/waited on byhmm_range_fault().Now, for the CoW case that you mentioned, I'm going to assume that the caller wants write permissions otherwise nothing needs to be done:
Sequence 1:
hmm_range_fault()->hmm_vma_handle_pte()records a fault (hmm_pte_need_fault()returnsHMM_NEED_FAULT|HMM_NEED_WRITE_FAULT),handle_mm_fault()-> .. ->do_wp_page()breaks CoW and maps an exclusive folio with write permissions, then the migrate_vma_* flow will take care of
Quoted 7 lines
Sequence 2,
migrate_vma_setup()installs migration entries for the page, thenmigrate_vma_finalize()replaces the migration entries with device private entries.Looks to me that for CoW pages, all that's needed is migrate_vma_*(), and the subsequent calls to
hmm_range_fault()and migrate_vma_*() are not necessary. Is that your conclusion too?
For a device fault: the driver want the data in device memory with the permissions the device asked for. Your !pte_present() analysis matches; note that pte_none() in anonymous vmas and the zero page don't need hmm_range_fault() at all, migrate_vma_*() populates them directly. That's why the common case is cheap with sequence 2, and only swap entries, other devices private pages and migration entries need the extra walks.
For cow with write intent migrate_vma_*() alone is enough. migrate_vma_setup() doesnt break cow: it collects the shared page through its read-only pte, so there's no MIGRATE_PFN_WRITE, and try_to_migrate() unmaps all its mappings, so finalize installs a read-only device private entry.
The device still cant write; a write then has to go through migrate_to_ram() and break cow in system memory, and migrate again. To get an exclusive writable copy on the device, cow has to be broken before collectin, i.e. hmm_range_fault() with HMM_PFN_REQ_WRITE first, then migrate: two walks. With this series that's one walk, HMM_PFN_REQ_FAULT | HMM_PFN_REQ_WRITE | HMM_PFN_REQ_MIGRATE (or MIGRATE_VMA_WRITE for migrate_vma_setup() users), and only the now-exclusive page is migrated.
Quoted 8 lines
Quoted 4 lines
The problem with the first sequence is that you always have to do two page walks even when most of the time the pages are present or zero page mappings so the common case takes a performance hit.
This is the first mention of the zero page. Is the caller specifying
HMM_PFN_REQ_WRITE? That makes a difference, because it triggers fault handling for the zero page, and that's an extra walk. Can you give more details here?
Good question on the zero page. With a read request it need no fault:
migrate_vma_*() populates it like pte_none(), and the HMM walk collects it the same way. With HMM_PFN_REQ_WRITE it's write-faulted first, in sequence 1 and with this series alike; the difference is that the series faults and collects in the same walk.
Quoted 29 lines
Let's count page table walks when a page is mapped with a valid entry, and with the required permissions. Let's say N is the number of mappings for the page (equivalent to the number of VMAs that map the page):
hmm_range_fault()-> .. ->hmm_vma_handle_pte()does one page table walk,migrate_vma_setup()does N page tables walks, to replace all valid mappings of the page with migration entries,migrate_vma_finalize()does N page table walks, to replace the migration entries with device entries.In total 1 + 2*N walks. Best case scenario, N == 1 (
PageAnonExclusive()), that's three walks.Do you have any data regarding how often the best case scenario happens? That's what you seem to be referring to in your comment.
Now let's count the number of walks for a !pte_present() page mapped in P VMAs, where P != N: one from
hmm_range_fault(), if the entry is not a migration entry, another walk in the fault handler, then 2*P walks from the migrate_vma_*() flow.If it's a migration entry, it requires 1 + 2*P walks, PLUS waiting on migration to complete, which cannot be skipped.
If it's a swap entry, it requires 2 + 2*P walks, PLUS waiting on swap.
If it's a device private entry belonging to a different device, it requires 2 + 2*P walks, plus waiting on the device to sync the memory with the device in
migrate_to_ram().
Quoted 6 lines
To summarize:
pte_present()1 + 2*N walks
migration entry 1 + 2*P walks + waiting on migration
swap entry 2 + 2*P walks + waiting on swap
device private 2 + 2*P walks + waiting ondevice->memorysync
On counting: the 2N (or 2P) rmap walks that replace the mappings with migration entries and then device entries are inherent to migrating the page and are the same in all variants. What differs is the number of page table walks over the range: sequence 1 allways does two (hmm_range_fault(), then migrate_vma_setup()), sequence 2 one if everything is present and three otherwise, and the HMM walk one, with faults handled in place and the walk resuming from the faulting address. The saving is per range walk, so it scales with the range.
I don't have data on how often the best case happens. The motivation came from earlier prototyping of migrate on fault on the current interfaces, where the extra walks showed up in perf traces. For the typical SVM case of private anonymous memory without fork the pages are exclusive (N == 1) or not yet populated, but I haven't measured a distribution.
Quoted 41 lines
Quoted 6 lines
The second sequence is better for the common case, but far worse if pages aren't present because now you have to walk the page tables three times (once to find the page is not present, once so
hmm_range_fault()can find a non-present page to fault in and once again to setup the migration). It is also tricky to code correctly. One page table walkValid entry, the page is mapped in N VMAs: migrate_vma_*() does 2*N walks, best case scenario (PageAnonExclusive) two walks.
!pte_present, the page is mapped in P VMAs:
migrate_vma_setup()->migrate_vma_collect()will always do one page table walk, regardless of what it finds, valid or invalid entries.migrate_vma_collect()ignores !pte_present() entries, and they will not trigger new walks in the next steps in the migrate_vma_* flow. Worst case is that all the pages are !pte_present(), that's one walk to find them all which I would say it translates to zero extra walks for an individual page.For
hmm_range_fault(), it's the same situation as above: 1 + 2*P or 2 + 2*P walks.To summarize:
pte_present()2*N walksmigration_entry1 + 2*P walks + waiting on migration
swap entry 2 + 2*P walks + waiting on migration
device private 2 + 2*P walks + waiting on devicememory->memorysyncI agree with you, this second sequence is better for the common case.
I think it would interesting to know:
1. Is there a relationship between N and P, and if there is, what is it? Are they equal, on average? I doubt it. Is a !pte_present() page likely to be mapped in more VMAs than a
pte_present()page, or fewer?2. What is the likelyhood of P being equal to 1 (PageAnonExclusive)? That would be interesting to know because the larger P is, the contribution of that extra walk (or two walks) to the total time becomes less and less significant.
Quoted 4 lines
3. How does the time to do the walk compare to the time spent waiting on migration, or waiting on swap, or waiting on device to memory sync? How often each of them happen? I have a hunch that these will tend to dominate the total time.
Yes, when a page needs swap-in, a migration wait or a device sync, that wait dominates..
The walk saving matters on the common device fault path, with small ranges (one page per fault in the nouveau patch) and present or unpopulated pages: one walk instead of two, and without sequence 2's three when part of the range isn't present. But the main point is one call that faults and collects consistently, instead of two with a window in between where the range can change.
I don't have data on N and P. For private anonymous memory without fork or KSM both are normally 1, but I haven't measured it.
Quoted 11 lines
Quoted 11 lines
could costs over 1000 cpu cycles on X86-64, which is a significant hit.
We should be able to walk the page table once, faulting pages in as required and replacing them with migration entries if requested.
Add a new flag to HMM APIs,
HMM_PFN_REQ_MIGRATE,
which tells to prepare for migration also during fault handling. For themigrate_vma_setup()call paths, new flags,MIGRATE_VMA_FAULT, andMIGRATE_VMA_WRITEare added to tell to add fault handling to migrate.
Quoted 7 lines
Quoted 6 lines
An extra benefit of migrating with
hmm_range_fault()path is the migrate_vma.vma gets populated, so no need to retrieve that separataly.This series avoids the problems in current collecting implementation, where racing
MADV_DONTNEEDcould make the collecting arrays overflow.Can you provide more details here? How does it happen?
migrate_vma_collect_pmd() drops the pte lock to split a large folio and restarts with [start, addr) already appended to src[]/dst[]. If a racing MADV_DONTNEED zaps the range and frees the pte table meanwhile, the re start takes the hole path from start and append [start, addr) again, writing past the arrays. "mm/migrate_device: don't collect a range twice" in Lorenzo's batch fixes that instance; this series collects into the address-indexed hmm_pfns and fills src[] only lastly, so re-walking cant overrun. Also, the correct pages are collected with the re-walk with this series(rollback takes care of the old ones).
There are couple other defects the series fixed along the way.
Quoted 5 lines
Quoted 4 lines
This is achieved mainly by having a rollback mechanism and populating the collecting array as the last step.
Tested in X86-64 VM with HMM test device, passing the selftests.
Have you tested that this series doesn't regress other architectures?
Only tested on x86-64 (VM with test_hmm, and nouveau on a GP102). The code is arch-independent, but it isn't tested elsewhere.
Quoted 11 lines
Quoted 4 lines
The main goal of this patchset is to provide a new feature, migrate efficiently on fault, and not directly improve performance of current
migrate_vma_setup()(which is now routed thruI'm a bit confused by what 'on fault' means in this context? Userspace accesses a device entry, access that causes a fault, or using
hmm_range_fault()? I assume the latter, but it pays to make sure.Also, can you define efficiently? Usually that's related in some way to performance, but immediately you say that the series doesn't aim to improve performance.
"On fault" means a device fault: the driver services a GPU fault with hmm_range_fault(HMM_PFN_REQ_FAULT | HMM_PFN_REQ_MIGRATE) and migrates the page while handling it. "Efficiently" was the wrong word: I meant faulting and collecting in a single walk, instead of two or three calls with a window in between. I'll reword the cover letter.
Quoted 9 lines
Quoted 3 lines
hmm_range_fault()) callers. That said, the migrate throughput tests from the selftests show that there is at least no regression for currentmigrate_vma_setup()callers.If the premise of the series is to reduce the number of page table walks in the !pte_present() case, then I think benchmarks that show a performance improvement would make a compelling case for this approach.
Some thoughts, if I may:
Quoted 8 lines
- Perhaps the existing test is not the right test to highlight the performance gains?
- Perhaps there are other parts of the migration process that dominate the walks? If so, maybe we should be focusing our attention on those?
- Perhaps the series adds overhead that reduces or cancels the gains from reducing the number of walks?
I don't have a benchmark showing a gain: nouveau had no migrate on fault to compare against, and the selfftest throughput tests use migrate_vma_setup() on present pages, so they can only show there's no regression, including from the extra work in the HMM walk. Also, any help with new tests is greatly welcome :). My primary focus atm is getting the final corner case details sorted out in the core and addressing sashiko; with v18 i hope being there.
Quoted 2 lines
Thanks,
Alex
Thanks,
--Mika
Quoted 71 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
I try to answer your questions, there are quite a bunch of them!
Quoted 16 lines · On Tue, Nov 03, 2026 at 08:16:17AM +0200, [email protected] wrote:
Quoted 15 lines
From: Mika Penttilä <[email protected]>
Currently, the way device page faulting and migration works is not optimal, if you want to do both fault handling and migration at once.
Being able to migrate not present pages (or pages mapped with incorrect permissions, eg. COW) to the GPU requires doing either of the following sequences:
1.
hmm_range_fault()- fault in non-present pages with correct permissions, etc.
2. migrate_vma_*() - migrate the pagesOr:
Quoted 7 lines
Quoted 4 lines
1. migrate_vma_*() - migrate present pages
2. If non-present pages detected by migrate_vma_*():
a) callhmm_range_fault()to fault pages in
b) call migrate_vma_*() again to migrate now present pagesRegarding both sequences, I'm trying to get a better understanding of what the issue is. I assume the caller wants to fault in system memory, and then migrate it to the device. Is that correct?
Yes that's the common thing to do.
Quoted 25 lines
In my analysis I'm also not going to refer to THPs, since that would make things even more complicated than they are. I think we can come back to THPs later if we think it would be useful.
For the !pte_present() case:
Sequence 1:
hmm_range_fault()-> .. ->hmm_vma_handle_pte()handles !pte_present() pages in two ways: faults in swap pages and device private pages belonging to a different device, and waits on migration entries. Then the migrate_vma_*() flow is used to migrate the range.Sequence 2:
migrate_vma_setup()ignores !pte_present() page table entries After this, the caller follows the same steps as in sequence 1 -hmm_range_fault()faults in !pte_present() pages, and migrate_vma_*() is called again to migrate the pages that were faulted in/waited on byhmm_range_fault().Now, for the CoW case that you mentioned, I'm going to assume that the caller wants write permissions otherwise nothing needs to be done:
Sequence 1:
hmm_range_fault()->hmm_vma_handle_pte()records a fault (hmm_pte_need_fault()returnsHMM_NEED_FAULT|HMM_NEED_WRITE_FAULT),handle_mm_fault()-> .. ->do_wp_page()breaks CoW and maps an exclusive folio with write permissions, then the migrate_vma_* flow will take care ofQuoted 7 lines
Sequence 2,
migrate_vma_setup()installs migration entries for the page, thenmigrate_vma_finalize()replaces the migration entries with device private entries.Looks to me that for CoW pages, all that's needed is migrate_vma_*(), and the subsequent calls to
hmm_range_fault()and migrate_vma_*() are not necessary. Is that your conclusion too?
Quoted 8 lines
For a device fault: the driver want the data in device memory with the permissions the device asked for. Your !pte_present() analysis matches; note that
pte_none()in anonymous vmas and the zero page don't needhmm_range_fault()at all, migrate_vma_*() populates them directly. That's why the common case is cheap with sequence 2, and only swap entries, other devices private pages and migration entries need the extra walks.
For cow with write intent migrate_vma_*() alone is enough.
Is *not* enough meant to say
--Mika
Hi Mika,
Quoted 11 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
The series is big, and as far as I can tell the MM people are hard at work reviewing bug fixes. It might be better to wait a while, to give people a chance to have a look? I know that if I see a series being reposted often, I am less inclined to review the patches since probably a new iteration will be posted soon. But I can only speak for myself, you know best.
Quoted 2 lines
I try to answer your questions, there are quite a bunch of them!
Thanks for your replies, it's going to take me a while to digest them. Despite the silence, I'm working on it!
Thanks,
Alex
Zi Yan
reviewerQuoted 12 lines · Alexandru Elisei
Hi Mika,
Quoted 9 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Quoted 8 lines
Quoted 2 lines
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
The series is big, and as far as I can tell the MM people are hard at work reviewing bug fixes. It might be better to wait a while, to give people a chance to have a look? I know that if I see a series being reposted often, I am less inclined to review the patches since probably a new iteration will be posted soon. But I can only speak for myself, you know best.
Totally agree. It is better to wait until MM people finish the bug fixes.
Thanks.
Best Regards,
Yan, Zi
Quoted 11 lines · Alexandru Elisei
Hi Mika,
Quoted 8 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Quoted 7 lines
Quoted 2 lines
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
The series is big, and as far as I can tell the MM people are hard at work reviewing bug fixes. It might be better to wait a while, to give people a chance to have a look? I know that if I see a series being reposted often, I am less inclined to review the patches since probably a new iteration will be posted soon. But I can only speak for myself, you know best.
True, my motivation for quickish repost is to address sashiko concerns, and after that give time to reviewers.
Quoted 4 lines
Quoted 2 lines
I try to answer your questions, there are quite a bunch of them!
Thanks for your replies, it's going to take me a while to digest them. Despite the silence, I'm working on it!
Appreciate it!
Quoted 2 lines
Thanks,
Thanks,
--Mika
Quoted 2 lines
Alex
Quoted 13 lines · Zi Yan
Quoted 11 lines · Alexandru Elisei
Hi Mika,
Quoted 8 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
The series is big, and as far as I can tell the MM people are hard at work reviewing bug fixes. It might be better to wait a while, to give people a chance to have a look? I know that if I see a series being reposted often, I am less inclined to review the patches since probably a new iteration will be posted soon. But I can only speak for myself, you know best.
Totally agree. It is better to wait until MM people finish the bug fixes.
I was going to send fix series to few regressions by earlier posting - no new features or anything - with the mindset that it is better then to review a fixed series than known buggy.
Quoted 5 lines
Thanks.
Best Regards,
Thanks,
--Mika
Quoted 2 lines
Yan, Zi
Zi Yan
reviewerQuoted 21 lines · Mika Penttilä
Quoted 20 lines · Zi Yan
Quoted 18 lines · Alexandru Elisei
Hi Mika,
Quoted 10 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
The series is big, and as far as I can tell the MM people are hard at work reviewing bug fixes. It might be better to wait a while, to give people a chance to have a look? I know that if I see a series being reposted often, I am less inclined to review the patches since probably a new iteration will be posted soon. But I can only speak for myself, you know best.
Quoted 5 lines
Quoted 1 line
Totally agree. It is better to wait until MM people finish the bug fixes.
I was going to send fix series to few regressions by earlier posting - no new features or anything - with the mindset that it is better then to review a fixed series than known buggy.
https://lore.kernel.org/linux-mm/[email protected]/
Best Regards,
Yan, Zi
Jason Gunthorpe
maintainerQuoted 12 lines · Alexandru Elisei
Hi Mika,
Quoted 9 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Quoted 8 lines
Quoted 2 lines
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
The series is big, and as far as I can tell the MM people are hard at work reviewing bug fixes. It might be better to wait a while, to give people a chance to have a look? I know that if I see a series being reposted often, I am less inclined to review the patches since probably a new iteration will be posted soon. But I can only speak for myself, you know best.
It is at v17 and it is still getting high severity sashiko errors
I've been ignoring it until this improves..
You really need to run sashiko locally and not rely on the upstream one.
Jason
Quoted 12 lines · Jason Gunthorpe
Quoted 11 lines · Alexandru Elisei
Hi Mika,
Quoted 8 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
The series is big, and as far as I can tell the MM people are hard at work reviewing bug fixes. It might be better to wait a while, to give people a chance to have a look? I know that if I see a series being reposted often, I am less inclined to review the patches since probably a new iteration will be posted soon. But I can only speak for myself, you know best.
It is at v17 and it is still getting high severity sashiko errors
v14 was first that sashiko managed to review. There was a regression in last posting, but also false potsitives, and sashiko reports same issue then 3-4 times, so the reality is not that bad.
Quoted 6 lines
I've been ignoring it until this improves..
You really need to run sashiko locally and not rely on the upstream one.
Jason
--Mika
Andrew Morton
maintainerQuoted 21 lines · On Thu, 12 Nov 2026 19:01:58 +0200 Mika Penttilä <[email protected]> wrote:
Quoted 19 lines · Jason Gunthorpe
Quoted 18 lines · Alexandru Elisei
Hi Mika,
Quoted 10 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
The series is big, and as far as I can tell the MM people are hard at work reviewing bug fixes. It might be better to wait a while, to give people a chance to have a look? I know that if I see a series being reposted often, I am less inclined to review the patches since probably a new iteration will be posted soon. But I can only speak for myself, you know best.
Quoted 4 lines
Quoted 1 line
It is at v17 and it is still getting high severity sashiko errors
v14 was first that sashiko managed to review. There was a regression in last posting, but also false potsitives, and sashiko reports same issue then 3-4 times, so the reality is not that bad.
Pining for the days when all we had to deal with was checkpatch.
Mika, afaict the entire patchset is a performance optimization, yet you say "I don't have a benchmark showing a gain".
Recipients look at patchsets wondering "why should I spend time on this", especially in these times. It's best to answer this question right there in the first sentence of the [0/N]. That means numbers, and the better they are, the more attention the patchset will get.
Quoted 6 lines
Documentation/mm/hmm.rst | 45 + drivers/gpu/drm/nouveau/nouveau_dmem.c | 402 ++++++++- drivers/gpu/drm/nouveau/nouveau_dmem.h | 12 + drivers/gpu/drm/nouveau/nouveau_svm.c | 155 ++-- drivers/gpu/drm/nouveau/nouveau_svm.h | 5 + include/linux/hmm.h | 51 +-
Quoted 8 lines
include/linux/migrate.h | 59 +- lib/test_hmm.c | 174 +++- lib/test_hmm_uapi.h | 21 +- mm/Kconfig | 1 + mm/hmm.c | 1075 ++++++++++++++++++++++-- mm/migrate_device.c | 618 +++----------- tools/testing/selftests/mm/hmm-tests.c | 56 ++ 13 files changed, 1984 insertions(+), 690 deletions(-)
also, yikes!
Quoted 22 lines · Andrew Morton
Quoted 20 lines · On Thu, 12 Nov 2026 19:01:58 +0200 Mika Penttilä <[email protected]> wrote:
Quoted 19 lines · Jason Gunthorpe
Quoted 18 lines · Alexandru Elisei
Hi Mika,
Quoted 10 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
The series is big, and as far as I can tell the MM people are hard at work reviewing bug fixes. It might be better to wait a while, to give people a chance to have a look? I know that if I see a series being reposted often, I am less inclined to review the patches since probably a new iteration will be posted soon. But I can only speak for myself, you know best.
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
It is at v17 and it is still getting high severity sashiko errors
v14 was first that sashiko managed to review. There was a regression in last posting, but also false potsitives, and sashiko reports same issue then 3-4 times, so the reality is not that bad.
Pining for the days when all we had to deal with was checkpatch.
Yeah.. running sashiko locally now. Interesting enough, refactoring the series (end result being the same) made most of the "high errors" disappear.
Quoted 2 lines
Mika, afaict the entire patchset is a performance optimization, yet you say "I don't have a benchmark showing a gain".
No not a performance optimization as is, in the latest cover I explain it:
"The main goal of this patchset is to provide a new feature, migrate efficiently on fault, and not directly improve performance of current migrate_vma_setup() (which is now routed thru hmm_range_fault()) callers."
The "efficiently" is wrong word, I should say "in one walk". In the beginning of the cover, I explain the benefits of having one walk. Also, I think it is sensible to have one implementation for it in HMM, instead of each driver trying to do something similar.
We don't currently have in kernel the capability to do migrate on fault in one walk, so I can't show a performance gain with a simple apples to apples test.
Also :
"the selftests show that there is at least no regression for current migrate_vma_setup() callers."
So the test is to show there is no regression still for current callers (X86-64), not to show if there would be gains.
Quoted 20 lines
Recipients look at patchsets wondering "why should I spend time on this", especially in these times. It's best to answer this question right there in the first sentence of the [0/N]. That means numbers, and the better they are, the more attention the patchset will get.
Quoted 6 lines
Documentation/mm/hmm.rst | 45 + drivers/gpu/drm/nouveau/nouveau_dmem.c | 402 ++++++++- drivers/gpu/drm/nouveau/nouveau_dmem.h | 12 + drivers/gpu/drm/nouveau/nouveau_svm.c | 155 ++-- drivers/gpu/drm/nouveau/nouveau_svm.h | 5 + include/linux/hmm.h | 51 +-Quoted 8 lines
include/linux/migrate.h | 59 +- lib/test_hmm.c | 174 +++- lib/test_hmm_uapi.h | 21 +- mm/Kconfig | 1 + mm/hmm.c | 1075 ++++++++++++++++++++++-- mm/migrate_device.c | 618 +++----------- tools/testing/selftests/mm/hmm-tests.c | 56 ++ 13 files changed, 1984 insertions(+), 690 deletions(-)
Quoted 1 line
also, yikes!
Yeah, the nouveau made the numbers bigger - but we have a real user!
--Mika
Hi Mika,
Quoted 35 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
I try to answer your questions, there are quite a bunch of them!
Quoted 21 lines · On Tue, Nov 03, 2026 at 08:16:17AM +0200, [email protected] wrote:
Quoted 19 lines
From: Mika Penttilä <[email protected]>
Currently, the way device page faulting and migration works is not optimal, if you want to do both fault handling and migration at once.
Being able to migrate not present pages (or pages mapped with incorrect permissions, eg. COW) to the GPU requires doing either of the following sequences:
1.
hmm_range_fault()- fault in non-present pages with correct permissions, etc.
2. migrate_vma_*() - migrate the pagesOr:
1. migrate_vma_*() - migrate present pages
2. If non-present pages detected by migrate_vma_*():
a) callhmm_range_fault()to fault pages in
b) call migrate_vma_*() again to migrate now present pages
Quoted 5 lines
Quoted 3 lines
Regarding both sequences, I'm trying to get a better understanding of what the issue is. I assume the caller wants to fault in system memory, and then migrate it to the device. Is that correct?
Yes that's the common thing to do.
Gotcha, thanks.
Quoted 36 lines
Quoted 28 lines
In my analysis I'm also not going to refer to THPs, since that would make things even more complicated than they are. I think we can come back to THPs later if we think it would be useful.
For the !pte_present() case:
Sequence 1:
hmm_range_fault()-> .. ->hmm_vma_handle_pte()handles !pte_present() pages in two ways: faults in swap pages and device private pages belonging to a different device, and waits on migration entries. Then the migrate_vma_*() flow is used to migrate the range.Sequence 2:
migrate_vma_setup()ignores !pte_present() page table entries After this, the caller follows the same steps as in sequence 1 -hmm_range_fault()faults in !pte_present() pages, and migrate_vma_*() is called again to migrate the pages that were faulted in/waited on byhmm_range_fault().Now, for the CoW case that you mentioned, I'm going to assume that the caller wants write permissions otherwise nothing needs to be done:
Sequence 1:
hmm_range_fault()->hmm_vma_handle_pte()records a fault (hmm_pte_need_fault()returnsHMM_NEED_FAULT|HMM_NEED_WRITE_FAULT),handle_mm_fault()-> .. ->do_wp_page()breaks CoW and maps an exclusive folio with write permissions, then the migrate_vma_* flow will take care ofQuoted 7 lines
Sequence 2,
migrate_vma_setup()installs migration entries for the page, thenmigrate_vma_finalize()replaces the migration entries with device private entries.Looks to me that for CoW pages, all that's needed is migrate_vma_*(), and the subsequent calls to
hmm_range_fault()and migrate_vma_*() are not necessary. Is that your conclusion too?
Quoted 7 lines
For a device fault: the driver want the data in device memory with the permissions the device asked for. Your !pte_present() analysis matches; note that
pte_none()in anonymous vmas and the zero page don't needhmm_range_fault()at all, migrate_vma_*() populates them directly. That's why the common case is cheap with sequence 2, and only swap entries, other devices private pages and migration entries need the extra walks.
Yes.
Quoted 11 lines
For cow with write intent migrate_vma_*() alone is enough.
migrate_vma_setup()doesnt break cow: it collects the shared page through its read-only pte, so there's noMIGRATE_PFN_WRITE, andtry_to_migrate()unmaps all its mappings, so finalize installs a read-only device private entry.The device still cant write; a write then has to go through
migrate_to_ram()and break cow in system memory, and migrate again. To get an exclusive writable copy on the device, cow has to be broken before collectin, i.e.hmm_range_fault()withHMM_PFN_REQ_WRITEfirst, then migrate: two walks.
Makes sense, something did seem fishy with my analysis of the CoW case.
Quoted 56 lines
With this series that's one walk,
HMM_PFN_REQ_FAULT|HMM_PFN_REQ_WRITE|HMM_PFN_REQ_MIGRATE(orMIGRATE_VMA_WRITEformigrate_vma_setup()users), and only the now-exclusive page is migrated.Quoted 8 lines
Quoted 4 lines
The problem with the first sequence is that you always have to do two page walks even when most of the time the pages are present or zero page mappings so the common case takes a performance hit.
This is the first mention of the zero page. Is the caller specifying
HMM_PFN_REQ_WRITE? That makes a difference, because it triggers fault handling for the zero page, and that's an extra walk. Can you give more details here?Good question on the zero page. With a read request it need no fault:
migrate_vma_*() populates it likepte_none(), and the HMM walk collects it the same way. WithHMM_PFN_REQ_WRITEit's write-faulted first, in sequence 1 and with this series alike; the difference is that the series faults and collects in the same walk.Quoted 29 lines
Let's count page table walks when a page is mapped with a valid entry, and with the required permissions. Let's say N is the number of mappings for the page (equivalent to the number of VMAs that map the page):
hmm_range_fault()-> .. ->hmm_vma_handle_pte()does one page table walk,migrate_vma_setup()does N page tables walks, to replace all valid mappings of the page with migration entries,migrate_vma_finalize()does N page table walks, to replace the migration entries with device entries.In total 1 + 2*N walks. Best case scenario, N == 1 (
PageAnonExclusive()), that's three walks.Do you have any data regarding how often the best case scenario happens? That's what you seem to be referring to in your comment.
Now let's count the number of walks for a !pte_present() page mapped in P VMAs, where P != N: one from
hmm_range_fault(), if the entry is not a migration entry, another walk in the fault handler, then 2*P walks from the migrate_vma_*() flow.If it's a migration entry, it requires 1 + 2*P walks, PLUS waiting on migration to complete, which cannot be skipped.
If it's a swap entry, it requires 2 + 2*P walks, PLUS waiting on swap.
If it's a device private entry belonging to a different device, it requires 2 + 2*P walks, plus waiting on the device to sync the memory with the device in
migrate_to_ram().Quoted 6 lines
To summarize:
pte_present()1 + 2*N walks
migration entry 1 + 2*P walks + waiting on migration
swap entry 2 + 2*P walks + waiting on swap
device private 2 + 2*P walks + waiting ondevice->memorysync
Quoted 8 lines
On counting: the 2N (or 2P) rmap walks that replace the mappings with migration entries and then device entries are inherent to migrating the page and are the same in all variants. What differs is the number of page table walks over the range: sequence 1 allways does two (
hmm_range_fault(), thenmigrate_vma_setup()), sequence 2 one if everything is present and three otherwise, and the HMM walk one, with faults handled in place and the walk resuming from the faulting address. The saving is per range walk, so it scales with the range.
I think we might need to define what you mean by 'saving'. Normally, I would assume that you mean that 'the total time of migration is decreased', but the fact that the benchmark that you offered doesn't show this makes me wonder.
The more !pte_present() pages are in the range, the smaller the amortized cost of a walk per page in the range. For example, using sequence one, for 512 !pte_present() pages, the current code does an extra 1/512 page table walks per page (for sequence two, an extra 1/512 * 2 walks). At the same time, for each page it needs to do a fault, or swap in, or wait on migration, or break CoW, or put migration+device entries in each VMA that maps the page.
I think the worst case scenario is the device wanting to fault in one page from system memory. Is that what usually happens?
Quoted 7 lines
I don't have data on how often the best case happens. The motivation came from earlier prototyping of migrate on fault on the current interfaces, where the extra walks showed up in perf traces. For the typical SVM case of private anonymous memory without fork the pages are exclusive (N == 1) or not yet populated, but I haven't measured a distribution.
Got it, that's what I wanted to know, the typical case is exclusive memory.
Quoted 45 lines
Quoted 41 lines
Quoted 6 lines
The second sequence is better for the common case, but far worse if pages aren't present because now you have to walk the page tables three times (once to find the page is not present, once so
hmm_range_fault()can find a non-present page to fault in and once again to setup the migration). It is also tricky to code correctly. One page table walkValid entry, the page is mapped in N VMAs: migrate_vma_*() does 2*N walks, best case scenario (PageAnonExclusive) two walks.
!pte_present, the page is mapped in P VMAs:
migrate_vma_setup()->migrate_vma_collect()will always do one page table walk, regardless of what it finds, valid or invalid entries.migrate_vma_collect()ignores !pte_present() entries, and they will not trigger new walks in the next steps in the migrate_vma_* flow. Worst case is that all the pages are !pte_present(), that's one walk to find them all which I would say it translates to zero extra walks for an individual page.For
hmm_range_fault(), it's the same situation as above: 1 + 2*P or 2 + 2*P walks.To summarize:
pte_present()2*N walksmigration_entry1 + 2*P walks + waiting on migration
swap entry 2 + 2*P walks + waiting on migration
device private 2 + 2*P walks + waiting on devicememory->memorysyncI agree with you, this second sequence is better for the common case.
I think it would interesting to know:
1. Is there a relationship between N and P, and if there is, what is it? Are they equal, on average? I doubt it. Is a !pte_present() page likely to be mapped in more VMAs than a
pte_present()page, or fewer?2. What is the likelyhood of P being equal to 1 (PageAnonExclusive)? That would be interesting to know because the larger P is, the contribution of that extra walk (or two walks) to the total time becomes less and less significant.
Quoted 4 lines
3. How does the time to do the walk compare to the time spent waiting on migration, or waiting on swap, or waiting on device to memory sync? How often each of them happen? I have a hunch that these will tend to dominate the total time.
Quoted 8 lines
Yes, when a page needs swap-in, a migration wait or a device sync, that wait dominates..
The walk saving matters on the common device fault path, with small ranges (one page per fault in the nouveau patch) and present or unpopulated pages: one walk instead of two, and without sequence 2's three when part of the range isn't present. But the main point is one call that faults and collects consistently, instead of two with a window in between where the range can change.
This is introducing another variable into the mix. It's not just the number of page table walks, it's also the fact that in between walks the mapping might have changed. I think this is why it's good to have a representative benchmarks :)
Quoted 21 lines
I don't have data on N and P. For private anonymous memory without fork or KSM both are normally 1, but I haven't measured it.
Quoted 11 lines
Quoted 11 lines
could costs over 1000 cpu cycles on X86-64, which is a significant hit.
We should be able to walk the page table once, faulting pages in as required and replacing them with migration entries if requested.
Add a new flag to HMM APIs,
HMM_PFN_REQ_MIGRATE,
which tells to prepare for migration also during fault handling. For themigrate_vma_setup()call paths, new flags,MIGRATE_VMA_FAULT, andMIGRATE_VMA_WRITEare added to tell to add fault handling to migrate.Quoted 7 lines
Quoted 6 lines
An extra benefit of migrating with
hmm_range_fault()path is the migrate_vma.vma gets populated, so no need to retrieve that separataly.This series avoids the problems in current collecting implementation, where racing
MADV_DONTNEEDcould make the collecting arrays overflow.Can you provide more details here? How does it happen?
Quoted 9 lines
migrate_vma_collect_pmd()drops the pte lock to split a large folio and restarts with [start, addr) already appended to src[]/dst[]. If a racingMADV_DONTNEEDzaps the range and frees the pte table meanwhile, the re start takes the hole path from start and append [start, addr) again, writing past the arrays. "mm/migrate_device: don't collect a range twice" in Lorenzo's batch fixes that instance; this series collects into the address-indexedhmm_pfnsand fills src[] only lastly, so re-walking cant overrun. Also, the correct pages are collected with the re-walk with this series(rollback takes care of the old ones).
That can be accomplished with the upstream code too, this series isn't required (just off the top of my head, keep a local counter for the total number of pages collected by migrate_vma_collect_pmd(), use it as an offset into migrate->src and migrate->dst, and reset the counter on the 'again' label).
Quoted 1 line
There are couple other defects the series fixed along the way.
Hmm... the size of this series might put off some people who are interested only in the fixes. Have you considered splitting them into standalone patches/series?
Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
This is achieved mainly by having a rollback mechanism and populating the collecting array as the last step.
Tested in X86-64 VM with HMM test device, passing the selftests.
Have you tested that this series doesn't regress other architectures?
Only tested on x86-64 (VM with
test_hmm, and nouveau on a GP102). The code is arch-independent, but it isn't tested elsewhere.
Sorry, I'm a bit confused - what do you mean by it isn't tested elsewhere? x86-64 specific code is the only user for the arch-independent code?
Quoted 10 lines
Quoted 10 lines
Quoted 6 lines
The main goal of this patchset is to provide a new feature, migrate efficiently on fault, and not directly improve performance of current
migrate_vma_setup()(which is now routed thruI'm a bit confused by what 'on fault' means in this context? Userspace accesses a device entry, access that causes a fault, or using
hmm_range_fault()? I assume the latter, but it pays to make sure.
Quoted 6 lines
Quoted 3 lines
Also, can you define efficiently? Usually that's related in some way to performance, but immediately you say that the series doesn't aim to improve performance.
"On fault" means a device fault: the driver services a GPU fault with
hmm_range_fault(HMM_PFN_REQ_FAULT | HMM_PFN_REQ_MIGRATE)and migrates
Got it, thanks.
Quoted 3 lines
the page while handling it. "Efficiently" was the wrong word: I meant faulting and collecting in a single walk, instead of two or three calls with a window in between. I'll reword the cover letter.
Ok, gotcha.
Quoted 19 lines
Quoted 10 lines
Quoted 4 lines
hmm_range_fault()) callers. That said, the migrate throughput tests from the selftests show that there is at least no regression for currentmigrate_vma_setup()callers.If the premise of the series is to reduce the number of page table walks in the !pte_present() case, then I think benchmarks that show a performance improvement would make a compelling case for this approach.
Some thoughts, if I may:
Quoted 8 lines
- Perhaps the existing test is not the right test to highlight the performance gains?
- Perhaps there are other parts of the migration process that dominate the walks? If so, maybe we should be focusing our attention on those?
- Perhaps the series adds overhead that reduces or cancels the gains from reducing the number of walks?
Quoted 7 lines
I don't have a benchmark showing a gain: nouveau had no migrate on fault to compare against, and the selfftest throughput tests use
migrate_vma_setup()on present pages, so they can only show there's no regression, including from the extra work in the HMM walk. Also, any help with new tests is greatly welcome :). My primary focus atm is getting the final corner case details sorted out in the core and addressing sashiko; with v18 i hope being there.
This is how I see this series, please correct me if I got something wrong. The aim is to reduce the total number of page table walks over the range by one or two (depending on the sequence of functions used) when !pte_present(), or when pte_present(), but without write permissions.
From our discussion so far it seems to me that the total migration time in the above cases depends on a number of things:
- In how many other VMAs these pages are mapped, as each mapping needs to be replaced with migration entries, and then with device special entries.
- How long it takes to swap in the page, if the page is mapped using a swap entry.
- How long it takes to complete a concurrent migration, if the page is mapped using a migration entry.
- How long it takes to migrate a device entry back to system memory, if the page belongs to a different device.
- If the page is CoW, how long it takes to break CoW.
- What happens in between walks.
The code touches 2,600+ lines of code, with almost 1,300 lines added. It removes those extra page table walks, of course, but it also offers plenty of scope to add new inefficiencies (or bugs), and if that's the case, we don't gain anything other than complexity. I think having a benchmark representative of a real workload, or a real workload, that shows a decrease in the total migration time will be great to demonstrate that we are on the right track :)
Thanks,
Alex
Hi,
Quoted 172 lines · Alexandru Elisei
Hi Mika,
Quoted 29 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
I try to answer your questions, there are quite a bunch of them!
Quoted 16 lines · On Tue, Nov 03, 2026 at 08:16:17AM +0200, [email protected] wrote:
Quoted 15 lines
From: Mika Penttilä <[email protected]>
Currently, the way device page faulting and migration works is not optimal, if you want to do both fault handling and migration at once.
Being able to migrate not present pages (or pages mapped with incorrect permissions, eg. COW) to the GPU requires doing either of the following sequences:
1.
hmm_range_fault()- fault in non-present pages with correct permissions, etc.
2. migrate_vma_*() - migrate the pagesOr:
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
1. migrate_vma_*() - migrate present pages
2. If non-present pages detected by migrate_vma_*():
a) callhmm_range_fault()to fault pages in
b) call migrate_vma_*() again to migrate now present pagesRegarding both sequences, I'm trying to get a better understanding of what the issue is. I assume the caller wants to fault in system memory, and then migrate it to the device. Is that correct?
Yes that's the common thing to do.
Gotcha, thanks.
Quoted 33 lines
Quoted 26 lines
In my analysis I'm also not going to refer to THPs, since that would make things even more complicated than they are. I think we can come back to THPs later if we think it would be useful.
For the !pte_present() case:
Sequence 1:
hmm_range_fault()-> .. ->hmm_vma_handle_pte()handles !pte_present() pages in two ways: faults in swap pages and device private pages belonging to a different device, and waits on migration entries. Then the migrate_vma_*() flow is used to migrate the range.Sequence 2:
migrate_vma_setup()ignores !pte_present() page table entries After this, the caller follows the same steps as in sequence 1 -hmm_range_fault()faults in !pte_present() pages, and migrate_vma_*() is called again to migrate the pages that were faulted in/waited on byhmm_range_fault().Now, for the CoW case that you mentioned, I'm going to assume that the caller wants write permissions otherwise nothing needs to be done:
Sequence 1:
hmm_range_fault()->hmm_vma_handle_pte()records a fault (hmm_pte_need_fault()returnsHMM_NEED_FAULT|HMM_NEED_WRITE_FAULT),handle_mm_fault()-> .. ->do_wp_page()breaks CoW and maps an exclusive folio with write permissions, then the migrate_vma_* flow will take care ofQuoted 7 lines
Sequence 2,
migrate_vma_setup()installs migration entries for the page, thenmigrate_vma_finalize()replaces the migration entries with device private entries.Looks to me that for CoW pages, all that's needed is migrate_vma_*(), and the subsequent calls to
hmm_range_fault()and migrate_vma_*() are not necessary. Is that your conclusion too?Quoted 7 lines
For a device fault: the driver want the data in device memory with the permissions the device asked for. Your !pte_present() analysis matches; note that
pte_none()in anonymous vmas and the zero page don't needhmm_range_fault()at all, migrate_vma_*() populates them directly. That's why the common case is cheap with sequence 2, and only swap entries, other devices private pages and migration entries need the extra walks.Yes.
Quoted 11 lines
For cow with write intent migrate_vma_*() alone is enough.
migrate_vma_setup()doesnt break cow: it collects the shared page through its read-only pte, so there's noMIGRATE_PFN_WRITE, andtry_to_migrate()unmaps all its mappings, so finalize installs a read-only device private entry.The device still cant write; a write then has to go through
migrate_to_ram()and break cow in system memory, and migrate again. To get an exclusive writable copy on the device, cow has to be broken before collectin, i.e.hmm_range_fault()withHMM_PFN_REQ_WRITEfirst, then migrate: two walks.Makes sense, something did seem fishy with my analysis of the CoW case.
Quoted 54 lines
With this series that's one walk,
HMM_PFN_REQ_FAULT|HMM_PFN_REQ_WRITE|HMM_PFN_REQ_MIGRATE(orMIGRATE_VMA_WRITEformigrate_vma_setup()users), and only the now-exclusive page is migrated.Quoted 7 lines
Quoted 3 lines
The problem with the first sequence is that you always have to do two page walks even when most of the time the pages are present or zero page mappings so the common case takes a performance hit.
This is the first mention of the zero page. Is the caller specifying
HMM_PFN_REQ_WRITE? That makes a difference, because it triggers fault handling for the zero page, and that's an extra walk. Can you give more details here?Good question on the zero page. With a read request it need no fault:
migrate_vma_*() populates it likepte_none(), and the HMM walk collects it the same way. WithHMM_PFN_REQ_WRITEit's write-faulted first, in sequence 1 and with this series alike; the difference is that the series faults and collects in the same walk.Quoted 29 lines
Let's count page table walks when a page is mapped with a valid entry, and with the required permissions. Let's say N is the number of mappings for the page (equivalent to the number of VMAs that map the page):
hmm_range_fault()-> .. ->hmm_vma_handle_pte()does one page table walk,migrate_vma_setup()does N page tables walks, to replace all valid mappings of the page with migration entries,migrate_vma_finalize()does N page table walks, to replace the migration entries with device entries.In total 1 + 2*N walks. Best case scenario, N == 1 (
PageAnonExclusive()), that's three walks.Do you have any data regarding how often the best case scenario happens? That's what you seem to be referring to in your comment.
Now let's count the number of walks for a !pte_present() page mapped in P VMAs, where P != N: one from
hmm_range_fault(), if the entry is not a migration entry, another walk in the fault handler, then 2*P walks from the migrate_vma_*() flow.If it's a migration entry, it requires 1 + 2*P walks, PLUS waiting on migration to complete, which cannot be skipped.
If it's a swap entry, it requires 2 + 2*P walks, PLUS waiting on swap.
If it's a device private entry belonging to a different device, it requires 2 + 2*P walks, plus waiting on the device to sync the memory with the device in
migrate_to_ram().Quoted 6 lines
To summarize:
pte_present()1 + 2*N walks
migration entry 1 + 2*P walks + waiting on migration
swap entry 2 + 2*P walks + waiting on swap
device private 2 + 2*P walks + waiting ondevice->memorysyncQuoted 8 lines
On counting: the 2N (or 2P) rmap walks that replace the mappings with migration entries and then device entries are inherent to migrating the page and are the same in all variants. What differs is the number of page table walks over the range: sequence 1 allways does two (
hmm_range_fault(), thenmigrate_vma_setup()), sequence 2 one if everything is present and three otherwise, and the HMM walk one, with faults handled in place and the walk resuming from the faulting address. The saving is per range walk, so it scales with the range.I think we might need to define what you mean by 'saving'. Normally, I would assume that you mean that 'the total time of migration is decreased', but the fact that the benchmark that you offered doesn't show this makes me wonder.
The more !pte_present() pages are in the range, the smaller the amortized cost of a walk per page in the range. For example, using sequence one, for 512 !pte_present() pages, the current code does an extra 1/512 page table walks per page (for sequence two, an extra 1/512 * 2 walks). At the same time, for each page it needs to do a fault, or swap in, or wait on migration, or break CoW, or put migration+device entries in each VMA that maps the page.
Quoted 2 lines
I think the worst case scenario is the device wanting to fault in one page from system memory. Is that what usually happens?
Well that's what the nouveau does currently, but as I write in the commit log, a better policy would be nice... Otoh, that works as a good stress test on the code when pages migrate back and forth on demand.
Quoted 61 lines
Quoted 7 lines
I don't have data on how often the best case happens. The motivation came from earlier prototyping of migrate on fault on the current interfaces, where the extra walks showed up in perf traces. For the typical SVM case of private anonymous memory without fork the pages are exclusive (N == 1) or not yet populated, but I haven't measured a distribution.
Got it, that's what I wanted to know, the typical case is exclusive memory.
Quoted 44 lines
Quoted 40 lines
Quoted 5 lines
The second sequence is better for the common case, but far worse if pages aren't present because now you have to walk the page tables three times (once to find the page is not present, once so
hmm_range_fault()can find a non-present page to fault in and once again to setup the migration). It is also tricky to code correctly. One page table walkValid entry, the page is mapped in N VMAs: migrate_vma_*() does 2*N walks, best case scenario (PageAnonExclusive) two walks.
!pte_present, the page is mapped in P VMAs:
migrate_vma_setup()->migrate_vma_collect()will always do one page table walk, regardless of what it finds, valid or invalid entries.migrate_vma_collect()ignores !pte_present() entries, and they will not trigger new walks in the next steps in the migrate_vma_* flow. Worst case is that all the pages are !pte_present(), that's one walk to find them all which I would say it translates to zero extra walks for an individual page.For
hmm_range_fault(), it's the same situation as above: 1 + 2*P or 2 + 2*P walks.To summarize:
pte_present()2*N walksmigration_entry1 + 2*P walks + waiting on migration
swap entry 2 + 2*P walks + waiting on migration
device private 2 + 2*P walks + waiting on devicememory->memorysyncI agree with you, this second sequence is better for the common case.
I think it would interesting to know:
1. Is there a relationship between N and P, and if there is, what is it? Are they equal, on average? I doubt it. Is a !pte_present() page likely to be mapped in more VMAs than a
pte_present()page, or fewer?2. What is the likelyhood of P being equal to 1 (PageAnonExclusive)? That would be interesting to know because the larger P is, the contribution of that extra walk (or two walks) to the total time becomes less and less significant.
Quoted 4 lines
3. How does the time to do the walk compare to the time spent waiting on migration, or waiting on swap, or waiting on device to memory sync? How often each of them happen? I have a hunch that these will tend to dominate the total time.
Quoted 8 lines
Yes, when a page needs swap-in, a migration wait or a device sync, that wait dominates..
The walk saving matters on the common device fault path, with small ranges (one page per fault in the nouveau patch) and present or unpopulated pages: one walk instead of two, and without sequence 2's three when part of the range isn't present. But the main point is one call that faults and collects consistently, instead of two with a window in between where the range can change.
Quoted 4 lines
This is introducing another variable into the mix. It's not just the number of page table walks, it's also the fact that in between walks the mapping might have changed. I think this is why it's good to have a representative benchmarks :)
ack
Quoted 29 lines
Quoted 20 lines
I don't have data on N and P. For private anonymous memory without fork or KSM both are normally 1, but I haven't measured it.
Quoted 11 lines
Quoted 11 lines
could costs over 1000 cpu cycles on X86-64, which is a significant hit.
We should be able to walk the page table once, faulting pages in as required and replacing them with migration entries if requested.
Add a new flag to HMM APIs,
HMM_PFN_REQ_MIGRATE,
which tells to prepare for migration also during fault handling. For themigrate_vma_setup()call paths, new flags,MIGRATE_VMA_FAULT, andMIGRATE_VMA_WRITEare added to tell to add fault handling to migrate.Quoted 7 lines
Quoted 6 lines
An extra benefit of migrating with
hmm_range_fault()path is the migrate_vma.vma gets populated, so no need to retrieve that separataly.This series avoids the problems in current collecting implementation, where racing
MADV_DONTNEEDcould make the collecting arrays overflow.Can you provide more details here? How does it happen?
Quoted 9 lines
migrate_vma_collect_pmd()drops the pte lock to split a large folio and restarts with [start, addr) already appended to src[]/dst[]. If a racingMADV_DONTNEEDzaps the range and frees the pte table meanwhile, the re start takes the hole path from start and append [start, addr) again, writing past the arrays. "mm/migrate_device: don't collect a range twice" in Lorenzo's batch fixes that instance; this series collects into the address-indexedhmm_pfnsand fills src[] only lastly, so re-walking cant overrun. Also, the correct pages are collected with the re-walk with this series(rollback takes care of the old ones).
Quoted 5 lines
That can be accomplished with the upstream code too, this series isn't required (just off the top of my head, keep a local counter for the total number of pages collected by
migrate_vma_collect_pmd(), use it as an offset intomigrate->srcandmigrate->dst, and reset the counter on the 'again' label).
It's not that simple.. you have to rollback (unlock + unref) the so far collected pages. And to collect then the right pages from the start you have to rewalk and collect those again (and possibly a PMD as huge). Of course something like that can be done to current code, but address based indexing is more robust, and you end up with something like the HMM based collector :)
Quoted 5 lines
Quoted 2 lines
There are couple other defects the series fixed along the way.
Hmm... the size of this series might put off some people who are interested only in the fixes. Have you considered splitting them into standalone patches/series?
I might, but they don't apply directly to current collector.
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
This is achieved mainly by having a rollback mechanism and populating the collecting array as the last step.
Tested in X86-64 VM with HMM test device, passing the selftests.
Have you tested that this series doesn't regress other architectures?
Only tested on x86-64 (VM with
test_hmm, and nouveau on a GP102). The code is arch-independent, but it isn't tested elsewhere.Sorry, I'm a bit confused - what do you mean by it isn't tested elsewhere? x86-64 specific code is the only user for the arch-independent code?
I haven't personally tested on other arches the selftest (though I don't see why there would be problems to do so).
Quoted 64 lines
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
The main goal of this patchset is to provide a new feature, migrate efficiently on fault, and not directly improve performance of current
migrate_vma_setup()(which is now routed thruI'm a bit confused by what 'on fault' means in this context? Userspace accesses a device entry, access that causes a fault, or using
hmm_range_fault()? I assume the latter, but it pays to make sure.Quoted 5 lines
Quoted 3 lines
Also, can you define efficiently? Usually that's related in some way to performance, but immediately you say that the series doesn't aim to improve performance.
"On fault" means a device fault: the driver services a GPU fault with
hmm_range_fault(HMM_PFN_REQ_FAULT | HMM_PFN_REQ_MIGRATE)and migratesGot it, thanks.
Quoted 3 lines
the page while handling it. "Efficiently" was the wrong word: I meant faulting and collecting in a single walk, instead of two or three calls with a window in between. I'll reword the cover letter.
Ok, gotcha.
Quoted 17 lines
Quoted 9 lines
Quoted 3 lines
hmm_range_fault()) callers. That said, the migrate throughput tests from the selftests show that there is at least no regression for currentmigrate_vma_setup()callers.If the premise of the series is to reduce the number of page table walks in the !pte_present() case, then I think benchmarks that show a performance improvement would make a compelling case for this approach.
Some thoughts, if I may:
Quoted 8 lines
- Perhaps the existing test is not the right test to highlight the performance gains?
- Perhaps there are other parts of the migration process that dominate the walks? If so, maybe we should be focusing our attention on those?
- Perhaps the series adds overhead that reduces or cancels the gains from reducing the number of walks?
Quoted 7 lines
I don't have a benchmark showing a gain: nouveau had no migrate on fault to compare against, and the selfftest throughput tests use
migrate_vma_setup()on present pages, so they can only show there's no regression, including from the extra work in the HMM walk. Also, any help with new tests is greatly welcome :). My primary focus atm is getting the final corner case details sorted out in the core and addressing sashiko; with v18 i hope being there.This is how I see this series, please correct me if I got something wrong. The aim is to reduce the total number of page table walks over the range by one or two (depending on the sequence of functions used) when !pte_present(), or when
pte_present(), but without write permissions.From our discussion so far it seems to me that the total migration time in the above cases depends on a number of things:
- In how many other VMAs these pages are mapped, as each mapping needs to be replaced with migration entries, and then with device special entries.
- How long it takes to swap in the page, if the page is mapped using a swap entry.
- How long it takes to complete a concurrent migration, if the page is mapped using a migration entry.
- How long it takes to migrate a device entry back to system memory, if the page belongs to a different device.
- If the page is CoW, how long it takes to break CoW.
- What happens in between walks.
Quoted 4 lines
The code touches 2,600+ lines of code, with almost 1,300 lines added. It removes those extra page table walks, of course, but it also offers plenty of scope to add new inefficiencies (or bugs), and if that's the case, we don't gain anything other than complexity.
The saving isn't only for !pte_present() or read-only ptes. Migrating on device fault today takes two separate steps: hmm_range_fault() to fault the range in, then migrate_vma_setup() to collect it. That's two walks even when every page is already present and writeable, and the range can change in between, which is your "what happens in between walks". The driver then has to detect that and retry, error prone and nasty task... With HMM_PFN_REQ_MIGRATE, faulting and collecting happen in one walk, so there's no window to recheck. I think migrate-on-fault fills an important gap in the Linux SVM toolbox by integrating page fault handling and memory migration into a unified operation.
The costs you list (other mappings, swap-in, waitting for a concurrent migration, migrating another device's page back, breaking cow) are inherent to migrating those pages. They're the same with or without this series.
On size: in mm/ and include/ it's +1378/-602. Most of the removval is the old migrate_vma_collect*() walker, since migrate_vma_setup() now collects through the same hmm_range_fault() walk. Existing migrate_vma_setup() users get that path without driver changes. The rest is nouveau as a user (+561, including two independent dmem fixes split out as separate patches), test_hmm and the selftest (+283), and documentation (+121). These are my current numbers.
Quoted 4 lines
I think having a benchmark
representative of a real workload, or a real workload, that shows a decrease in the total migration time will be great to demonstrate that we are on the right track :)
Absolutely - cool if you could work on that side perhaps :) ?
Quoted 2 lines
Thanks,
Alex
--Mika
Hi Mika,
Quoted 284 lines · Mika Penttilä
Hi,
Quoted 172 lines · Alexandru Elisei
Hi Mika,
Quoted 29 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
I try to answer your questions, there are quite a bunch of them!
Quoted 16 lines · On Tue, Nov 03, 2026 at 08:16:17AM +0200, [email protected] wrote:
Quoted 15 lines
From: Mika Penttilä <[email protected]>
Currently, the way device page faulting and migration works is not optimal, if you want to do both fault handling and migration at once.
Being able to migrate not present pages (or pages mapped with incorrect permissions, eg. COW) to the GPU requires doing either of the following sequences:
1.
hmm_range_fault()- fault in non-present pages with correct permissions, etc.
2. migrate_vma_*() - migrate the pagesOr:
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
1. migrate_vma_*() - migrate present pages
2. If non-present pages detected by migrate_vma_*():
a) callhmm_range_fault()to fault pages in
b) call migrate_vma_*() again to migrate now present pagesRegarding both sequences, I'm trying to get a better understanding of what the issue is. I assume the caller wants to fault in system memory, and then migrate it to the device. Is that correct?
Yes that's the common thing to do.
Gotcha, thanks.
Quoted 33 lines
Quoted 26 lines
In my analysis I'm also not going to refer to THPs, since that would make things even more complicated than they are. I think we can come back to THPs later if we think it would be useful.
For the !pte_present() case:
Sequence 1:
hmm_range_fault()-> .. ->hmm_vma_handle_pte()handles !pte_present() pages in two ways: faults in swap pages and device private pages belonging to a different device, and waits on migration entries. Then the migrate_vma_*() flow is used to migrate the range.Sequence 2:
migrate_vma_setup()ignores !pte_present() page table entries After this, the caller follows the same steps as in sequence 1 -hmm_range_fault()faults in !pte_present() pages, and migrate_vma_*() is called again to migrate the pages that were faulted in/waited on byhmm_range_fault().Now, for the CoW case that you mentioned, I'm going to assume that the caller wants write permissions otherwise nothing needs to be done:
Sequence 1:
hmm_range_fault()->hmm_vma_handle_pte()records a fault (hmm_pte_need_fault()returnsHMM_NEED_FAULT|HMM_NEED_WRITE_FAULT),handle_mm_fault()-> .. ->do_wp_page()breaks CoW and maps an exclusive folio with write permissions, then the migrate_vma_* flow will take care ofQuoted 7 lines
Sequence 2,
migrate_vma_setup()installs migration entries for the page, thenmigrate_vma_finalize()replaces the migration entries with device private entries.Looks to me that for CoW pages, all that's needed is migrate_vma_*(), and the subsequent calls to
hmm_range_fault()and migrate_vma_*() are not necessary. Is that your conclusion too?Quoted 7 lines
For a device fault: the driver want the data in device memory with the permissions the device asked for. Your !pte_present() analysis matches; note that
pte_none()in anonymous vmas and the zero page don't needhmm_range_fault()at all, migrate_vma_*() populates them directly. That's why the common case is cheap with sequence 2, and only swap entries, other devices private pages and migration entries need the extra walks.Yes.
Quoted 11 lines
For cow with write intent migrate_vma_*() alone is enough.
migrate_vma_setup()doesnt break cow: it collects the shared page through its read-only pte, so there's noMIGRATE_PFN_WRITE, andtry_to_migrate()unmaps all its mappings, so finalize installs a read-only device private entry.The device still cant write; a write then has to go through
migrate_to_ram()and break cow in system memory, and migrate again. To get an exclusive writable copy on the device, cow has to be broken before collectin, i.e.hmm_range_fault()withHMM_PFN_REQ_WRITEfirst, then migrate: two walks.Makes sense, something did seem fishy with my analysis of the CoW case.
Quoted 54 lines
With this series that's one walk,
HMM_PFN_REQ_FAULT|HMM_PFN_REQ_WRITE|HMM_PFN_REQ_MIGRATE(orMIGRATE_VMA_WRITEformigrate_vma_setup()users), and only the now-exclusive page is migrated.Quoted 7 lines
Quoted 3 lines
The problem with the first sequence is that you always have to do two page walks even when most of the time the pages are present or zero page mappings so the common case takes a performance hit.
This is the first mention of the zero page. Is the caller specifying
HMM_PFN_REQ_WRITE? That makes a difference, because it triggers fault handling for the zero page, and that's an extra walk. Can you give more details here?Good question on the zero page. With a read request it need no fault:
migrate_vma_*() populates it likepte_none(), and the HMM walk collects it the same way. WithHMM_PFN_REQ_WRITEit's write-faulted first, in sequence 1 and with this series alike; the difference is that the series faults and collects in the same walk.Quoted 29 lines
Let's count page table walks when a page is mapped with a valid entry, and with the required permissions. Let's say N is the number of mappings for the page (equivalent to the number of VMAs that map the page):
hmm_range_fault()-> .. ->hmm_vma_handle_pte()does one page table walk,migrate_vma_setup()does N page tables walks, to replace all valid mappings of the page with migration entries,migrate_vma_finalize()does N page table walks, to replace the migration entries with device entries.In total 1 + 2*N walks. Best case scenario, N == 1 (
PageAnonExclusive()), that's three walks.Do you have any data regarding how often the best case scenario happens? That's what you seem to be referring to in your comment.
Now let's count the number of walks for a !pte_present() page mapped in P VMAs, where P != N: one from
hmm_range_fault(), if the entry is not a migration entry, another walk in the fault handler, then 2*P walks from the migrate_vma_*() flow.If it's a migration entry, it requires 1 + 2*P walks, PLUS waiting on migration to complete, which cannot be skipped.
If it's a swap entry, it requires 2 + 2*P walks, PLUS waiting on swap.
If it's a device private entry belonging to a different device, it requires 2 + 2*P walks, plus waiting on the device to sync the memory with the device in
migrate_to_ram().Quoted 6 lines
To summarize:
pte_present()1 + 2*N walks
migration entry 1 + 2*P walks + waiting on migration
swap entry 2 + 2*P walks + waiting on swap
device private 2 + 2*P walks + waiting ondevice->memorysyncQuoted 8 lines
On counting: the 2N (or 2P) rmap walks that replace the mappings with migration entries and then device entries are inherent to migrating the page and are the same in all variants. What differs is the number of page table walks over the range: sequence 1 allways does two (
hmm_range_fault(), thenmigrate_vma_setup()), sequence 2 one if everything is present and three otherwise, and the HMM walk one, with faults handled in place and the walk resuming from the faulting address. The saving is per range walk, so it scales with the range.I think we might need to define what you mean by 'saving'. Normally, I would assume that you mean that 'the total time of migration is decreased', but the fact that the benchmark that you offered doesn't show this makes me wonder.
The more !pte_present() pages are in the range, the smaller the amortized cost of a walk per page in the range. For example, using sequence one, for 512 !pte_present() pages, the current code does an extra 1/512 page table walks per page (for sequence two, an extra 1/512 * 2 walks). At the same time, for each page it needs to do a fault, or swap in, or wait on migration, or break CoW, or put migration+device entries in each VMA that maps the page.
Quoted 2 lines
I think the worst case scenario is the device wanting to fault in one page from system memory. Is that what usually happens?
Well that's what the nouveau does currently, but as I write in the commit log, a better policy would be nice... Otoh, that works as a good stress test on the code when pages migrate back and forth on demand.
Quoted 61 lines
Quoted 7 lines
I don't have data on how often the best case happens. The motivation came from earlier prototyping of migrate on fault on the current interfaces, where the extra walks showed up in perf traces. For the typical SVM case of private anonymous memory without fork the pages are exclusive (N == 1) or not yet populated, but I haven't measured a distribution.
Got it, that's what I wanted to know, the typical case is exclusive memory.
Quoted 44 lines
Quoted 40 lines
Quoted 5 lines
The second sequence is better for the common case, but far worse if pages aren't present because now you have to walk the page tables three times (once to find the page is not present, once so
hmm_range_fault()can find a non-present page to fault in and once again to setup the migration). It is also tricky to code correctly. One page table walkValid entry, the page is mapped in N VMAs: migrate_vma_*() does 2*N walks, best case scenario (PageAnonExclusive) two walks.
!pte_present, the page is mapped in P VMAs:
migrate_vma_setup()->migrate_vma_collect()will always do one page table walk, regardless of what it finds, valid or invalid entries.migrate_vma_collect()ignores !pte_present() entries, and they will not trigger new walks in the next steps in the migrate_vma_* flow. Worst case is that all the pages are !pte_present(), that's one walk to find them all which I would say it translates to zero extra walks for an individual page.For
hmm_range_fault(), it's the same situation as above: 1 + 2*P or 2 + 2*P walks.To summarize:
pte_present()2*N walksmigration_entry1 + 2*P walks + waiting on migration
swap entry 2 + 2*P walks + waiting on migration
device private 2 + 2*P walks + waiting on devicememory->memorysyncI agree with you, this second sequence is better for the common case.
I think it would interesting to know:
1. Is there a relationship between N and P, and if there is, what is it? Are they equal, on average? I doubt it. Is a !pte_present() page likely to be mapped in more VMAs than a
pte_present()page, or fewer?2. What is the likelyhood of P being equal to 1 (PageAnonExclusive)? That would be interesting to know because the larger P is, the contribution of that extra walk (or two walks) to the total time becomes less and less significant.
Quoted 4 lines
3. How does the time to do the walk compare to the time spent waiting on migration, or waiting on swap, or waiting on device to memory sync? How often each of them happen? I have a hunch that these will tend to dominate the total time.
Quoted 8 lines
Yes, when a page needs swap-in, a migration wait or a device sync, that wait dominates..
The walk saving matters on the common device fault path, with small ranges (one page per fault in the nouveau patch) and present or unpopulated pages: one walk instead of two, and without sequence 2's three when part of the range isn't present. But the main point is one call that faults and collects consistently, instead of two with a window in between where the range can change.Quoted 4 lines
This is introducing another variable into the mix. It's not just the number of page table walks, it's also the fact that in between walks the mapping might have changed. I think this is why it's good to have a representative benchmarks :)
ack
Quoted 29 lines
Quoted 20 lines
I don't have data on N and P. For private anonymous memory without fork or KSM both are normally 1, but I haven't measured it.
Quoted 11 lines
Quoted 11 lines
could costs over 1000 cpu cycles on X86-64, which is a significant hit.
We should be able to walk the page table once, faulting pages in as required and replacing them with migration entries if requested.
Add a new flag to HMM APIs,
HMM_PFN_REQ_MIGRATE,
which tells to prepare for migration also during fault handling. For themigrate_vma_setup()call paths, new flags,MIGRATE_VMA_FAULT, andMIGRATE_VMA_WRITEare added to tell to add fault handling to migrate.Quoted 7 lines
Quoted 6 lines
An extra benefit of migrating with
hmm_range_fault()path is the migrate_vma.vma gets populated, so no need to retrieve that separataly.This series avoids the problems in current collecting implementation, where racing
MADV_DONTNEEDcould make the collecting arrays overflow.Can you provide more details here? How does it happen?
Quoted 9 lines
migrate_vma_collect_pmd()drops the pte lock to split a large folio and restarts with [start, addr) already appended to src[]/dst[]. If a racingMADV_DONTNEEDzaps the range and frees the pte table meanwhile, the re start takes the hole path from start and append [start, addr) again, writing past the arrays. "mm/migrate_device: don't collect a range twice" in Lorenzo's batch fixes that instance; this series collects into the address-indexedhmm_pfnsand fills src[] only lastly, so re-walking cant overrun. Also, the correct pages are collected with the re-walk with this series(rollback takes care of the old ones).Quoted 5 lines
That can be accomplished with the upstream code too, this series isn't required (just off the top of my head, keep a local counter for the total number of pages collected by
migrate_vma_collect_pmd(), use it as an offset intomigrate->srcandmigrate->dst, and reset the counter on the 'again' label).
Quoted 6 lines
It's not that simple.. you have to rollback (unlock + unref) the so far collected pages. And to collect then the right pages from the start you have to rewalk and collect those again (and possibly a PMD as huge). Of course something like that can be done to current code, but address based indexing is more robust, and you end up with something like the HMM based collector :)
Okay.
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines
There are couple other defects the series fixed along the way.
Hmm... the size of this series might put off some people who are interested only in the fixes. Have you considered splitting them into standalone patches/series?
I might, but they don't apply directly to current collector.
Okay, so the fixes require your patches and they cannot be adapted to the upstream code, have I understood correctly?
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
This is achieved mainly by having a rollback mechanism and populating the collecting array as the last step.
Tested in X86-64 VM with HMM test device, passing the selftests.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Have you tested that this series doesn't regress other architectures?
Only tested on x86-64 (VM with
test_hmm, and nouveau on a GP102). The code is arch-independent, but it isn't tested elsewhere.Sorry, I'm a bit confused - what do you mean by it isn't tested elsewhere? x86-64 specific code is the only user for the arch-independent code?
I haven't personally tested on other arches the selftest (though I don't see why there would be problems to do so).
Okay, but you might be surprised. The selftests I can run myself an arm64 machine.
Quoted 71 lines
Quoted 66 lines
Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
The main goal of this patchset is to provide a new feature, migrate efficiently on fault, and not directly improve performance of current
migrate_vma_setup()(which is now routed thruI'm a bit confused by what 'on fault' means in this context? Userspace accesses a device entry, access that causes a fault, or using
hmm_range_fault()? I assume the latter, but it pays to make sure.Quoted 5 lines
Quoted 3 lines
Also, can you define efficiently? Usually that's related in some way to performance, but immediately you say that the series doesn't aim to improve performance.
"On fault" means a device fault: the driver services a GPU fault with
hmm_range_fault(HMM_PFN_REQ_FAULT | HMM_PFN_REQ_MIGRATE)and migratesGot it, thanks.
Quoted 3 lines
the page while handling it. "Efficiently" was the wrong word: I meant faulting and collecting in a single walk, instead of two or three calls with a window in between. I'll reword the cover letter.
Ok, gotcha.
Quoted 17 lines
Quoted 9 lines
Quoted 3 lines
hmm_range_fault()) callers. That said, the migrate throughput tests from the selftests show that there is at least no regression for currentmigrate_vma_setup()callers.If the premise of the series is to reduce the number of page table walks in the !pte_present() case, then I think benchmarks that show a performance improvement would make a compelling case for this approach.
Some thoughts, if I may:
Quoted 8 lines
- Perhaps the existing test is not the right test to highlight the performance gains?
- Perhaps there are other parts of the migration process that dominate the walks? If so, maybe we should be focusing our attention on those?
- Perhaps the series adds overhead that reduces or cancels the gains from reducing the number of walks?
Quoted 7 lines
I don't have a benchmark showing a gain: nouveau had no migrate on fault to compare against, and the selfftest throughput tests use
migrate_vma_setup()on present pages, so they can only show there's no regression, including from the extra work in the HMM walk. Also, any help with new tests is greatly welcome :). My primary focus atm is getting the final corner case details sorted out in the core and addressing sashiko; with v18 i hope being there.This is how I see this series, please correct me if I got something wrong. The aim is to reduce the total number of page table walks over the range by one or two (depending on the sequence of functions used) when !pte_present(), or when
pte_present(), but without write permissions.From our discussion so far it seems to me that the total migration time in the above cases depends on a number of things:
- In how many other VMAs these pages are mapped, as each mapping needs to be replaced with migration entries, and then with device special entries.
- How long it takes to swap in the page, if the page is mapped using a swap entry.
- How long it takes to complete a concurrent migration, if the page is mapped using a migration entry.
- How long it takes to migrate a device entry back to system memory, if the page belongs to a different device.
- If the page is CoW, how long it takes to break CoW.
- What happens in between walks.Quoted 4 lines
The code touches 2,600+ lines of code, with almost 1,300 lines added. It removes those extra page table walks, of course, but it also offers plenty of scope to add new inefficiencies (or bugs), and if that's the case, we don't gain anything other than complexity.
Quoted 4 lines
The saving isn't only for !pte_present() or read-only ptes. Migrating on device fault today takes two separate steps:
hmm_range_fault()to fault the range in, thenmigrate_vma_setup()to collect it. That's two walks even when every page is already present and writeable, and the range can
If all the pages are present and with the required permissions, why isn't migrate_vma_*() enough?
Quoted 2 lines
change in between, which is your "what happens in between walks". The driver then has to detect that and retry, error prone and nasty task...
Yeah, that 'what happens in between' looks very unpredictable.
Quoted 9 lines
With
HMM_PFN_REQ_MIGRATE, faulting and collecting happen in one walk, so there's no window to recheck. I think migrate-on-fault fills an important gap in the Linux SVM toolbox by integrating page fault handling and memory migration into a unified operation.The costs you list (other mappings, swap-in, waitting for a concurrent migration, migrating another device's page back, breaking cow) are inherent to migrating those pages. They're the same with or without this series.
Indeed, and my point was that those costs dominate the cost of the two walks. And because of that, it is entirely possible that removing the two walks does not reduce the time to do migration in any meaningful way.
Quoted 8 lines
On size: in
mm/andinclude/it's +1378/-602. Most of the removval is the old migrate_vma_collect*() walker, sincemigrate_vma_setup()now collects through the samehmm_range_fault()walk. Existingmigrate_vma_setup()users get that path without driver changes. The rest is nouveau as a user (+561, including two independent dmem fixes split out as separate patches),test_hmmand the selftest (+283), and documentation (+121). These are my current numbers.
Of course.
Quoted 7 lines
Quoted 5 lines
I think having a benchmark
representative of a real workload, or a real workload, that shows a decrease in the total migration time will be great to demonstrate that we are on the right track :)Absolutely - cool if you could work on that side perhaps :) ?
Sorry, but I don't think I'm the right person to do that. I'm don't know what a representative workload would be, and I'm not entirely convinced that these changes actually make things faster.
Thanks,
Alex
Hi!
Quoted 300 lines · Alexandru Elisei
Hi Mika,
Quoted 284 lines · Mika Penttilä
Hi,
Quoted 172 lines · Alexandru Elisei
Hi Mika,
Quoted 29 lines · Mika Penttilä
Hi Alexandru!
Quoted 5 lines · Alexandru Elisei
Hi Mika,
I want to help getting this series merged, and I've been familiarizing myself with hmm and device migration, please bare with me if the questions I'm asking are obvious or downright silly.
Thanks for the interest and willing to help! I am preparing a v18 of the series and plan to post it early next week.
I try to answer your questions, there are quite a bunch of them!
Quoted 16 lines · On Tue, Nov 03, 2026 at 08:16:17AM +0200, [email protected] wrote:
Quoted 15 lines
From: Mika Penttilä <[email protected]>
Currently, the way device page faulting and migration works is not optimal, if you want to do both fault handling and migration at once.
Being able to migrate not present pages (or pages mapped with incorrect permissions, eg. COW) to the GPU requires doing either of the following sequences:
1.
hmm_range_fault()- fault in non-present pages with correct permissions, etc.
2. migrate_vma_*() - migrate the pagesOr:
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
1. migrate_vma_*() - migrate present pages
2. If non-present pages detected by migrate_vma_*():
a) callhmm_range_fault()to fault pages in
b) call migrate_vma_*() again to migrate now present pagesRegarding both sequences, I'm trying to get a better understanding of what the issue is. I assume the caller wants to fault in system memory, and then migrate it to the device. Is that correct?
Yes that's the common thing to do.
Gotcha, thanks.
Quoted 33 lines
Quoted 26 lines
In my analysis I'm also not going to refer to THPs, since that would make things even more complicated than they are. I think we can come back to THPs later if we think it would be useful.
For the !pte_present() case:
Sequence 1:
hmm_range_fault()-> .. ->hmm_vma_handle_pte()handles !pte_present() pages in two ways: faults in swap pages and device private pages belonging to a different device, and waits on migration entries. Then the migrate_vma_*() flow is used to migrate the range.Sequence 2:
migrate_vma_setup()ignores !pte_present() page table entries After this, the caller follows the same steps as in sequence 1 -hmm_range_fault()faults in !pte_present() pages, and migrate_vma_*() is called again to migrate the pages that were faulted in/waited on byhmm_range_fault().Now, for the CoW case that you mentioned, I'm going to assume that the caller wants write permissions otherwise nothing needs to be done:
Sequence 1:
hmm_range_fault()->hmm_vma_handle_pte()records a fault (hmm_pte_need_fault()returnsHMM_NEED_FAULT|HMM_NEED_WRITE_FAULT),handle_mm_fault()-> .. ->do_wp_page()breaks CoW and maps an exclusive folio with write permissions, then the migrate_vma_* flow will take care ofQuoted 7 lines
Sequence 2,
migrate_vma_setup()installs migration entries for the page, thenmigrate_vma_finalize()replaces the migration entries with device private entries.Looks to me that for CoW pages, all that's needed is migrate_vma_*(), and the subsequent calls to
hmm_range_fault()and migrate_vma_*() are not necessary. Is that your conclusion too?Quoted 7 lines
For a device fault: the driver want the data in device memory with the permissions the device asked for. Your !pte_present() analysis matches; note that
pte_none()in anonymous vmas and the zero page don't needhmm_range_fault()at all, migrate_vma_*() populates them directly. That's why the common case is cheap with sequence 2, and only swap entries, other devices private pages and migration entries need the extra walks.Yes.
Quoted 11 lines
For cow with write intent migrate_vma_*() alone is enough.
migrate_vma_setup()doesnt break cow: it collects the shared page through its read-only pte, so there's noMIGRATE_PFN_WRITE, andtry_to_migrate()unmaps all its mappings, so finalize installs a read-only device private entry.The device still cant write; a write then has to go through
migrate_to_ram()and break cow in system memory, and migrate again. To get an exclusive writable copy on the device, cow has to be broken before collectin, i.e.hmm_range_fault()withHMM_PFN_REQ_WRITEfirst, then migrate: two walks.Makes sense, something did seem fishy with my analysis of the CoW case.
Quoted 54 lines
With this series that's one walk,
HMM_PFN_REQ_FAULT|HMM_PFN_REQ_WRITE|HMM_PFN_REQ_MIGRATE(orMIGRATE_VMA_WRITEformigrate_vma_setup()users), and only the now-exclusive page is migrated.Quoted 7 lines
Quoted 3 lines
The problem with the first sequence is that you always have to do two page walks even when most of the time the pages are present or zero page mappings so the common case takes a performance hit.
This is the first mention of the zero page. Is the caller specifying
HMM_PFN_REQ_WRITE? That makes a difference, because it triggers fault handling for the zero page, and that's an extra walk. Can you give more details here?Good question on the zero page. With a read request it need no fault:
migrate_vma_*() populates it likepte_none(), and the HMM walk collects it the same way. WithHMM_PFN_REQ_WRITEit's write-faulted first, in sequence 1 and with this series alike; the difference is that the series faults and collects in the same walk.Quoted 29 lines
Let's count page table walks when a page is mapped with a valid entry, and with the required permissions. Let's say N is the number of mappings for the page (equivalent to the number of VMAs that map the page):
hmm_range_fault()-> .. ->hmm_vma_handle_pte()does one page table walk,migrate_vma_setup()does N page tables walks, to replace all valid mappings of the page with migration entries,migrate_vma_finalize()does N page table walks, to replace the migration entries with device entries.In total 1 + 2*N walks. Best case scenario, N == 1 (
PageAnonExclusive()), that's three walks.Do you have any data regarding how often the best case scenario happens? That's what you seem to be referring to in your comment.
Now let's count the number of walks for a !pte_present() page mapped in P VMAs, where P != N: one from
hmm_range_fault(), if the entry is not a migration entry, another walk in the fault handler, then 2*P walks from the migrate_vma_*() flow.If it's a migration entry, it requires 1 + 2*P walks, PLUS waiting on migration to complete, which cannot be skipped.
If it's a swap entry, it requires 2 + 2*P walks, PLUS waiting on swap.
If it's a device private entry belonging to a different device, it requires 2 + 2*P walks, plus waiting on the device to sync the memory with the device in
migrate_to_ram().Quoted 6 lines
To summarize:
pte_present()1 + 2*N walks
migration entry 1 + 2*P walks + waiting on migration
swap entry 2 + 2*P walks + waiting on swap
device private 2 + 2*P walks + waiting ondevice->memorysyncQuoted 8 lines
On counting: the 2N (or 2P) rmap walks that replace the mappings with migration entries and then device entries are inherent to migrating the page and are the same in all variants. What differs is the number of page table walks over the range: sequence 1 allways does two (
hmm_range_fault(), thenmigrate_vma_setup()), sequence 2 one if everything is present and three otherwise, and the HMM walk one, with faults handled in place and the walk resuming from the faulting address. The saving is per range walk, so it scales with the range.I think we might need to define what you mean by 'saving'. Normally, I would assume that you mean that 'the total time of migration is decreased', but the fact that the benchmark that you offered doesn't show this makes me wonder.
The more !pte_present() pages are in the range, the smaller the amortized cost of a walk per page in the range. For example, using sequence one, for 512 !pte_present() pages, the current code does an extra 1/512 page table walks per page (for sequence two, an extra 1/512 * 2 walks). At the same time, for each page it needs to do a fault, or swap in, or wait on migration, or break CoW, or put migration+device entries in each VMA that maps the page.
Quoted 2 lines
I think the worst case scenario is the device wanting to fault in one page from system memory. Is that what usually happens?
Well that's what the nouveau does currently, but as I write in the commit log, a better policy would be nice... Otoh, that works as a good stress test on the code when pages migrate back and forth on demand.
Quoted 61 lines
Quoted 7 lines
I don't have data on how often the best case happens. The motivation came from earlier prototyping of migrate on fault on the current interfaces, where the extra walks showed up in perf traces. For the typical SVM case of private anonymous memory without fork the pages are exclusive (N == 1) or not yet populated, but I haven't measured a distribution.
Got it, that's what I wanted to know, the typical case is exclusive memory.
Quoted 44 lines
Quoted 40 lines
Quoted 5 lines
The second sequence is better for the common case, but far worse if pages aren't present because now you have to walk the page tables three times (once to find the page is not present, once so
hmm_range_fault()can find a non-present page to fault in and once again to setup the migration). It is also tricky to code correctly. One page table walkValid entry, the page is mapped in N VMAs: migrate_vma_*() does 2*N walks, best case scenario (PageAnonExclusive) two walks.
!pte_present, the page is mapped in P VMAs:
migrate_vma_setup()->migrate_vma_collect()will always do one page table walk, regardless of what it finds, valid or invalid entries.migrate_vma_collect()ignores !pte_present() entries, and they will not trigger new walks in the next steps in the migrate_vma_* flow. Worst case is that all the pages are !pte_present(), that's one walk to find them all which I would say it translates to zero extra walks for an individual page.For
hmm_range_fault(), it's the same situation as above: 1 + 2*P or 2 + 2*P walks.To summarize:
pte_present()2*N walksmigration_entry1 + 2*P walks + waiting on migration
swap entry 2 + 2*P walks + waiting on migration
device private 2 + 2*P walks + waiting on devicememory->memorysyncI agree with you, this second sequence is better for the common case.
I think it would interesting to know:
1. Is there a relationship between N and P, and if there is, what is it? Are they equal, on average? I doubt it. Is a !pte_present() page likely to be mapped in more VMAs than a
pte_present()page, or fewer?2. What is the likelyhood of P being equal to 1 (PageAnonExclusive)? That would be interesting to know because the larger P is, the contribution of that extra walk (or two walks) to the total time becomes less and less significant.
Quoted 4 lines
3. How does the time to do the walk compare to the time spent waiting on migration, or waiting on swap, or waiting on device to memory sync? How often each of them happen? I have a hunch that these will tend to dominate the total time.
Quoted 8 lines
Yes, when a page needs swap-in, a migration wait or a device sync, that wait dominates..
The walk saving matters on the common device fault path, with small ranges (one page per fault in the nouveau patch) and present or unpopulated pages: one walk instead of two, and without sequence 2's three when part of the range isn't present. But the main point is one call that faults and collects consistently, instead of two with a window in between where the range can change.Quoted 4 lines
This is introducing another variable into the mix. It's not just the number of page table walks, it's also the fact that in between walks the mapping might have changed. I think this is why it's good to have a representative benchmarks :)
ack
Quoted 29 lines
Quoted 20 lines
I don't have data on N and P. For private anonymous memory without fork or KSM both are normally 1, but I haven't measured it.
Quoted 11 lines
Quoted 11 lines
could costs over 1000 cpu cycles on X86-64, which is a significant hit.
We should be able to walk the page table once, faulting pages in as required and replacing them with migration entries if requested.
Add a new flag to HMM APIs,
HMM_PFN_REQ_MIGRATE,
which tells to prepare for migration also during fault handling. For themigrate_vma_setup()call paths, new flags,MIGRATE_VMA_FAULT, andMIGRATE_VMA_WRITEare added to tell to add fault handling to migrate.Quoted 7 lines
Quoted 6 lines
An extra benefit of migrating with
hmm_range_fault()path is the migrate_vma.vma gets populated, so no need to retrieve that separataly.This series avoids the problems in current collecting implementation, where racing
MADV_DONTNEEDcould make the collecting arrays overflow.Can you provide more details here? How does it happen?
Quoted 9 lines
migrate_vma_collect_pmd()drops the pte lock to split a large folio and restarts with [start, addr) already appended to src[]/dst[]. If a racingMADV_DONTNEEDzaps the range and frees the pte table meanwhile, the re start takes the hole path from start and append [start, addr) again, writing past the arrays. "mm/migrate_device: don't collect a range twice" in Lorenzo's batch fixes that instance; this series collects into the address-indexedhmm_pfnsand fills src[] only lastly, so re-walking cant overrun. Also, the correct pages are collected with the re-walk with this series(rollback takes care of the old ones).Quoted 5 lines
That can be accomplished with the upstream code too, this series isn't required (just off the top of my head, keep a local counter for the total number of pages collected by
migrate_vma_collect_pmd(), use it as an offset intomigrate->srcandmigrate->dst, and reset the counter on the 'again' label).Quoted 6 lines
It's not that simple.. you have to rollback (unlock + unref) the so far collected pages. And to collect then the right pages from the start you have to rewalk and collect those again (and possibly a PMD as huge). Of course something like that can be done to current code, but address based indexing is more robust, and you end up with something like the HMM based collector :)
Okay.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
There are couple other defects the series fixed along the way.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Hmm... the size of this series might put off some people who are interested only in the fixes. Have you considered splitting them into standalone patches/series?
I might, but they don't apply directly to current collector.
Okay, so the fixes require your patches and they cannot be adapted to the upstream code, have I understood correctly?
Sure can be adapted with some effort. I haven't yet gone into the details though.
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 9 lines
Quoted 8 lines
This is achieved mainly by having a rollback mechanism and populating the collecting array as the last step.
Tested in X86-64 VM with HMM test device, passing the selftests.
Have you tested that this series doesn't regress other architectures?
Only tested on x86-64 (VM with
test_hmm, and nouveau on a GP102). The code is arch-independent, but it isn't tested elsewhere.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Sorry, I'm a bit confused - what do you mean by it isn't tested elsewhere? x86-64 specific code is the only user for the arch-independent code?
I haven't personally tested on other arches the selftest (though I don't see why there would be problems to do so).
Okay, but you might be surprised. The selftests I can run myself an arm64 machine.
Yes good to check!
Quoted 72 lines
Quoted 72 lines
Quoted 71 lines
Quoted 12 lines
Quoted 12 lines
Quoted 8 lines
The main goal of this patchset is to provide a new feature, migrate efficiently on fault, and not directly improve performance of current
migrate_vma_setup()(which is now routed thruI'm a bit confused by what 'on fault' means in this context? Userspace accesses a device entry, access that causes a fault, or using
hmm_range_fault()? I assume the latter, but it pays to make sure.Quoted 5 lines
Quoted 3 lines
Also, can you define efficiently? Usually that's related in some way to performance, but immediately you say that the series doesn't aim to improve performance.
"On fault" means a device fault: the driver services a GPU fault with
hmm_range_fault(HMM_PFN_REQ_FAULT | HMM_PFN_REQ_MIGRATE)and migratesGot it, thanks.
Quoted 3 lines
the page while handling it. "Efficiently" was the wrong word: I meant faulting and collecting in a single walk, instead of two or three calls with a window in between. I'll reword the cover letter.
Ok, gotcha.
Quoted 17 lines
Quoted 9 lines
Quoted 3 lines
hmm_range_fault()) callers. That said, the migrate throughput tests from the selftests show that there is at least no regression for currentmigrate_vma_setup()callers.If the premise of the series is to reduce the number of page table walks in the !pte_present() case, then I think benchmarks that show a performance improvement would make a compelling case for this approach.
Some thoughts, if I may:
Quoted 8 lines
- Perhaps the existing test is not the right test to highlight the performance gains?
- Perhaps there are other parts of the migration process that dominate the walks? If so, maybe we should be focusing our attention on those?
- Perhaps the series adds overhead that reduces or cancels the gains from reducing the number of walks?
Quoted 7 lines
I don't have a benchmark showing a gain: nouveau had no migrate on fault to compare against, and the selfftest throughput tests use
migrate_vma_setup()on present pages, so they can only show there's no regression, including from the extra work in the HMM walk. Also, any help with new tests is greatly welcome :). My primary focus atm is getting the final corner case details sorted out in the core and addressing sashiko; with v18 i hope being there.This is how I see this series, please correct me if I got something wrong. The aim is to reduce the total number of page table walks over the range by one or two (depending on the sequence of functions used) when !pte_present(), or when
pte_present(), but without write permissions.From our discussion so far it seems to me that the total migration time in the above cases depends on a number of things:
- In how many other VMAs these pages are mapped, as each mapping needs to be replaced with migration entries, and then with device special entries.
- How long it takes to swap in the page, if the page is mapped using a swap entry.
- How long it takes to complete a concurrent migration, if the page is mapped using a migration entry.
- How long it takes to migrate a device entry back to system memory, if the page belongs to a different device.
- If the page is CoW, how long it takes to break CoW.
- What happens in between walks.The code touches 2,600+ lines of code, with almost 1,300 lines added. It removes those extra page table walks, of course, but it also offers plenty of scope to add new inefficiencies (or bugs), and if that's the case, we don't gain anything other than complexity.
Quoted 7 lines
Quoted 4 lines
The saving isn't only for !pte_present() or read-only ptes. Migrating on device fault today takes two separate steps:
hmm_range_fault()to fault the range in, thenmigrate_vma_setup()to collect it. That's two walks even when every page is already present and writeable, and the range canIf all the pages are present and with the required permissions, why isn't migrate_vma_*() enough?
It is enough in that case, but the driver handling the device fault doesn't know that in advance. A fault handler has to cover the general case, so it does hmm_range_fault() first and migrate_vma_setup() after it, which is two walks even when nothing needed faulting. Checking first whether everything is present is itself a walk.
Quoted 11 lines
Quoted 3 lines
change in between, which is your "what happens in between walks". The driver then has to detect that and retry, error prone and nasty task...
Yeah, that 'what happens in between' looks very unpredictable.
Quoted 5 lines
With
HMM_PFN_REQ_MIGRATE, faulting and collecting happen in one walk, so there's no window to recheck. I think migrate-on-fault fills an important gap in the Linux SVM toolbox by integrating page fault handling and memory migration into a unified operation.
Quoted 8 lines
Quoted 4 lines
The costs you list (other mappings, swap-in, waitting for a concurrent migration, migrating another device's page back, breaking cow) are inherent to migrating those pages. They're the same with or without this series.
Indeed, and my point was that those costs dominate the cost of the two walks. And because of that, it is entirely possible that removing the two walks does not reduce the time to do migration in any meaningful way.
It could be far more than two walks, and incomplete with races. Look all the trouble Xe driver sees doing migrate on fault, which is consequences of the missing MM primitive.
Sure you can find a case where HMM_PFN_REQ_MIGRATE doesn't make much difference. There are cases where it does. It unifies the walks, you choose if want a faulting behavior or not. The new code covering both behaviors will also be AI checked from the start.
Quoted 18 lines
Quoted 9 lines
On size: in
mm/andinclude/it's +1378/-602. Most of the removval is the old migrate_vma_collect*() walker, sincemigrate_vma_setup()now collects through the samehmm_range_fault()walk. Existingmigrate_vma_setup()users get that path without driver changes. The rest is nouveau as a user (+561, including two independent dmem fixes split out as separate patches),test_hmmand the selftest (+283), and documentation (+121). These are my current numbers.Of course.
Quoted 6 lines
Quoted 5 lines
I think having a benchmark
representative of a real workload, or a real workload, that shows a decrease in the total migration time will be great to demonstrate that we are on the right track :)
Quoted 4 lines
Quoted 1 line
Absolutely - cool if you could work on that side perhaps :) ?
Sorry, but I don't think I'm the right person to do that. I'm don't know what a representative workload would be,
That's okay :)
and I'm not entirely convinced
Quoted 1 line
that these changes actually make things faster.
I believe it's the right approach to do migrate on fault. I have brought up other aspects above also that speak for the series.
Quoted 4 lines
Thanks,
Alex
--Mika