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: <4672701b-6775-6efd-0797-b6242591419e@suse.cz>
Date:   Tue, 19 Feb 2019 16:24:09 +0100
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Dan Williams <dan.j.williams@...el.com>, akpm@...ux-foundation.org
Cc:     Michal Hocko <mhocko@...e.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, keith.busch@...el.com
Subject: Re: [PATCH v10 2/3] mm: Move buddy list manipulations into helpers

On 2/1/19 6:15 AM, Dan Williams wrote:
> In preparation for runtime randomization of the zone lists, take all
> (well, most of) the list_*() functions in the buddy allocator and put
> them in helper functions. Provide a common control point for injecting
> additional behavior when freeing pages.
> 
> Acked-by: Michal Hocko <mhocko@...e.com>
> Cc: Dave Hansen <dave.hansen@...ux.intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@...el.com>

Here's another fixlet to fold into mm-move-buddy-list-manipulations-into-helpers.patch
This time not critical.

----8<----
>From 05aaff61f62f86e646c4a2581fe2ff63ff66a199 Mon Sep 17 00:00:00 2001
From: Vlastimil Babka <vbabka@...e.cz>
Date: Tue, 19 Feb 2019 16:20:33 +0100
Subject: [PATCH] mm: Move buddy list manipulations into helpers-fix2

del_page_from_free_area() migratetype parameter is unused, remove it.

Signed-off-by: Vlastimil Babka <vbabka@...e.cz>
---
 include/linux/mmzone.h |  2 +-
 mm/page_alloc.c        | 14 ++++----------
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index da5321c747f8..2fd4247262e9 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -143,7 +143,7 @@ static inline struct page *get_page_from_free_area(struct free_area *area,
 }
 
 static inline void del_page_from_free_area(struct page *page,
-		struct free_area *area, int migratetype)
+		struct free_area *area)
 {
 	list_del(&page->lru);
 	__ClearPageBuddy(page);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 37ed14ad0b59..d2b6d5245568 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -901,8 +901,7 @@ static inline void __free_one_page(struct page *page,
 		if (page_is_guard(buddy))
 			clear_page_guard(zone, buddy, order, migratetype);
 		else
-			del_page_from_free_area(buddy, &zone->free_area[order],
-					migratetype);
+			del_page_from_free_area(buddy, &zone->free_area[order]);
 		combined_pfn = buddy_pfn & pfn;
 		page = page + (combined_pfn - pfn);
 		pfn = combined_pfn;
@@ -2173,7 +2172,7 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order,
 		page = get_page_from_free_area(area, migratetype);
 		if (!page)
 			continue;
-		del_page_from_free_area(page, area, migratetype);
+		del_page_from_free_area(page, area);
 		expand(zone, page, order, current_order, area, migratetype);
 		set_pcppage_migratetype(page, migratetype);
 		return page;
@@ -3144,7 +3143,7 @@ int __isolate_free_page(struct page *page, unsigned int order)
 
 	/* Remove page from free list */
 
-	del_page_from_free_area(page, area, mt);
+	del_page_from_free_area(page, area);
 
 	/*
 	 * Set the pageblock if the isolated page is at least half of a
@@ -8507,9 +8506,6 @@ __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
 	spin_lock_irqsave(&zone->lock, flags);
 	pfn = start_pfn;
 	while (pfn < end_pfn) {
-		struct free_area *area;
-		int mt;
-
 		if (!pfn_valid(pfn)) {
 			pfn++;
 			continue;
@@ -8528,13 +8524,11 @@ __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
 		BUG_ON(page_count(page));
 		BUG_ON(!PageBuddy(page));
 		order = page_order(page);
-		area = &zone->free_area[order];
 #ifdef CONFIG_DEBUG_VM
 		pr_info("remove from free list %lx %d %lx\n",
 			pfn, 1 << order, end_pfn);
 #endif
-		mt = get_pageblock_migratetype(page);
-		del_page_from_free_area(page, area, mt);
+		del_page_from_free_area(page, &zone->free_area[order]);
 		for (i = 0; i < (1 << order); i++)
 			SetPageReserved((page+i));
 		pfn += (1 << order);
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ