lkml.org 
[lkml]   [2013]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 07/17] mm/page_alloc: use zone_spans_pfn() instead of open coding.
Date
Use zone_spans_pfn() instead of open coding pfn ownership checks.

This is split from following patch as could slightly degrade the
generated code. Pre-patch, the code uses it's knowledge that start_pfn <
end_pfn to cut down on the number of comparisons. Post-patch, the
compiler has to figure it out.

Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
---
mm/page_alloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index da5a5ec..3911c1a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -978,9 +978,9 @@ int move_freepages_block(struct zone *zone, struct page *page,
end_pfn = start_pfn + pageblock_nr_pages - 1;

/* Do not cross zone boundaries */
- if (start_pfn < zone->zone_start_pfn)
+ if (!zone_spans_pfn(zone, start_pfn))
start_page = page;
- if (end_pfn >= zone->zone_start_pfn + zone->spanned_pages)
+ if (!zone_spans_pfn(zone, end_pfn))
return 0;

return move_freepages(zone, start_page, end_page, migratetype);
--
1.8.0.3


\
 
 \ /
  Last update: 2013-01-16 02:21    [W:0.084 / U:3.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site