Skip to contentSkip to conversation

mm-thp-avoid-excessive-compaction-latency-during-fault.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jun 5, 2014

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [merged] mm-thp-avoid-excessive-compaction-latency-during-fault.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Thu, 05 Jun 2014 12:51:49 -0700

The patch titled
Subject: mm, thp: avoid excessive compaction latency during fault
has been removed from the -mm tree. Its filename was
mm-thp-avoid-excessive-compaction-latency-during-fault.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: David Rientjes <[email protected]>
Subject: mm, thp: avoid excessive compaction latency during fault

Synchronous memory compaction can be very expensive: it can iterate an enormous amount of memory without aborting, constantly rescheduling, waiting on page locks and lru_lock, etc, if a pageblock cannot be defragmented.

Unfortunately, it's too expensive for transparent hugepage page faults 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.

Now that async compaction remembers where it left off without strictly relying on sync compaction, this makes thp allocations best-effort without causing egregious latency during fault. We still need to retry async compaction after reclaim, but this won't stall for seconds.

---

 mm/page_alloc.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-thp-avoid-excessive-compaction-latency-during-fault +8 -1
diff -puN mm/page_alloc.c~mm-thp-avoid-excessive-compaction-latency-during-fault mm/page_alloc.c
@@ -2575,7 +2575,14 @@ rebalance:
 					&did_some_progress);
 	if (page)
 		goto got_pg;
-	migration_mode = MIGRATE_SYNC_LIGHT;
+
+	/*
+	 * It can become very expensive to allocate transparent hugepages at
+	 * fault, so use asynchronous memory compaction for THP unless it is
+	 * khugepaged trying to collapse.
+	 */
+	if (!(gfp_mask & __GFP_NO_KSWAPD) || (current->flags & PF_KTHREAD))
+		migration_mode = MIGRATE_SYNC_LIGHT;
 
 	/*
 	 * If compaction is deferred for high-order allocations, it is because

_

Patches currently in -mm which might be from [email protected] are

origin.patch
mm-utilc-add-kstrimdup.patch
linux-next.patch