aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-07-14 17:29:34 -0400
committerJonathan Corbet <corbet@lwn.net>2008-07-14 17:29:34 -0400
commit2fceef397f9880b212a74c418290ce69e7ac00eb (patch)
treed9cc09ab992825ef7fede4a688103503e3caf655 /mm/page_alloc.c
parentfeae1ef116ed381625d3731c5ae4f4ebcb3fa302 (diff)
parentbce7f793daec3e65ec5c5705d2457b81fe7b5725 (diff)
Merge commit 'v2.6.26' into bkl-removal
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c43
1 files changed, 9 insertions, 34 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 63835579323a..f32fae3121f0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -237,16 +237,7 @@ static void bad_page(struct page *page)
237 printk(KERN_EMERG "Trying to fix it up, but a reboot is needed\n" 237 printk(KERN_EMERG "Trying to fix it up, but a reboot is needed\n"
238 KERN_EMERG "Backtrace:\n"); 238 KERN_EMERG "Backtrace:\n");
239 dump_stack(); 239 dump_stack();
240 page->flags &= ~(1 << PG_lru | 240 page->flags &= ~PAGE_FLAGS_CLEAR_WHEN_BAD;
241 1 << PG_private |
242 1 << PG_locked |
243 1 << PG_active |
244 1 << PG_dirty |
245 1 << PG_reclaim |
246 1 << PG_slab |
247 1 << PG_swapcache |
248 1 << PG_writeback |
249 1 << PG_buddy );
250 set_page_count(page, 0); 241 set_page_count(page, 0);
251 reset_page_mapcount(page); 242 reset_page_mapcount(page);
252 page->mapping = NULL; 243 page->mapping = NULL;
@@ -463,16 +454,7 @@ static inline int free_pages_check(struct page *page)
463 (page->mapping != NULL) | 454 (page->mapping != NULL) |
464 (page_get_page_cgroup(page) != NULL) | 455 (page_get_page_cgroup(page) != NULL) |
465 (page_count(page) != 0) | 456 (page_count(page) != 0) |
466 (page->flags & ( 457 (page->flags & PAGE_FLAGS_CHECK_AT_FREE)))
467 1 << PG_lru |
468 1 << PG_private |
469 1 << PG_locked |
470 1 << PG_active |
471 1 << PG_slab |
472 1 << PG_swapcache |
473 1 << PG_writeback |
474 1 << PG_reserved |
475 1 << PG_buddy ))))
476 bad_page(page); 458 bad_page(page);
477 if (PageDirty(page)) 459 if (PageDirty(page))
478 __ClearPageDirty(page); 460 __ClearPageDirty(page);
@@ -616,17 +598,7 @@ static int prep_new_page(struct page *page, int order, gfp_t gfp_flags)
616 (page->mapping != NULL) | 598 (page->mapping != NULL) |
617 (page_get_page_cgroup(page) != NULL) | 599 (page_get_page_cgroup(page) != NULL) |
618 (page_count(page) != 0) | 600 (page_count(page) != 0) |
619 (page->flags & ( 601 (page->flags & PAGE_FLAGS_CHECK_AT_PREP)))
620 1 << PG_lru |
621 1 << PG_private |
622 1 << PG_locked |
623 1 << PG_active |
624 1 << PG_dirty |
625 1 << PG_slab |
626 1 << PG_swapcache |
627 1 << PG_writeback |
628 1 << PG_reserved |
629 1 << PG_buddy ))))
630 bad_page(page); 602 bad_page(page);
631 603
632 /* 604 /*
@@ -1396,6 +1368,9 @@ get_page_from_freelist(gfp_t gfp_mask, nodemask_t *nodemask, unsigned int order,
1396 1368
1397 (void)first_zones_zonelist(zonelist, high_zoneidx, nodemask, 1369 (void)first_zones_zonelist(zonelist, high_zoneidx, nodemask,
1398 &preferred_zone); 1370 &preferred_zone);
1371 if (!preferred_zone)
1372 return NULL;
1373
1399 classzone_idx = zone_idx(preferred_zone); 1374 classzone_idx = zone_idx(preferred_zone);
1400 1375
1401zonelist_scan: 1376zonelist_scan:
@@ -2353,7 +2328,6 @@ static void build_zonelists(pg_data_t *pgdat)
2353static void build_zonelist_cache(pg_data_t *pgdat) 2328static void build_zonelist_cache(pg_data_t *pgdat)
2354{ 2329{
2355 pgdat->node_zonelists[0].zlcache_ptr = NULL; 2330 pgdat->node_zonelists[0].zlcache_ptr = NULL;
2356 pgdat->node_zonelists[1].zlcache_ptr = NULL;
2357} 2331}
2358 2332
2359#endif /* CONFIG_NUMA */ 2333#endif /* CONFIG_NUMA */
@@ -2804,7 +2778,7 @@ int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
2804 alloc_size = zone->wait_table_hash_nr_entries 2778 alloc_size = zone->wait_table_hash_nr_entries
2805 * sizeof(wait_queue_head_t); 2779 * sizeof(wait_queue_head_t);
2806 2780
2807 if (system_state == SYSTEM_BOOTING) { 2781 if (!slab_is_available()) {
2808 zone->wait_table = (wait_queue_head_t *) 2782 zone->wait_table = (wait_queue_head_t *)
2809 alloc_bootmem_node(pgdat, alloc_size); 2783 alloc_bootmem_node(pgdat, alloc_size);
2810 } else { 2784 } else {
@@ -3378,7 +3352,8 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,
3378 * is used by this zone for memmap. This affects the watermark 3352 * is used by this zone for memmap. This affects the watermark
3379 * and per-cpu initialisations 3353 * and per-cpu initialisations
3380 */ 3354 */
3381 memmap_pages = (size * sizeof(struct page)) >> PAGE_SHIFT; 3355 memmap_pages =
3356 PAGE_ALIGN(size * sizeof(struct page)) >> PAGE_SHIFT;
3382 if (realsize >= memmap_pages) { 3357 if (realsize >= memmap_pages) {
3383 realsize -= memmap_pages; 3358 realsize -= memmap_pages;
3384 printk(KERN_DEBUG 3359 printk(KERN_DEBUG