aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorSeth, Rohit <rohit.seth@intel.com>2005-10-29 21:15:47 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 00:40:35 -0400
commitba56e91c940146e99ac694c4c7cd7f2b4aaa565d (patch)
tree5254f1ce8e2f39ccb58a74d0ff0120817b3b5c05 /mm/page_alloc.c
parentfcdae29aa7a5c79f245110f6680afdc1858d3626 (diff)
[PATCH] mm: page_alloc: increase size of per-cpu-pages
Increase the page allocator's per-cpu magazines from 1/4MB to 1/2MB. Over 100+ runs for a workload, the difference in mean is about 2%. The best results for both are almost same. Though the max variation in results with 1/2MB is only 2.2%, whereas with 1/4MB it is 12%. Signed-off-by: Rohit Seth <rohit.seth@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 94c864eac9c4..f799217dc2f3 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1721,29 +1721,29 @@ static int __devinit zone_batchsize(struct zone *zone)
1721 1721
1722 /* 1722 /*
1723 * The per-cpu-pages pools are set to around 1000th of the 1723 * The per-cpu-pages pools are set to around 1000th of the
1724 * size of the zone. But no more than 1/4 of a meg - there's 1724 * size of the zone. But no more than 1/2 of a meg.
1725 * no point in going beyond the size of L2 cache.
1726 * 1725 *
1727 * OK, so we don't know how big the cache is. So guess. 1726 * OK, so we don't know how big the cache is. So guess.
1728 */ 1727 */
1729 batch = zone->present_pages / 1024; 1728 batch = zone->present_pages / 1024;
1730 if (batch * PAGE_SIZE > 256 * 1024) 1729 if (batch * PAGE_SIZE > 512 * 1024)
1731 batch = (256 * 1024) / PAGE_SIZE; 1730 batch = (512 * 1024) / PAGE_SIZE;
1732 batch /= 4; /* We effectively *= 4 below */ 1731 batch /= 4; /* We effectively *= 4 below */
1733 if (batch < 1) 1732 if (batch < 1)
1734 batch = 1; 1733 batch = 1;
1735 1734
1736 /* 1735 /*
1737 * Clamp the batch to a 2^n - 1 value. Having a power 1736 * We will be trying to allcoate bigger chunks of contiguous
1738 * of 2 value was found to be more likely to have 1737 * memory of the order of fls(batch). This should result in
1739 * suboptimal cache aliasing properties in some cases. 1738 * better cache coloring.
1740 * 1739 *
1741 * For example if 2 tasks are alternately allocating 1740 * A sanity check also to ensure that batch is still in limits.
1742 * batches of pages, one task can end up with a lot
1743 * of pages of one half of the possible page colors
1744 * and the other with pages of the other colors.
1745 */ 1741 */
1746 batch = (1 << fls(batch + batch/2)) - 1; 1742 batch = (1 << fls(batch + batch/2));
1743
1744 if (fls(batch) >= (PAGE_SHIFT + MAX_ORDER - 2))
1745 batch = PAGE_SHIFT + ((MAX_ORDER - 1 - PAGE_SHIFT)/2);
1746
1747 return batch; 1747 return batch;
1748} 1748}
1749 1749