Thread (32 messages) 32 messages, 3 authors, 2016-08-18

Re: [PATCH v6 10/11] mm, compaction: require only min watermarks for non-costly orders

From: Vlastimil Babka <hidden>
Date: 2016-08-18 12:20:15
Also in: lkml
Subsystem: memory management, memory management - page allocator, the rest · Maintainers: Andrew Morton, Vlastimil Babka, Linus Torvalds

On 08/16/2016 08:46 AM, Joonsoo Kim wrote:
On Tue, Aug 16, 2016 at 08:36:12AM +0200, Vlastimil Babka wrote:
quoted
On 08/16/2016 08:16 AM, Joonsoo Kim wrote:
quoted
On Wed, Aug 10, 2016 at 11:12:25AM +0200, Vlastimil Babka wrote:
quoted
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 621e4211ce16..a5c0f914ec00 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2492,7 +2492,7 @@ int __isolate_free_page(struct page *page, unsigned int order)
	if (!is_migrate_isolate(mt)) {
		/* Obey watermarks as if the page was being allocated */
-		watermark = low_wmark_pages(zone) + (1 << order);
+		watermark = min_wmark_pages(zone) + (1UL << order);
This '1 << order' also needs some comment. Why can't we use
compact_gap() in this case?
This is just short-cutting the high-order watermark check to check
only order-0, because we already know the high-order page exists.
We can't use compact_gap() as that's too high to use for a single
allocation watermark, since we can be already holding some free
pages on the list. So it would defeat the gap purpose.
Oops. I missed that. Thanks for clarifying it.
So let's expand the comment?

----8<----
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help