From: KOSAKI Motohiro Date: Tue, 15 Dec 2009 01:58:11 +0000 (-0800) Subject: mm: move inc_zone_page_state(NR_ISOLATED) to just isolated place X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6d9c285a632b39ab83c6ae14cbff0e606d4042ee;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mm: move inc_zone_page_state(NR_ISOLATED) to just isolated place Christoph pointed out inc_zone_page_state(NR_ISOLATED) should be placed in right after isolate_page(). This patch does it. Reviewed-by: Christoph Lameter Signed-off-by: KOSAKI Motohiro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 2047465cd27c..e8116f8bdffa 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -672,6 +673,9 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) if (!ret) { /* Success */ list_add_tail(&page->lru, &source); move_pages--; + inc_zone_page_state(page, NR_ISOLATED_ANON + + page_is_file_cache(page)); + } else { /* Becasue we don't have big zone->lock. we should check this again here. */ diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 4545d5944243..0f89eabbaf3e 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -89,6 +89,7 @@ #include #include #include +#include #include #include @@ -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 (!isolate_lru_page(page)) { list_add_tail(&page->lru, pagelist); + inc_zone_page_state(page, NR_ISOLATED_ANON + + page_is_file_cache(page)); } } } diff --git a/mm/migrate.c b/mm/migrate.c index 0bc640fd68fa..576c25eeb1ca 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -746,13 +746,6 @@ int migrate_pages(struct list_head *from, struct page *page2; int swapwrite = current->flags & PF_SWAPWRITE; 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) current->flags |= PF_SWAPWRITE; @@ -878,8 +871,11 @@ static int do_move_page_to_node_array(struct mm_struct *mm, goto put_and_set; err = isolate_lru_page(page); - if (!err) + if (!err) { list_add_tail(&page->lru, &pagelist); + inc_zone_page_state(page, NR_ISOLATED_ANON + + page_is_file_cache(page)); + } put_and_set: /* * Either remove the duplicate refcount from