aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pageblock-flags.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/pageblock-flags.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/pageblock-flags.h')
-rw-r--r--include/linux/pageblock-flags.h33
1 files changed, 13 insertions, 20 deletions
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
index c08730c10c7a..2baeee12f48e 100644
--- a/include/linux/pageblock-flags.h
+++ b/include/linux/pageblock-flags.h
@@ -65,33 +65,26 @@ extern int pageblock_order;
65/* Forward declaration */ 65/* Forward declaration */
66struct page; 66struct page;
67 67
68unsigned long get_pageblock_flags_mask(struct page *page, 68unsigned long get_pfnblock_flags_mask(struct page *page,
69 unsigned long pfn,
69 unsigned long end_bitidx, 70 unsigned long end_bitidx,
70 unsigned long mask); 71 unsigned long mask);
71void set_pageblock_flags_mask(struct page *page, 72
73void set_pfnblock_flags_mask(struct page *page,
72 unsigned long flags, 74 unsigned long flags,
75 unsigned long pfn,
73 unsigned long end_bitidx, 76 unsigned long end_bitidx,
74 unsigned long mask); 77 unsigned long mask);
75 78
76/* Declarations for getting and setting flags. See mm/page_alloc.c */ 79/* Declarations for getting and setting flags. See mm/page_alloc.c */
77static inline unsigned long get_pageblock_flags_group(struct page *page, 80#define get_pageblock_flags_group(page, start_bitidx, end_bitidx) \
78 int start_bitidx, int end_bitidx) 81 get_pfnblock_flags_mask(page, page_to_pfn(page), \
79{ 82 end_bitidx, \
80 unsigned long nr_flag_bits = end_bitidx - start_bitidx + 1; 83 (1 << (end_bitidx - start_bitidx + 1)) - 1)
81 unsigned long mask = (1 << nr_flag_bits) - 1; 84#define set_pageblock_flags_group(page, flags, start_bitidx, end_bitidx) \
82 85 set_pfnblock_flags_mask(page, flags, page_to_pfn(page), \
83 return get_pageblock_flags_mask(page, end_bitidx, mask); 86 end_bitidx, \
84} 87 (1 << (end_bitidx - start_bitidx + 1)) - 1)
85
86static inline void set_pageblock_flags_group(struct page *page,
87 unsigned long flags,
88 int start_bitidx, int end_bitidx)
89{
90 unsigned long nr_flag_bits = end_bitidx - start_bitidx + 1;
91 unsigned long mask = (1 << nr_flag_bits) - 1;
92
93 set_pageblock_flags_mask(page, flags, end_bitidx, mask);
94}
95 88
96#ifdef CONFIG_COMPACTION 89#ifdef CONFIG_COMPACTION
97#define get_pageblock_skip(page) \ 90#define get_pageblock_skip(page) \