aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2013-09-11 17:21:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:57:29 -0400
commite66f09725771ac5b1b868d6b19eba84e30ffad88 (patch)
tree82cd7bb01c1253efa6c13986882fab63a50201e6 /mm
parent1da6f0e1b316d0215989fe4d7c657edead1fdea7 (diff)
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. Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Minchan Kim <minchan@kernel.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 544d19d681a2..42c59300bacd 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1909,7 +1909,7 @@ zonelist_scan:
1909 !cpuset_zone_allowed_softwall(zone, gfp_mask)) 1909 !cpuset_zone_allowed_softwall(zone, gfp_mask))
1910 continue; 1910 continue;
1911 BUILD_BUG_ON(ALLOC_NO_WATERMARKS < NR_WMARK); 1911 BUILD_BUG_ON(ALLOC_NO_WATERMARKS < NR_WMARK);
1912 if (alloc_flags & ALLOC_NO_WATERMARKS) 1912 if (unlikely(alloc_flags & ALLOC_NO_WATERMARKS))
1913 goto try_this_zone; 1913 goto try_this_zone;
1914 /* 1914 /*
1915 * Distribute pages in proportion to the individual 1915 * Distribute pages in proportion to the individual