lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200228104700.0af2f18d@imladris.surriel.com>
Date:   Fri, 28 Feb 2020 10:47:00 -0500
From:   Rik van Riel <riel@...riel.com>
To:     Vlastimil Babka <vbabka@...e.cz>
Cc:     Mike Kravetz <mike.kravetz@...cle.com>,
        linux-kernel@...r.kernel.org, kernel-team@...com,
        akpm@...ux-foundation.org, linux-mm@...ck.org, mhocko@...nel.org,
        mgorman@...hsingularity.net, rientjes@...gle.com,
        aarcange@...hat.com, ziy@...dia.com
Subject: [PATCH] fix
 mmthpcompactioncma-allow-thp-migration-for-cma-allocations.patch

Thank you Mike & Vlastimil!

---8<---

commit 27f3cd5473d8bbf591b61d8b93b98bc333980d0d
Author: Rik van Riel <riel@...riel.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@...cle.com>
Suggested-by: Vlastimil Babka <vbabka@...e.cz>
Signed-off-by: Rik van Riel <riel@...riel.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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ