diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-04-05 19:41:22 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-04-05 19:41:22 -0400 |
| commit | 9efe21cb82b5dbe3b0b2ae4de4eccc64ecb94e95 (patch) | |
| tree | 7ff8833745d2f268f897f6fa4a27263b4a572245 /mm/page_alloc.c | |
| parent | de18836e447c2dc30120c0919b8db8ddc0401cc4 (diff) | |
| parent | 0221c81b1b8eb0cbb6b30a0ced52ead32d2b4e4c (diff) | |
Merge branch 'linus' into irq/threaded
Conflicts:
include/linux/irq.h
kernel/irq/handle.c
Diffstat (limited to 'mm/page_alloc.c')
| -rw-r--r-- | mm/page_alloc.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a92b0975b9a5..e2f26991fff1 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -331,7 +331,7 @@ static int destroy_compound_page(struct page *page, unsigned long order) | |||
| 331 | for (i = 1; i < nr_pages; i++) { | 331 | for (i = 1; i < nr_pages; i++) { |
| 332 | struct page *p = page + i; | 332 | struct page *p = page + i; |
| 333 | 333 | ||
| 334 | if (unlikely(!PageTail(p) | (p->first_page != page))) { | 334 | if (unlikely(!PageTail(p) || (p->first_page != page))) { |
| 335 | bad_page(page); | 335 | bad_page(page); |
| 336 | bad++; | 336 | bad++; |
| 337 | } | 337 | } |
| @@ -922,13 +922,10 @@ static void drain_pages(unsigned int cpu) | |||
| 922 | unsigned long flags; | 922 | unsigned long flags; |
| 923 | struct zone *zone; | 923 | struct zone *zone; |
| 924 | 924 | ||
| 925 | for_each_zone(zone) { | 925 | for_each_populated_zone(zone) { |
| 926 | struct per_cpu_pageset *pset; | 926 | struct per_cpu_pageset *pset; |
| 927 | struct per_cpu_pages *pcp; | 927 | struct per_cpu_pages *pcp; |
| 928 | 928 | ||
| 929 | if (!populated_zone(zone)) | ||
| 930 | continue; | ||
| 931 | |||
| 932 | pset = zone_pcp(zone, cpu); | 929 | pset = zone_pcp(zone, cpu); |
| 933 | 930 | ||
| 934 | pcp = &pset->pcp; | 931 | pcp = &pset->pcp; |
| @@ -1479,6 +1476,8 @@ __alloc_pages_internal(gfp_t gfp_mask, unsigned int order, | |||
| 1479 | unsigned long did_some_progress; | 1476 | unsigned long did_some_progress; |
| 1480 | unsigned long pages_reclaimed = 0; | 1477 | unsigned long pages_reclaimed = 0; |
| 1481 | 1478 | ||
| 1479 | lockdep_trace_alloc(gfp_mask); | ||
| 1480 | |||
| 1482 | might_sleep_if(wait); | 1481 | might_sleep_if(wait); |
| 1483 | 1482 | ||
| 1484 | if (should_fail_alloc_page(gfp_mask, order)) | 1483 | if (should_fail_alloc_page(gfp_mask, order)) |
| @@ -1578,12 +1577,16 @@ nofail_alloc: | |||
| 1578 | */ | 1577 | */ |
| 1579 | cpuset_update_task_memory_state(); | 1578 | cpuset_update_task_memory_state(); |
| 1580 | p->flags |= PF_MEMALLOC; | 1579 | p->flags |= PF_MEMALLOC; |
| 1580 | |||
| 1581 | lockdep_set_current_reclaim_state(gfp_mask); | ||
| 1581 | reclaim_state.reclaimed_slab = 0; | 1582 | reclaim_state.reclaimed_slab = 0; |
| 1582 | p->reclaim_state = &reclaim_state; | 1583 | p->reclaim_state = &reclaim_state; |
| 1583 | 1584 | ||
| 1584 | did_some_progress = try_to_free_pages(zonelist, order, gfp_mask); | 1585 | did_some_progress = try_to_free_pages(zonelist, order, |
| 1586 | gfp_mask, nodemask); | ||
| 1585 | 1587 | ||
| 1586 | p->reclaim_state = NULL; | 1588 | p->reclaim_state = NULL; |
| 1589 | lockdep_clear_current_reclaim_state(); | ||
| 1587 | p->flags &= ~PF_MEMALLOC; | 1590 | p->flags &= ~PF_MEMALLOC; |
| 1588 | 1591 | ||
| 1589 | cond_resched(); | 1592 | cond_resched(); |
| @@ -1874,10 +1877,7 @@ void show_free_areas(void) | |||
| 1874 | int cpu; | 1877 | int cpu; |
| 1875 | struct zone *zone; | 1878 | struct zone *zone; |
| 1876 | 1879 | ||
| 1877 | for_each_zone(zone) { | 1880 | for_each_populated_zone(zone) { |
| 1878 | if (!populated_zone(zone)) | ||
| 1879 | continue; | ||
| 1880 | |||
| 1881 | show_node(zone); | 1881 | show_node(zone); |
| 1882 | printk("%s per-cpu:\n", zone->name); | 1882 | printk("%s per-cpu:\n", zone->name); |
| 1883 | 1883 | ||
| @@ -1917,12 +1917,9 @@ void show_free_areas(void) | |||
| 1917 | global_page_state(NR_PAGETABLE), | 1917 | global_page_state(NR_PAGETABLE), |
| 1918 | global_page_state(NR_BOUNCE)); | 1918 | global_page_state(NR_BOUNCE)); |
| 1919 | 1919 | ||
| 1920 | for_each_zone(zone) { | 1920 | for_each_populated_zone(zone) { |
| 1921 | int i; | 1921 | int i; |
| 1922 | 1922 | ||
| 1923 | if (!populated_zone(zone)) | ||
| 1924 | continue; | ||
| 1925 | |||
| 1926 | show_node(zone); | 1923 | show_node(zone); |
| 1927 | printk("%s" | 1924 | printk("%s" |
| 1928 | " free:%lukB" | 1925 | " free:%lukB" |
| @@ -1962,12 +1959,9 @@ void show_free_areas(void) | |||
| 1962 | printk("\n"); | 1959 | printk("\n"); |
| 1963 | } | 1960 | } |
| 1964 | 1961 | ||
| 1965 | for_each_zone(zone) { | 1962 | for_each_populated_zone(zone) { |
| 1966 | unsigned long nr[MAX_ORDER], flags, order, total = 0; | 1963 | unsigned long nr[MAX_ORDER], flags, order, total = 0; |
| 1967 | 1964 | ||
| 1968 | if (!populated_zone(zone)) | ||
| 1969 | continue; | ||
| 1970 | |||
| 1971 | show_node(zone); | 1965 | show_node(zone); |
| 1972 | printk("%s: ", zone->name); | 1966 | printk("%s: ", zone->name); |
| 1973 | 1967 | ||
| @@ -2779,11 +2773,7 @@ static int __cpuinit process_zones(int cpu) | |||
| 2779 | 2773 | ||
| 2780 | node_set_state(node, N_CPU); /* this node has a cpu */ | 2774 | node_set_state(node, N_CPU); /* this node has a cpu */ |
| 2781 | 2775 | ||
| 2782 | for_each_zone(zone) { | 2776 | for_each_populated_zone(zone) { |
| 2783 | |||
| 2784 | if (!populated_zone(zone)) | ||
| 2785 | continue; | ||
| 2786 | |||
| 2787 | zone_pcp(zone, cpu) = kmalloc_node(sizeof(struct per_cpu_pageset), | 2777 | zone_pcp(zone, cpu) = kmalloc_node(sizeof(struct per_cpu_pageset), |
| 2788 | GFP_KERNEL, node); | 2778 | GFP_KERNEL, node); |
| 2789 | if (!zone_pcp(zone, cpu)) | 2779 | if (!zone_pcp(zone, cpu)) |
