lkml.org 
[lkml]   [2020]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] fix mmthpcompactioncma-allow-thp-migration-for-cma-allocations.patch
Thank you Mike & Vlastimil!

---8<---

commit 27f3cd5473d8bbf591b61d8b93b98bc333980d0d
Author: Rik van Riel <riel@surriel.com>
Date: Fri Feb 28 10:41:48 2020 -0500

Subject: fix mmthpcompactioncma-allow-thp-migration-for-cma-allocations.patch

Mike Kravetz pointed out that the second if condition could do the
wrong thing for hugetlbfs pages, and that check really only needs
to run on THPs.

Cleanup suggested by Vlastimil.

Thank you both!

Suggested-by: Mike Kravetz <mike.kravetz@oracle.com>
Suggested-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Rik van Riel <riel@surriel.com>

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4afa13dd3738..71f78a590236 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -8274,12 +8274,12 @@ struct page *has_unmovable_pages(struct zone *zone, struct page *page,
struct page *head = compound_head(page);
unsigned int skip_pages;

- if (PageHuge(page) &&
- !hugepage_migration_supported(page_hstate(head)))
- return page;
-
- if (!PageLRU(head) && !__PageMovable(head))
+ if (PageHuge(page)) {
+ if (!hugepage_migration_supported(page_hstate(head)))
+ return page;
+ } else if (!PageLRU(head) && !__PageMovable(head)) {
return page;
+ }

skip_pages = compound_nr(head) - (page - head);
iter += skip_pages - 1;
\
 
 \ /
  Last update: 2020-02-28 16:48    [W:0.229 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site