Skip to contentSkip to conversation

mm-page_alloc-add-unlikely-macro-to-help-compiler-optimization.patch removed from -mm tree

merged [email protected] 1 participant 1 message Sep 12, 2013

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [merged] mm-page_alloc-add-unlikely-macro-to-help-compiler-optimization.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Thu, 12 Sep 2013 12:43:23 -0700

The patch titled
Subject: mm, page_alloc: add unlikely macro to help compiler optimization
has been removed from the -mm tree. Its filename was
mm-page_alloc-add-unlikely-macro-to-help-compiler-optimization.patch

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

------------------------------------------------------
From: Joonsoo Kim <[email protected]>
Subject: mm, page_alloc: add unlikely macro to help compiler optimization

We rarely allocate a page with ALLOC_NO_WATERMARKS and it is used in slow path. For helping compiler optimization, add unlikely macro to ALLOC_NO_WATERMARKS checking.

This patch doesn't have any effect now, because gcc already optimize this properly. But we cannot assume that gcc always does right and nobody re-evaluate if gcc do proper optimization with their change, for example, it is not optimized properly on v3.10. So adding compiler hint here is reasonable.

---

 mm/page_alloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_alloc-add-unlikely-macro-to-help-compiler-optimization +1 -1
diff -puN mm/page_alloc.c~mm-page_alloc-add-unlikely-macro-to-help-compiler-optimization mm/page_alloc.c
@@ -1909,7 +1909,7 @@ zonelist_scan:
 			!cpuset_zone_allowed_softwall(zone, gfp_mask))
 				continue;
 		BUILD_BUG_ON(ALLOC_NO_WATERMARKS < NR_WMARK);
-		if (alloc_flags & ALLOC_NO_WATERMARKS)
+		if (unlikely(alloc_flags & ALLOC_NO_WATERMARKS))
 			goto try_this_zone;
 		/*
 		 * Distribute pages in proportion to the individual

_

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

origin.patch