Re: [PATCHv3 05/24] mm, proc: adjust PSS calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 20, 2015 at 06:31:15PM +0100, Jerome Marchand wrote:
> On 02/12/2015 05:18 PM, Kirill A. Shutemov wrote:
> > With new refcounting all subpages of the compound page are not nessessary
> > have the same mapcount. We need to take into account mapcount of every
> > sub-page.
> > 
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
> > ---
> >  fs/proc/task_mmu.c | 43 ++++++++++++++++++++++---------------------
> >  1 file changed, 22 insertions(+), 21 deletions(-)
> > 
> > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> > index 98826d08a11b..8a0a78174cc6 100644
> > --- a/fs/proc/task_mmu.c
> > +++ b/fs/proc/task_mmu.c
> > @@ -449,9 +449,10 @@ struct mem_size_stats {
> >  };
> >  
> >  static void smaps_account(struct mem_size_stats *mss, struct page *page,
> > -		unsigned long size, bool young, bool dirty)
> > +		bool compound, bool young, bool dirty)
> >  {
> > -	int mapcount;
> > +	int i, nr = compound ? hpage_nr_pages(page) : 1;
> > +	unsigned long size = 1UL << nr;
> 
> Shouldn't that be:
> 	unsigned long size = nr << PAGE_SHIFT;

Yes, thanks you.

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]