From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753878Ab1GIGGr (ORCPT ); Sat, 9 Jul 2011 02:06:47 -0400 Received: from out5.smtp.messagingengine.com ([66.111.4.29]:46495 "EHLO out5.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753794Ab1GIGBF (ORCPT ); Sat, 9 Jul 2011 02:01:05 -0400 X-Sasl-enc: uEWILFaCMdDCBgP0qv9A7fZAE9xhvwVbkHEmO3k/UR4N 1310191265 X-Mailbox-Line: From gregkh@clark.kroah.org Fri Jul 8 16:01:09 2011 Message-Id: <20110708230109.705264950@clark.kroah.org> User-Agent: quilt/0.48-16.4 Date: Fri, 08 Jul 2011 16:00:18 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Andrea Arcangeli , Hugh Dickins Subject: [02/35] migrate: dont account swapcache as shmem In-Reply-To: <20110708230122.GA18807@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2.6.33-longterm review patch. If anyone has any objections, please let us 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 --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/migrate.c +++ b/mm/migrate.c @@ -261,7 +261,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); }