X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=mm%2Fmigrate.c;h=a91ca00abebea3c7b0a8f0317cabfbc02f403d74;hb=075aa573b74a732aeff487ab77d3fbd627c10856;hp=e9b161bde95b4c382092a1c94a8fcfbd4bcf58f0;hpb=fb7665544dd60e016494cd5531f5b65ddae22ddc;p=powerpc.git diff --git a/mm/migrate.c b/mm/migrate.c index e9b161bde9..a91ca00abe 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -297,7 +297,7 @@ static int migrate_page_move_mapping(struct address_space *mapping, void **pslot; if (!mapping) { - /* Anonymous page */ + /* Anonymous page without mapping */ if (page_count(page) != 1) return -EAGAIN; return 0; @@ -333,6 +333,19 @@ static int migrate_page_move_mapping(struct address_space *mapping, */ __put_page(page); + /* + * If moved to a different zone then also account + * the page for that zone. Other VM counters will be + * taken care of when we establish references to the + * new page and drop references to the old page. + * + * Note that anonymous pages are accounted for + * via NR_FILE_PAGES and NR_ANON_PAGES if they + * are mapped to swap space. + */ + __dec_zone_page_state(page, NR_FILE_PAGES); + __inc_zone_page_state(newpage, NR_FILE_PAGES); + write_unlock_irq(&mapping->tree_lock); return 0; @@ -781,7 +794,7 @@ static int do_move_pages(struct mm_struct *mm, struct page_to_node *pm, err = -EFAULT; vma = find_vma(mm, pp->addr); - if (!vma) + if (!vma || !vma_migratable(vma)) goto set_status; page = follow_page(vma, pp->addr, FOLL_GET);