mm/migrate_device: remove dead migration entry check in migrate_vma_collect_huge_pmd()
Subsystems (2)
PATCH 1/1 mm/migrate_device: remove dead migration entry check in migrate_vma_collect_huge_pmd()
The softleaf_is_migration() check is unreachable as entries that are not device_private are filtered out. Similarly, the PTE-level equivalent in migrate_vma_collect_pmd() skips migration entries.
This dead branch also contained a double spin_unlock(ptl) bug.
--- mm/migrate_device.c | 6 ------ 1 file changed, 6 deletions(-)
mm/migrate_device.c +0 -7
@@ -175,13 +175,6 @@ static int migrate_vma_collect_huge_pmd(pmd_t *pmdp, unsigned long start,return migrate_vma_collect_skip (start, end, walk); } -if (softleaf_is_migration (entry)) { -migration_entry_wait_on_locked (entry, ptl); -spin_unlock (ptl); -return -EAGAIN ; - } -if (softleaf_is_device_private_write (entry)) write =MIGRATE_PFN_WRITE ; }else { --
2.39.5
On 2026-02-12 at 12:46 +1100, Davidlohr Bueso <[email protected]> wrote...
Quoted 5 lines
The
softleaf_is_migration()check is unreachable as entries that are notdevice_privateare filtered out. Similarly, the PTE-level equivalent inmigrate_vma_collect_pmd()skips migration entries.This dead branch also contained a double
spin_unlock(ptl)bug.
Heh. You beat me by 10 minutes :-) I was just checking to see if the fix had already been sent before pressing send on mine.
You probably want to add:
But other than that this looks good so:
Quoted 27 lines
Suggested-by Matthew Brost <[email protected]>Signed-off-by Davidlohr Bueso <[email protected]>--- mm/migrate_device.c | 6 ------ 1 file changed, 6 deletions(-)mm/migrate_device.c +0
-7@@ -175,13 +175,6 @@ static int migrate_vma_collect_huge_pmd(pmd_t *pmdp, unsigned long start,return migrate_vma_collect_skip (start, end, walk); } -if (softleaf_is_migration (entry)) { -migration_entry_wait_on_locked (entry, ptl); -spin_unlock (ptl); -return -EAGAIN ; - } -if (softleaf_is_device_private_write (entry)) write =MIGRATE_PFN_WRITE ; }else { --2.39.5
Quoted 9 lines · Davidlohr Bueso
The
softleaf_is_migration()check is unreachable as entries that are notdevice_privateare filtered out. Similarly, the PTE-level equivalent inmigrate_vma_collect_pmd()skips migration entries.This dead branch also contained a double
spin_unlock(ptl)bug.Suggested-by Matthew Brost <[email protected]>Signed-off-by Davidlohr Bueso <[email protected]>---
Signature · 3 lines
Cheers, David
Quoted 19 lines · Davidlohr Bueso
The
softleaf_is_migration()check is unreachable as entries that are notdevice_privateare filtered out. Similarly, the PTE-level equivalent inmigrate_vma_collect_pmd()skips migration entries.This dead branch also contained a double
spin_unlock(ptl)bug.Suggested-by Matthew Brost <[email protected]>Signed-off-by Davidlohr Bueso <[email protected]>--- mm/migrate_device.c | 6 ------ 1 file changed, 6 deletions(-)mm/migrate_device.c +0
-0@@ -175,13 +175,6 @@ static int migrate_vma_collect_huge_pmd(pmd_t *pmdp, unsigned long start,return migrate_vma_collect_skip (start, end, walk); }
mm/migrate_device.c static int migrate_vma_collect_huge_pmd(pmd_t *pmdp, unsigned long start, · line 180
Quoted 10 lines
mm/migrate_device.c +0
-6-if (softleaf_is_migration (entry)) { -migration_entry_wait_on_locked (entry, ptl); -spin_unlock (ptl); -return -EAGAIN ; - } -if (softleaf_is_device_private_write (entry)) write =MIGRATE_PFN_WRITE ; }else {