diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-27 13:27:34 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-27 13:27:34 -0500 |
commit | f3b270a47882b958e9e3c5bd86894e3a7072899a (patch) | |
tree | de3bdfd5d67e8310257b93ac3d8d703599b9d929 /mm | |
parent | 116ad29d9839610d2811a1962cac7f3f2a9f9295 (diff) | |
parent | b9a33cebac70d6f67a769ce8d4078fee2b254ada (diff) |
Merge branch 'master'
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mempolicy.c | 22 | ||||
-rw-r--r-- | mm/vmscan.c | 10 |
2 files changed, 25 insertions, 7 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 880831bd3003..67af4cea1e23 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -552,7 +552,7 @@ static void migrate_page_add(struct page *page, struct list_head *pagelist, | |||
552 | */ | 552 | */ |
553 | if ((flags & MPOL_MF_MOVE_ALL) || page_mapcount(page) == 1) { | 553 | if ((flags & MPOL_MF_MOVE_ALL) || page_mapcount(page) == 1) { |
554 | if (isolate_lru_page(page)) | 554 | if (isolate_lru_page(page)) |
555 | list_add(&page->lru, pagelist); | 555 | list_add_tail(&page->lru, pagelist); |
556 | } | 556 | } |
557 | } | 557 | } |
558 | 558 | ||
@@ -569,6 +569,7 @@ static int migrate_pages_to(struct list_head *pagelist, | |||
569 | LIST_HEAD(moved); | 569 | LIST_HEAD(moved); |
570 | LIST_HEAD(failed); | 570 | LIST_HEAD(failed); |
571 | int err = 0; | 571 | int err = 0; |
572 | unsigned long offset = 0; | ||
572 | int nr_pages; | 573 | int nr_pages; |
573 | struct page *page; | 574 | struct page *page; |
574 | struct list_head *p; | 575 | struct list_head *p; |
@@ -576,8 +577,21 @@ static int migrate_pages_to(struct list_head *pagelist, | |||
576 | redo: | 577 | redo: |
577 | nr_pages = 0; | 578 | nr_pages = 0; |
578 | list_for_each(p, pagelist) { | 579 | list_for_each(p, pagelist) { |
579 | if (vma) | 580 | if (vma) { |
580 | page = alloc_page_vma(GFP_HIGHUSER, vma, vma->vm_start); | 581 | /* |
582 | * The address passed to alloc_page_vma is used to | ||
583 | * generate the proper interleave behavior. We fake | ||
584 | * the address here by an increasing offset in order | ||
585 | * to get the proper distribution of pages. | ||
586 | * | ||
587 | * No decision has been made as to which page | ||
588 | * a certain old page is moved to so we cannot | ||
589 | * specify the correct address. | ||
590 | */ | ||
591 | page = alloc_page_vma(GFP_HIGHUSER, vma, | ||
592 | offset + vma->vm_start); | ||
593 | offset += PAGE_SIZE; | ||
594 | } | ||
581 | else | 595 | else |
582 | page = alloc_pages_node(dest, GFP_HIGHUSER, 0); | 596 | page = alloc_pages_node(dest, GFP_HIGHUSER, 0); |
583 | 597 | ||
@@ -585,7 +599,7 @@ redo: | |||
585 | err = -ENOMEM; | 599 | err = -ENOMEM; |
586 | goto out; | 600 | goto out; |
587 | } | 601 | } |
588 | list_add(&page->lru, &newlist); | 602 | list_add_tail(&page->lru, &newlist); |
589 | nr_pages++; | 603 | nr_pages++; |
590 | if (nr_pages > MIGRATE_CHUNK_SIZE) | 604 | if (nr_pages > MIGRATE_CHUNK_SIZE) |
591 | break; | 605 | break; |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 1838c15ca4fd..b0af7593d01e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1908,7 +1908,12 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order) | |||
1908 | sc.swap_cluster_max = SWAP_CLUSTER_MAX; | 1908 | sc.swap_cluster_max = SWAP_CLUSTER_MAX; |
1909 | 1909 | ||
1910 | cond_resched(); | 1910 | cond_resched(); |
1911 | p->flags |= PF_MEMALLOC; | 1911 | /* |
1912 | * We need to be able to allocate from the reserves for RECLAIM_SWAP | ||
1913 | * and we also need to be able to write out pages for RECLAIM_WRITE | ||
1914 | * and RECLAIM_SWAP. | ||
1915 | */ | ||
1916 | p->flags |= PF_MEMALLOC | PF_SWAPWRITE; | ||
1912 | reclaim_state.reclaimed_slab = 0; | 1917 | reclaim_state.reclaimed_slab = 0; |
1913 | p->reclaim_state = &reclaim_state; | 1918 | p->reclaim_state = &reclaim_state; |
1914 | 1919 | ||
@@ -1932,11 +1937,10 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order) | |||
1932 | * a long time. | 1937 | * a long time. |
1933 | */ | 1938 | */ |
1934 | shrink_slab(sc.nr_scanned, gfp_mask, order); | 1939 | shrink_slab(sc.nr_scanned, gfp_mask, order); |
1935 | sc.nr_reclaimed = 1; /* Avoid getting the off node timeout */ | ||
1936 | } | 1940 | } |
1937 | 1941 | ||
1938 | p->reclaim_state = NULL; | 1942 | p->reclaim_state = NULL; |
1939 | current->flags &= ~PF_MEMALLOC; | 1943 | current->flags &= ~(PF_MEMALLOC | PF_SWAPWRITE); |
1940 | 1944 | ||
1941 | if (sc.nr_reclaimed == 0) | 1945 | if (sc.nr_reclaimed == 0) |
1942 | zone->last_unsuccessful_zone_reclaim = jiffies; | 1946 | zone->last_unsuccessful_zone_reclaim = jiffies; |