Skip to contentSkip to conversation

mm-compactionc-micro-optimization-remove-unnecessary-branch.patch removed from -mm tree

merged [email protected] 1 participant 1 message Oct 14, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/compaction.c: micro-optimization remove unnecessary branch
has been removed from the -mm tree. Its filename was
mm-compactionc-micro-optimization-remove-unnecessary-branch.patch

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

------------------------------------------------------
From: Mateusz Nosek <[email protected]>
Subject: mm/compaction.c: micro-optimization remove unnecessary branch

The same code can work both for 'zone->compact_considered > defer_limit' and 'zone->compact_considered >= defer_limit'. In the latter there is one branch less which is more effective considering performance.

---

 mm/compaction.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
mm/compaction.c renamed from mm/compaction.c~mm-compactionc-micro-optimization-remove-unnecessary-branch +2 -3
@@ -180,11 +180,10 @@ bool compaction_deferred(struct zone *zo
 		return false;
 
 	/* Avoid possible overflow */
-	if (++zone->compact_considered > defer_limit)
+	if (++zone->compact_considered >= defer_limit) {
 		zone->compact_considered = defer_limit;
-
-	if (zone->compact_considered >= defer_limit)
 		return false;
+	}
 
 	trace_mm_compaction_deferred(zone, order);
 

_

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

mm-page_poisonc-replace-bool-variable-with-static-key.patch