Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756800Ab1BJSJ6 (ORCPT ); Thu, 10 Feb 2011 13:09:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42817 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756686Ab1BJSJ5 (ORCPT ); Thu, 10 Feb 2011 13:09:57 -0500 Date: Thu, 10 Feb 2011 19:09:24 +0100 From: Andrea Arcangeli To: Mel Gorman Cc: Dave Hansen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michael J Wolf , Johannes Weiner , David Rientjes Subject: Re: [PATCH 5/5] have smaps show transparent huge pages Message-ID: <20110210180924.GB3347@random.random> References: <20110209195406.B9F23C9F@kernel> <20110209195413.6D3CB37F@kernel> <20110210112032.GG17873@csn.ul.ie> <1297350115.6737.14208.camel@nimitz> <20110210150942.GL17873@csn.ul.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110210150942.GL17873@csn.ul.ie> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1486 Lines: 35 On Thu, Feb 10, 2011 at 03:09:42PM +0000, Mel Gorman wrote: > On Thu, Feb 10, 2011 at 07:01:55AM -0800, Dave Hansen wrote: > > On Thu, 2011-02-10 at 11:20 +0000, Mel Gorman wrote: > > > > @@ -394,6 +395,7 @@ static int smaps_pte_range(pmd_t *pmd, u > > > > spin_lock(&walk->mm->page_table_lock); > > > > } else { > > > > smaps_pte_entry(*(pte_t *)pmd, addr, HPAGE_SIZE, walk); > > > > + mss->anonymous_thp += HPAGE_SIZE; > > > > > > I should have thought of this for the previous patch but should this be > > > HPAGE_PMD_SIZE instead of HPAGE_SIZE? Right now, they are the same value > > > but they are not the same thing. > > > > Probably. There's also a nice BUG() in HPAGE_PMD_SIZE if the THP config > > option is off, which is an added bonus. > > > > Unless Andrea has an objection, I'd prefer to see HPAGE_PMD_SIZE. We get there only through pmd_trans_huge, so HPAGE_PMD_SIZE is certainly more correct, agreed. I also think this can go in -mm after s/HPAGE_SIZE/HPAGE_PMD_SIZE/ and after correcting the locking (see other email). Maybe it'd be cleaner if we didn't need to cast the pmd to pte_t but I guess this makes things simpler. Thanks! Andrea -- 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/