Commit 4f50eaca authored by KOSAKI Motohiro's avatar KOSAKI Motohiro Committed by james toy

Christoph pointed out inc_zone_page_state(NR_ISOLATED) should be placed

in right after isolate_page().

This patch does it.
Acked-by: default avatarChristoph Lameter <cl@linux-foundation.org>
Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent e18471ee
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/migrate.h> #include <linux/migrate.h>
#include <linux/page-isolation.h> #include <linux/page-isolation.h>
#include <linux/pfn.h> #include <linux/pfn.h>
#include <linux/mm_inline.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
...@@ -663,6 +664,9 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) ...@@ -663,6 +664,9 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
if (!ret) { /* Success */ if (!ret) { /* Success */
list_add_tail(&page->lru, &source); list_add_tail(&page->lru, &source);
move_pages--; move_pages--;
inc_zone_page_state(page, NR_ISOLATED_ANON +
page_is_file_cache(page));
} else { } else {
/* Becasue we don't have big zone->lock. we should /* Becasue we don't have big zone->lock. we should
check this again here. */ check this again here. */
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
#include <linux/security.h> #include <linux/security.h>
#include <linux/syscalls.h> #include <linux/syscalls.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/mm_inline.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -809,6 +810,8 @@ static void migrate_page_add(struct page *page, struct list_head *pagelist, ...@@ -809,6 +810,8 @@ static void migrate_page_add(struct page *page, struct list_head *pagelist,
if ((flags & MPOL_MF_MOVE_ALL) || page_mapcount(page) == 1) { if ((flags & MPOL_MF_MOVE_ALL) || page_mapcount(page) == 1) {
if (!isolate_lru_page(page)) { if (!isolate_lru_page(page)) {
list_add_tail(&page->lru, pagelist); list_add_tail(&page->lru, pagelist);
inc_zone_page_state(page, NR_ISOLATED_ANON +
page_is_file_cache(page));
} }
} }
} }
......
...@@ -746,13 +746,6 @@ int migrate_pages(struct list_head *from, ...@@ -746,13 +746,6 @@ int migrate_pages(struct list_head *from,
struct page *page2; struct page *page2;
int swapwrite = current->flags & PF_SWAPWRITE; int swapwrite = current->flags & PF_SWAPWRITE;
int rc; int rc;
unsigned long flags;
local_irq_save(flags);
list_for_each_entry(page, from, lru)
__inc_zone_page_state(page, NR_ISOLATED_ANON +
page_is_file_cache(page));
local_irq_restore(flags);
if (!swapwrite) if (!swapwrite)
current->flags |= PF_SWAPWRITE; current->flags |= PF_SWAPWRITE;
...@@ -878,8 +871,11 @@ static int do_move_page_to_node_array(struct mm_struct *mm, ...@@ -878,8 +871,11 @@ static int do_move_page_to_node_array(struct mm_struct *mm,
goto put_and_set; goto put_and_set;
err = isolate_lru_page(page); err = isolate_lru_page(page);
if (!err) if (!err) {
list_add_tail(&page->lru, &pagelist); list_add_tail(&page->lru, &pagelist);
inc_zone_page_state(page, NR_ISOLATED_ANON +
page_is_file_cache(page));
}
put_and_set: put_and_set:
/* /*
* Either remove the duplicate refcount from * Either remove the duplicate refcount from
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment