Skip to contentSkip to conversation

mm/migrate: remove the -EEXIST conversion for move_pages()

PATCH Applied Wei Yang 4 participants 7 messages Jul 7, 2025 – Jul 9, 2025

Subsystems (2)
lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 mm/migrate: remove the -EEXIST conversion for move_pages()

The -EEXIST conversion is introduced in commit 65462462ffb2 ("mm/gup:
follow_pfn_pte(): -EEXIST cleanup"), since follow_page() may call follow_pfn_pte() which may return -EEXIST.

But after commit 7dff875c9436 ("mm/migrate: convert add_page_for_migration() from follow_page() to folio_walk"), it use folio_walk instead. This limit the error code and won't return -EEXIST.

Remove the error code conversion here.

Cc John Hubbard <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Zi Yan <[email protected]>
Cc Matthew Brost <[email protected]>
Cc Joshua Hahn <[email protected]>
Cc Rakie Kim <[email protected]>
Cc Byungchul Park <[email protected]>
Cc Gregory Price <[email protected]>
Cc Ying Huang <[email protected]>
Cc Alistair Popple <[email protected]>
---
 mm/migrate.c | 7 -------
 1 file changed, 7 deletions(-)
mm/migrate.c +0 -7
index 9ececaf80ec1..629851e525e8 100644
@@ -2321,13 +2321,6 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes,
 			continue;
 		}
 
-		/*
-		 * The move_pages() man page does not have an -EEXIST choice, so
-		 * use -EFAULT instead.
-		 */
-		if (err == -EEXIST)
-			err = -EFAULT;
-
 		/*
 		 * If the page is already on the target node (!err), store the
 		 * node, otherwise, store the err.
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 21 lines · Wei Yang

The -EEXIST conversion is introduced in commit 65462462ffb2 ("mm/gup:
follow_pfn_pte(): -EEXIST cleanup"), since follow_page() may call follow_pfn_pte() which may return -EEXIST.

But after commit 7dff875c9436 ("mm/migrate: convert add_page_for_migration() from follow_page() to folio_walk"), it use folio_walk instead. This limit the error code and won't return -EEXIST.

Remove the error code conversion here.

Cc John Hubbard <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Zi Yan <[email protected]>
Cc Matthew Brost <[email protected]>
Cc Joshua Hahn <[email protected]>
Cc Rakie Kim <[email protected]>
Cc Byungchul Park <[email protected]>
Cc Gregory Price <[email protected]>
Cc Ying Huang <[email protected]>
Cc Alistair Popple <[email protected]>
Quoted 1 line

---

Signature · 3 lines
Cheers,

David / dhildenb
author
#2 lore raw
Quoted 24 lines · David Hildenbrand
Quoted 21 lines · Wei Yang

The -EEXIST conversion is introduced in commit 65462462ffb2 ("mm/gup:
follow_pfn_pte(): -EEXIST cleanup"), since follow_page() may call follow_pfn_pte() which may return -EEXIST.

But after commit 7dff875c9436 ("mm/migrate: convert add_page_for_migration() from follow_page() to folio_walk"), it use folio_walk instead. This limit the error code and won't return -EEXIST.

Remove the error code conversion here.

Cc John Hubbard <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Zi Yan <[email protected]>
Cc Matthew Brost <[email protected]>
Cc Joshua Hahn <[email protected]>
Cc Rakie Kim <[email protected]>
Cc Byungchul Park <[email protected]>
Cc Gregory Price <[email protected]>
Cc Ying Huang <[email protected]>
Cc Alistair Popple <[email protected]>
Quoted 1 line

---

Quoted 2 lines

Thanks

Quoted 4 lines
Signature · 3 lines
Cheers,

David / dhildenb
Signature · 2 lines
Wei Yang
Help you, Help me
reviewer Reviewed-by on v1 1/1
#3 lore raw
In reply to Wei Yang
Quoted 11 lines · Wei Yang

The -EEXIST conversion is introduced in commit 65462462ffb2 ("mm/gup:
follow_pfn_pte(): -EEXIST cleanup"), since follow_page() may call follow_pfn_pte() which may return -EEXIST.

But after commit 7dff875c9436 ("mm/migrate: convert add_page_for_migration() from follow_page() to folio_walk"), it use folio_walk instead. This limit the error code and won't return -EEXIST.

Remove the error code conversion here.

Quoted 11 lines
Cc John Hubbard <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Zi Yan <[email protected]>
Cc Matthew Brost <[email protected]>
Cc Joshua Hahn <[email protected]>
Cc Rakie Kim <[email protected]>
Cc Byungchul Park <[email protected]>
Cc Gregory Price <[email protected]>
Cc Ying Huang <[email protected]>
Cc Alistair Popple <[email protected]>

Hello,

This makes sense, thank you for spotting this!

Have a great day!
Joshua

author
#4 lore raw
Quoted 24 lines · Joshua Hahn
Quoted 11 lines · Wei Yang

The -EEXIST conversion is introduced in commit 65462462ffb2 ("mm/gup:
follow_pfn_pte(): -EEXIST cleanup"), since follow_page() may call follow_pfn_pte() which may return -EEXIST.

But after commit 7dff875c9436 ("mm/migrate: convert add_page_for_migration() from follow_page() to folio_walk"), it use folio_walk instead. This limit the error code and won't return -EEXIST.

Remove the error code conversion here.

Quoted 11 lines
Cc John Hubbard <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Zi Yan <[email protected]>
Cc Matthew Brost <[email protected]>
Cc Joshua Hahn <[email protected]>
Cc Rakie Kim <[email protected]>
Cc Byungchul Park <[email protected]>
Cc Gregory Price <[email protected]>
Cc Ying Huang <[email protected]>
Cc Alistair Popple <[email protected]>
Quoted 5 lines

Hello,

This makes sense, thank you for spotting this!

Thanks :-)

Quoted 2 lines

Have a great day!
Joshua

Signature · 2 lines
Wei Yang
Help you, Help me
reviewer Reviewed-by on v1 1/1
#5 lore raw
In reply to Wei Yang
Quoted 21 lines · Wei Yang

The -EEXIST conversion is introduced in commit 65462462ffb2 ("mm/gup:
follow_pfn_pte(): -EEXIST cleanup"), since follow_page() may call follow_pfn_pte() which may return -EEXIST.

But after commit 7dff875c9436 ("mm/migrate: convert add_page_for_migration() from follow_page() to folio_walk"), it use folio_walk instead. This limit the error code and won't return -EEXIST.

Remove the error code conversion here.

Cc John Hubbard <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Zi Yan <[email protected]>
Cc Matthew Brost <[email protected]>
Cc Joshua Hahn <[email protected]>
Cc Rakie Kim <[email protected]>
Cc Byungchul Park <[email protected]>
Cc Gregory Price <[email protected]>
Cc Ying Huang <[email protected]>
Cc Alistair Popple <[email protected]>
Quoted 4 lines
---
 mm/migrate.c | 7 -------
 1 file changed, 7 deletions(-)

Best Regards,
Yan, Zi

author
#6 lore raw
Quoted 27 lines · Zi Yan
Quoted 21 lines · Wei Yang

The -EEXIST conversion is introduced in commit 65462462ffb2 ("mm/gup:
follow_pfn_pte(): -EEXIST cleanup"), since follow_page() may call follow_pfn_pte() which may return -EEXIST.

But after commit 7dff875c9436 ("mm/migrate: convert add_page_for_migration() from follow_page() to folio_walk"), it use folio_walk instead. This limit the error code and won't return -EEXIST.

Remove the error code conversion here.

Cc John Hubbard <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Zi Yan <[email protected]>
Cc Matthew Brost <[email protected]>
Cc Joshua Hahn <[email protected]>
Cc Rakie Kim <[email protected]>
Cc Byungchul Park <[email protected]>
Cc Gregory Price <[email protected]>
Cc Ying Huang <[email protected]>
Cc Alistair Popple <[email protected]>
Quoted 4 lines
---
 mm/migrate.c | 7 -------
 1 file changed, 7 deletions(-)
Quoted 2 lines

Thanks

Quoted 2 lines

Best Regards,
Yan, Zi

Signature · 2 lines
Wei Yang
Help you, Help me