aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2009-06-16 18:31:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 22:47:32 -0400
commitd239171e4f6efd58d7e423853056b1b6a74f1446 (patch)
tree3b0d96abf99e5add7bfc6236f745503b540bd350
parent6c0db4664b49417d80988953e69c323721353227 (diff)
page allocator: replace __alloc_pages_internal() with __alloc_pages_nodemask()
The start of a large patch series to clean up and optimise the page allocator. The performance improvements are in a wide range depending on the exact machine but the results I've seen so fair are approximately; kernbench: 0 to 0.12% (elapsed time) 0.49% to 3.20% (sys time) aim9: -4% to 30% (for page_test and brk_test) tbench: -1% to 4% hackbench: -2.5% to 3.45% (mostly within the noise though) netperf-udp -1.34% to 4.06% (varies between machines a bit) netperf-tcp -0.44% to 5.22% (varies between machines a bit) I haven't sysbench figures at hand, but previously they were within the -0.5% to 2% range. On netperf, the client and server were bound to opposite number CPUs to maximise the problems with cache line bouncing of the struct pages so I expect different people to report different results for netperf depending on their exact machine and how they ran the test (different machines, same cpus client/server, shared cache but two threads client/server, different socket client/server etc). I also measured the vmlinux sizes for a single x86-based config with CONFIG_DEBUG_INFO enabled but not CONFIG_DEBUG_VM. The core of the .config is based on the Debian Lenny kernel config so I expect it to be reasonably typical. This patch: __alloc_pages_internal is the core page allocator function but essentially it is an alias of __alloc_pages_nodemask. Naming a publicly available and exported function "internal" is also a big ugly. This patch renames __alloc_pages_internal() to __alloc_pages_nodemask() and deletes the old nodemask function. Warning - This patch renames an exported symbol. No kernel driver is affected by external drivers calling __alloc_pages_internal() should change the call to __alloc_pages_nodemask() without any alteration of parameters. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Dave Hansen <dave@linux.vnet.ibm.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.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.h12
-rw-r--r--mm/page_alloc.c4
2 files changed, 4 insertions, 12 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 3760e7c5de02..549ec5583103 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -172,24 +172,16 @@ static inline void arch_alloc_page(struct page *page, int order) { }
172#endif 172#endif
173 173
174struct page * 174struct page *
175__alloc_pages_internal(gfp_t gfp_mask, unsigned int order, 175__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
176 struct zonelist *zonelist, nodemask_t *nodemask); 176 struct zonelist *zonelist, nodemask_t *nodemask);
177 177
178static inline struct page * 178static inline struct page *
179__alloc_pages(gfp_t gfp_mask, unsigned int order, 179__alloc_pages(gfp_t gfp_mask, unsigned int order,
180 struct zonelist *zonelist) 180 struct zonelist *zonelist)
181{ 181{
182 return __alloc_pages_internal(gfp_mask, order, zonelist, NULL); 182 return __alloc_pages_nodemask(gfp_mask, order, zonelist, NULL);
183} 183}
184 184
185static inline struct page *
186__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
187 struct zonelist *zonelist, nodemask_t *nodemask)
188{
189 return __alloc_pages_internal(gfp_mask, order, zonelist, nodemask);
190}
191
192
193static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, 185static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
194 unsigned int order) 186 unsigned int order)
195{ 187{
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index cbed869fd831..d58df9031503 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1458,7 +1458,7 @@ try_next_zone:
1458 * This is the 'heart' of the zoned buddy allocator. 1458 * This is the 'heart' of the zoned buddy allocator.
1459 */ 1459 */
1460struct page * 1460struct page *
1461__alloc_pages_internal(gfp_t gfp_mask, unsigned int order, 1461__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
1462 struct zonelist *zonelist, nodemask_t *nodemask) 1462 struct zonelist *zonelist, nodemask_t *nodemask)
1463{ 1463{
1464 const gfp_t wait = gfp_mask & __GFP_WAIT; 1464 const gfp_t wait = gfp_mask & __GFP_WAIT;
@@ -1667,7 +1667,7 @@ nopage:
1667got_pg: 1667got_pg:
1668 return page; 1668 return page;
1669} 1669}
1670EXPORT_SYMBOL(__alloc_pages_internal); 1670EXPORT_SYMBOL(__alloc_pages_nodemask);
1671 1671
1672/* 1672/*
1673 * Common helper functions. 1673 * Common helper functions.