From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753235Ab0IOA0j (ORCPT ); Tue, 14 Sep 2010 20:26:39 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:34056 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752160Ab0IOA0i (ORCPT ); Tue, 14 Sep 2010 20:26:38 -0400 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 From: KOSAKI Motohiro To: Nikanth Karthikesan Subject: Re: [PATCH v2] After swapout/swapin private dirty mappings are reported clean in smaps Cc: kosaki.motohiro@jp.fujitsu.com, Richard Guenther , linux-mm@kvack.org, Andrew Morton , balbir@linux.vnet.ibm.com, Michael Matz , Matt Mackall , linux-kernel@vger.kernel.org In-Reply-To: <201009142244.59080.knikanth@suse.de> References: <201009142242.29245.knikanth@suse.de> <201009142244.59080.knikanth@suse.de> Message-Id: <20100915092504.C9DC.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: Wed, 15 Sep 2010 09:26:36 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c > index 439fc1f..06fc468 100644 > --- a/fs/proc/task_mmu.c > +++ b/fs/proc/task_mmu.c > @@ -368,7 +368,11 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, > mss->shared_clean += PAGE_SIZE; > mss->pss += (PAGE_SIZE << PSS_SHIFT) / mapcount; > } else { > - if (pte_dirty(ptent)) > + /* > + * File-backed pages, now anonymous are dirty > + * with respect to the file. > + */ > + if (pte_dirty(ptent) || (vma->vm_file && PageAnon(page))) > mss->private_dirty += PAGE_SIZE; > else > mss->private_clean += PAGE_SIZE; This is risky than v1. number of dirties are used a lot of application.