aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmzone.h
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2014-06-04 19:10:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 19:54:09 -0400
commitdc4b0caff24d9b2918e9f27bc65499ee63187eba (patch)
treeae94a40e2da00a8b32c81c4451d42447b65d6e03 /include/linux/mmzone.h
parente58469bafd0524e848c3733bc3918d854595e20f (diff)
mm: page_alloc: reduce number of times page_to_pfn is called
In the free path we calculate page_to_pfn multiple times. Reduce that. Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Jan Kara <jack@suse.cz> Cc: Michal Hocko <mhocko@suse.cz> Cc: Hugh Dickins <hughd@google.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Theodore Ts'o <tytso@mit.edu> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r--include/linux/mmzone.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 8ef1e3f71e0f..472426ac96ae 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -78,10 +78,15 @@ extern int page_group_by_mobility_disabled;
78#define NR_MIGRATETYPE_BITS (PB_migrate_end - PB_migrate + 1) 78#define NR_MIGRATETYPE_BITS (PB_migrate_end - PB_migrate + 1)
79#define MIGRATETYPE_MASK ((1UL << NR_MIGRATETYPE_BITS) - 1) 79#define MIGRATETYPE_MASK ((1UL << NR_MIGRATETYPE_BITS) - 1)
80 80
81static inline int get_pageblock_migratetype(struct page *page) 81#define get_pageblock_migratetype(page) \
82 get_pfnblock_flags_mask(page, page_to_pfn(page), \
83 PB_migrate_end, MIGRATETYPE_MASK)
84
85static inline int get_pfnblock_migratetype(struct page *page, unsigned long pfn)
82{ 86{
83 BUILD_BUG_ON(PB_migrate_end - PB_migrate != 2); 87 BUILD_BUG_ON(PB_migrate_end - PB_migrate != 2);
84 return get_pageblock_flags_mask(page, PB_migrate_end, MIGRATETYPE_MASK); 88 return get_pfnblock_flags_mask(page, pfn, PB_migrate_end,
89 MIGRATETYPE_MASK);
85} 90}
86 91
87struct free_area { 92struct free_area {