aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-06-06 10:31:26 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-06-06 10:31:26 -0400
commit4b01abc977574253f466f65463019de2571c6401 (patch)
treec330615fe9f277ad51a91da3db2d690a3336fb02 /mm
parent47c96298cd0b04b4478206fde55fd6a6431de980 (diff)
parent1def630a6a49dda5bc89dfbd86656293640456f0 (diff)
Merge branch 'master'
Diffstat (limited to 'mm')
-rw-r--r--mm/memory_hotplug.c8
-rw-r--r--mm/slab.c27
2 files changed, 17 insertions, 18 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 1ae2b2cc3a54..70df5c0d957e 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -91,8 +91,8 @@ static void grow_zone_span(struct zone *zone,
91 if (start_pfn < zone->zone_start_pfn) 91 if (start_pfn < zone->zone_start_pfn)
92 zone->zone_start_pfn = start_pfn; 92 zone->zone_start_pfn = start_pfn;
93 93
94 if (end_pfn > old_zone_end_pfn) 94 zone->spanned_pages = max(old_zone_end_pfn, end_pfn) -
95 zone->spanned_pages = end_pfn - zone->zone_start_pfn; 95 zone->zone_start_pfn;
96 96
97 zone_span_writeunlock(zone); 97 zone_span_writeunlock(zone);
98} 98}
@@ -106,8 +106,8 @@ static void grow_pgdat_span(struct pglist_data *pgdat,
106 if (start_pfn < pgdat->node_start_pfn) 106 if (start_pfn < pgdat->node_start_pfn)
107 pgdat->node_start_pfn = start_pfn; 107 pgdat->node_start_pfn = start_pfn;
108 108
109 if (end_pfn > old_pgdat_end_pfn) 109 pgdat->node_spanned_pages = max(old_pgdat_end_pfn, end_pfn) -
110 pgdat->node_spanned_pages = end_pfn - pgdat->node_start_pfn; 110 pgdat->node_start_pfn;
111} 111}
112 112
113int online_pages(unsigned long pfn, unsigned long nr_pages) 113int online_pages(unsigned long pfn, unsigned long nr_pages)
diff --git a/mm/slab.c b/mm/slab.c
index d31a06bfbea5..f1b644eb39d8 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -207,11 +207,6 @@ typedef unsigned int kmem_bufctl_t;
207#define BUFCTL_ACTIVE (((kmem_bufctl_t)(~0U))-2) 207#define BUFCTL_ACTIVE (((kmem_bufctl_t)(~0U))-2)
208#define SLAB_LIMIT (((kmem_bufctl_t)(~0U))-3) 208#define SLAB_LIMIT (((kmem_bufctl_t)(~0U))-3)
209 209
210/* Max number of objs-per-slab for caches which use off-slab slabs.
211 * Needed to avoid a possible looping condition in cache_grow().
212 */
213static unsigned long offslab_limit;
214
215/* 210/*
216 * struct slab 211 * struct slab
217 * 212 *
@@ -1356,12 +1351,6 @@ void __init kmem_cache_init(void)
1356 NULL, NULL); 1351 NULL, NULL);
1357 } 1352 }
1358 1353
1359 /* Inc off-slab bufctl limit until the ceiling is hit. */
1360 if (!(OFF_SLAB(sizes->cs_cachep))) {
1361 offslab_limit = sizes->cs_size - sizeof(struct slab);
1362 offslab_limit /= sizeof(kmem_bufctl_t);
1363 }
1364
1365 sizes->cs_dmacachep = kmem_cache_create(names->name_dma, 1354 sizes->cs_dmacachep = kmem_cache_create(names->name_dma,
1366 sizes->cs_size, 1355 sizes->cs_size,
1367 ARCH_KMALLOC_MINALIGN, 1356 ARCH_KMALLOC_MINALIGN,
@@ -1780,6 +1769,7 @@ static void set_up_list3s(struct kmem_cache *cachep, int index)
1780static size_t calculate_slab_order(struct kmem_cache *cachep, 1769static size_t calculate_slab_order(struct kmem_cache *cachep,
1781 size_t size, size_t align, unsigned long flags) 1770 size_t size, size_t align, unsigned long flags)
1782{ 1771{
1772 unsigned long offslab_limit;
1783 size_t left_over = 0; 1773 size_t left_over = 0;
1784 int gfporder; 1774 int gfporder;
1785 1775
@@ -1791,9 +1781,18 @@ static size_t calculate_slab_order(struct kmem_cache *cachep,
1791 if (!num) 1781 if (!num)
1792 continue; 1782 continue;
1793 1783
1794 /* More than offslab_limit objects will cause problems */ 1784 if (flags & CFLGS_OFF_SLAB) {
1795 if ((flags & CFLGS_OFF_SLAB) && num > offslab_limit) 1785 /*
1796 break; 1786 * Max number of objs-per-slab for caches which
1787 * use off-slab slabs. Needed to avoid a possible
1788 * looping condition in cache_grow().
1789 */
1790 offslab_limit = size - sizeof(struct slab);
1791 offslab_limit /= sizeof(kmem_bufctl_t);
1792
1793 if (num > offslab_limit)
1794 break;
1795 }
1797 1796
1798 /* Found something acceptable - save it away */ 1797 /* Found something acceptable - save it away */
1799 cachep->num = num; 1798 cachep->num = num;