diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2008-07-24 00:27:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:14 -0400 |
commit | e4048e5dc4aecec670f48ed007a28779f09cebd6 (patch) | |
tree | eb22cb47f1885d8006a85c5142d6e7f9d115de49 | |
parent | efe9e77997f6e0306fedc6efa98df491dcf5ecb0 (diff) |
page allocator: inline some __alloc_pages() wrappers
Two zonelist patch series rewrote __page_alloc() largely. Now, it is just
a wrapper function. Inlining them will save a function call.
[akpm@linux-foundation.org: export __alloc_pages_internal]
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/gfp.h | 21 | ||||
-rw-r--r-- | mm/page_alloc.c | 19 |
2 files changed, 19 insertions, 21 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index b414be387180..f640ed241422 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -173,11 +173,24 @@ static inline void arch_free_page(struct page *page, int order) { } | |||
173 | static inline void arch_alloc_page(struct page *page, int order) { } | 173 | static inline void arch_alloc_page(struct page *page, int order) { } |
174 | #endif | 174 | #endif |
175 | 175 | ||
176 | extern struct page *__alloc_pages(gfp_t, unsigned int, struct zonelist *); | 176 | struct page * |
177 | __alloc_pages_internal(gfp_t gfp_mask, unsigned int order, | ||
178 | struct zonelist *zonelist, nodemask_t *nodemask); | ||
179 | |||
180 | static inline struct page * | ||
181 | __alloc_pages(gfp_t gfp_mask, unsigned int order, | ||
182 | struct zonelist *zonelist) | ||
183 | { | ||
184 | return __alloc_pages_internal(gfp_mask, order, zonelist, NULL); | ||
185 | } | ||
186 | |||
187 | static inline struct page * | ||
188 | __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, | ||
189 | struct zonelist *zonelist, nodemask_t *nodemask) | ||
190 | { | ||
191 | return __alloc_pages_internal(gfp_mask, order, zonelist, nodemask); | ||
192 | } | ||
177 | 193 | ||
178 | extern struct page * | ||
179 | __alloc_pages_nodemask(gfp_t, unsigned int, | ||
180 | struct zonelist *, nodemask_t *nodemask); | ||
181 | 194 | ||
182 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, | 195 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, |
183 | unsigned int order) | 196 | unsigned int order) |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e089b92cdfff..35b1347d81bb 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1429,7 +1429,7 @@ try_next_zone: | |||
1429 | /* | 1429 | /* |
1430 | * This is the 'heart' of the zoned buddy allocator. | 1430 | * This is the 'heart' of the zoned buddy allocator. |
1431 | */ | 1431 | */ |
1432 | static struct page * | 1432 | struct page * |
1433 | __alloc_pages_internal(gfp_t gfp_mask, unsigned int order, | 1433 | __alloc_pages_internal(gfp_t gfp_mask, unsigned int order, |
1434 | struct zonelist *zonelist, nodemask_t *nodemask) | 1434 | struct zonelist *zonelist, nodemask_t *nodemask) |
1435 | { | 1435 | { |
@@ -1632,22 +1632,7 @@ nopage: | |||
1632 | got_pg: | 1632 | got_pg: |
1633 | return page; | 1633 | return page; |
1634 | } | 1634 | } |
1635 | 1635 | EXPORT_SYMBOL(__alloc_pages_internal); | |
1636 | struct page * | ||
1637 | __alloc_pages(gfp_t gfp_mask, unsigned int order, | ||
1638 | struct zonelist *zonelist) | ||
1639 | { | ||
1640 | return __alloc_pages_internal(gfp_mask, order, zonelist, NULL); | ||
1641 | } | ||
1642 | |||
1643 | struct page * | ||
1644 | __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, | ||
1645 | struct zonelist *zonelist, nodemask_t *nodemask) | ||
1646 | { | ||
1647 | return __alloc_pages_internal(gfp_mask, order, zonelist, nodemask); | ||
1648 | } | ||
1649 | |||
1650 | EXPORT_SYMBOL(__alloc_pages); | ||
1651 | 1636 | ||
1652 | /* | 1637 | /* |
1653 | * Common helper functions. | 1638 | * Common helper functions. |