linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch] mm, thp: do not perform sync compaction on pagefault
@ 2014-05-01  0:45 David Rientjes
  2014-05-01  6:39 ` Joonsoo Kim
  0 siblings, 1 reply; 2+ messages in thread
From: David Rientjes @ 2014-05-01  0:45 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mel Gorman, Rik van Riel, Vlastimil Babka, Joonsoo Kim,
	Greg Thelen, Hugh Dickins, linux-kernel, linux-mm

Synchronous memory compaction can be very expensive: it can iterate an enormous 
amount of memory without aborting and it can wait on page locks and writeback to 
complete if a pageblock cannot be defragmented.

Unfortunately, it's too expensive for pagefault for transparent hugepages and 
it's much better to simply fallback to pages.  On 128GB machines, we find that 
synchronous memory compaction can take O(seconds) for a single thp fault.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2656,7 +2656,7 @@ rebalance:
 		/* Wait for some write requests to complete then retry */
 		wait_iff_congested(preferred_zone, BLK_RW_ASYNC, HZ/50);
 		goto rebalance;
-	} else {
+	} else if (!(gfp_mask & __GFP_NO_KSWAPD)) {
 		/*
 		 * High-order allocations do not necessarily loop after
 		 * direct reclaim and reclaim/compaction depends on compaction

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [patch] mm, thp: do not perform sync compaction on pagefault
  2014-05-01  0:45 [patch] mm, thp: do not perform sync compaction on pagefault David Rientjes
@ 2014-05-01  6:39 ` Joonsoo Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Joonsoo Kim @ 2014-05-01  6:39 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Mel Gorman, Rik van Riel, Vlastimil Babka,
	Joonsoo Kim, Greg Thelen, Hugh Dickins, LKML,
	Linux Memory Management List

2014-05-01 9:45 GMT+09:00 David Rientjes <rientjes@google.com>:
> Synchronous memory compaction can be very expensive: it can iterate an enormous
> amount of memory without aborting and it can wait on page locks and writeback to
> complete if a pageblock cannot be defragmented.
> Unfortunately, it's too expensive for pagefault for transparent hugepages and
> it's much better to simply fallback to pages.  On 128GB machines, we find that
> synchronous memory compaction can take O(seconds) for a single thp fault.

Hello,

AFAIK, synchronous compaction doesn't wait the page on writeback.
sync compaction pass MIGRATE_SYNC_LIGHT for migrate_mode,
instead of MIGRATE_SYNC. It results in skipping the page on writeback.

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2014-05-01  6:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-01  0:45 [patch] mm, thp: do not perform sync compaction on pagefault David Rientjes
2014-05-01  6:39 ` Joonsoo Kim

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