diff options
Diffstat (limited to 'mm/migrate.c')
| -rw-r--r-- | mm/migrate.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 7a66ca25dc8a..a91ca00abebe 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
| @@ -297,7 +297,7 @@ static int migrate_page_move_mapping(struct address_space *mapping, | |||
| 297 | void **pslot; | 297 | void **pslot; |
| 298 | 298 | ||
| 299 | if (!mapping) { | 299 | if (!mapping) { |
| 300 | /* Anonymous page */ | 300 | /* Anonymous page without mapping */ |
| 301 | if (page_count(page) != 1) | 301 | if (page_count(page) != 1) |
| 302 | return -EAGAIN; | 302 | return -EAGAIN; |
| 303 | return 0; | 303 | return 0; |
| @@ -333,6 +333,19 @@ static int migrate_page_move_mapping(struct address_space *mapping, | |||
| 333 | */ | 333 | */ |
| 334 | __put_page(page); | 334 | __put_page(page); |
| 335 | 335 | ||
| 336 | /* | ||
| 337 | * If moved to a different zone then also account | ||
| 338 | * the page for that zone. Other VM counters will be | ||
| 339 | * taken care of when we establish references to the | ||
| 340 | * new page and drop references to the old page. | ||
| 341 | * | ||
| 342 | * Note that anonymous pages are accounted for | ||
| 343 | * via NR_FILE_PAGES and NR_ANON_PAGES if they | ||
| 344 | * are mapped to swap space. | ||
| 345 | */ | ||
| 346 | __dec_zone_page_state(page, NR_FILE_PAGES); | ||
| 347 | __inc_zone_page_state(newpage, NR_FILE_PAGES); | ||
| 348 | |||
| 336 | write_unlock_irq(&mapping->tree_lock); | 349 | write_unlock_irq(&mapping->tree_lock); |
| 337 | 350 | ||
| 338 | return 0; | 351 | return 0; |
