public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: Remove unlikely from the current_order test
@ 2013-06-17 22:06 Zhang Yanfei
  2013-06-17 23:56 ` David Rientjes
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Yanfei @ 2013-06-17 22:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: David Rientjes, Linux MM, linux-kernel@vger.kernel.org

From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>

In __rmqueue_fallback(), current_order loops down from MAX_ORDER - 1
to the order passed. MAX_ORDER is typically 11 and pageblock_order
is typically 9 on x86. Integer division truncates, so pageblock_order / 2
is 4.  For the first eight iterations, it's guaranteed that
current_order >= pageblock_order / 2 if it even gets that far!

So just remove the unlikely(), it's completely bogus.

Suggested-by: David Rientjes <rientjes@google.com>
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
---
 mm/page_alloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index c3edb62..7b4f367 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1050,7 +1050,7 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype)
 			 * MIGRATE_CMA areas.
 			 */
 			if (!is_migrate_cma(migratetype) &&
-			    (unlikely(current_order >= pageblock_order / 2) ||
+			    (current_order >= pageblock_order / 2 ||
 			     start_migratetype == MIGRATE_RECLAIMABLE ||
 			     page_group_by_mobility_disabled)) {
 				int pages;
-- 
1.7.1

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

end of thread, other threads:[~2013-06-17 23:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-17 22:06 [PATCH] mm: Remove unlikely from the current_order test Zhang Yanfei
2013-06-17 23:56 ` David Rientjes

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