linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/migrate: Split only transparent huge pages when allocation fails
@ 2018-09-24 14:14 Anshuman Khandual
  2018-09-24 14:30 ` Michal Hocko
  0 siblings, 1 reply; 4+ messages in thread
From: Anshuman Khandual @ 2018-09-24 14:14 UTC (permalink / raw)
  To: linux-kernel, linux-mm; +Cc: mhocko, akpm

When unmap_and_move[_huge_page] function fails due to lack of memory, the
splitting should happen only for transparent huge pages not for HugeTLB
pages. PageTransHuge() returns true for both THP and HugeTLB pages. Hence
the conditonal check should test PagesHuge() flag to make sure that given
pages is not a HugeTLB one.

Fixes: 94723aafb9 ("mm: unclutter THP migration")
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
 mm/migrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index d6a2e89..d2297fe 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1411,7 +1411,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
 				 * we encounter them after the rest of the list
 				 * is processed.
 				 */
-				if (PageTransHuge(page)) {
+				if (PageTransHuge(page) && !PageHuge(page)) {
 					lock_page(page);
 					rc = split_huge_page_to_list(page, from);
 					unlock_page(page);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-24 16:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-24 14:14 [PATCH] mm/migrate: Split only transparent huge pages when allocation fails Anshuman Khandual
2018-09-24 14:30 ` Michal Hocko
2018-09-24 16:40   ` Anshuman Khandual
2018-09-24 16:52     ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox