From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756028Ab1G0V5v (ORCPT ); Wed, 27 Jul 2011 17:57:51 -0400 Received: from mga11.intel.com ([192.55.52.93]:36381 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755689Ab1G0VtM (ORCPT ); Wed, 27 Jul 2011 17:49:12 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,279,1309762800"; d="scan'208";a="33043784" From: Andi Kleen References: <20110727247.325703029@firstfloor.org> In-Reply-To: <20110727247.325703029@firstfloor.org> To: aarcange@redhat.com, hughd@google.com, torvalds@linux-foundation.org, gregkh@suse.de, ak@linux.intel.com, linux-kernel@vger.kernel.org, stable@kernel.org, tim.bird@am.sony.com Subject: [PATCH] [66/99] migrate: don't account swapcache as shmem Message-Id: <20110727214905.7E75C2403FF@tassilo.jf.intel.com> Date: Wed, 27 Jul 2011 14:49:05 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2.6.35-longterm review patch. If anyone has any objections, please let me know. ------------------ From: Andrea Arcangeli commit 99a15e21d96f6857dafab1e5167e5e8183215c9c upstream. swapcache will reach the below code path in migrate_page_move_mapping, and swapcache is accounted as NR_FILE_PAGES but it's not accounted as NR_SHMEM. Hugh pointed out we must use PageSwapCache instead of comparing mapping to &swapper_space, to avoid build failure with CONFIG_SWAP=n. Signed-off-by: Andrea Arcangeli Acked-by: Hugh Dickins Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman Signed-off-by: Andi Kleen --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6.35.y/mm/migrate.c =================================================================== --- linux-2.6.35.y.orig/mm/migrate.c +++ linux-2.6.35.y/mm/migrate.c @@ -266,7 +266,7 @@ static int migrate_page_move_mapping(str */ __dec_zone_page_state(page, NR_FILE_PAGES); __inc_zone_page_state(newpage, NR_FILE_PAGES); - if (PageSwapBacked(page)) { + if (!PageSwapCache(page) && PageSwapBacked(page)) { __dec_zone_page_state(page, NR_SHMEM); __inc_zone_page_state(newpage, NR_SHMEM); }