diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-06-16 05:15:58 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-16 05:15:58 -0400 |
commit | e765ee90da62535ac7d7a97f2464f9646539d683 (patch) | |
tree | 7a9cecce5aab958938e9a3bf46c2302d6af1958c /mm/page_alloc.c | |
parent | a4500b84c51645bbc86be3ca84f2252b7ada060f (diff) | |
parent | 066519068ad2fbe98c7f45552b1f592903a9c8c8 (diff) |
Merge branch 'linus' into tracing/ftrace
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 63835579323a..2f552955a02f 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 | ||
1401 | zonelist_scan: | 1376 | zonelist_scan: |
@@ -2804,7 +2779,7 @@ int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages) | |||
2804 | alloc_size = zone->wait_table_hash_nr_entries | 2779 | alloc_size = zone->wait_table_hash_nr_entries |
2805 | * sizeof(wait_queue_head_t); | 2780 | * sizeof(wait_queue_head_t); |
2806 | 2781 | ||
2807 | if (system_state == SYSTEM_BOOTING) { | 2782 | if (!slab_is_available()) { |
2808 | zone->wait_table = (wait_queue_head_t *) | 2783 | zone->wait_table = (wait_queue_head_t *) |
2809 | alloc_bootmem_node(pgdat, alloc_size); | 2784 | alloc_bootmem_node(pgdat, alloc_size); |
2810 | } else { | 2785 | } else { |
@@ -3378,7 +3353,8 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat, | |||
3378 | * is used by this zone for memmap. This affects the watermark | 3353 | * is used by this zone for memmap. This affects the watermark |
3379 | * and per-cpu initialisations | 3354 | * and per-cpu initialisations |
3380 | */ | 3355 | */ |
3381 | memmap_pages = (size * sizeof(struct page)) >> PAGE_SHIFT; | 3356 | memmap_pages = |
3357 | PAGE_ALIGN(size * sizeof(struct page)) >> PAGE_SHIFT; | ||
3382 | if (realsize >= memmap_pages) { | 3358 | if (realsize >= memmap_pages) { |
3383 | realsize -= memmap_pages; | 3359 | realsize -= memmap_pages; |
3384 | printk(KERN_DEBUG | 3360 | printk(KERN_DEBUG |