Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760154AbZJIBHn (ORCPT ); Thu, 8 Oct 2009 21:07:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932095AbZJIBHl (ORCPT ); Thu, 8 Oct 2009 21:07:41 -0400 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:43687 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758180AbZJIBHk (ORCPT ); Thu, 8 Oct 2009 21:07:40 -0400 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 From: KOSAKI Motohiro To: LKML , linux-mm , Andrew Morton , Christoph Lameter Subject: [PATCH 1/3] mm: move inc_zone_page_state(NR_ISOLATED) to just isolated place Cc: kosaki.motohiro@jp.fujitsu.com Message-Id: <20091009100527.1284.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.50.07 [ja] Date: Fri, 9 Oct 2009 10:06:58 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2961 Lines: 102 This patch series is trivial cleanup and fix of page migration. ========================================================== Christoph pointed out inc_zone_page_state(NR_ISOLATED) should be placed in right after isolate_page(). This patch does it. Cc: Christoph Lameter Signed-off-by: KOSAKI Motohiro --- mm/memory_hotplug.c | 4 ++++ mm/mempolicy.c | 3 +++ mm/migrate.c | 12 ++++-------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 821dee5..653bf1e 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -663,6 +664,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 7dd9d9f..473f888 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 1a4bf48..0f66803 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 -- 1.6.0.GIT -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/