lkml.org 
[lkml]   [2008]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] Report the pagesize backing a VMA in /proc/pid/smaps
On (22/09/08 01:30), Andrew Morton didst pronounce:
> On Mon, 22 Sep 2008 02:38:11 +0100 Mel Gorman <mel@csn.ul.ie> wrote:
>
> > + vma_page_size(vma) >> 10);
> >
> > return ret;
> > }
> > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> > index 32e0ef0..0c83445 100644
> > --- a/include/linux/hugetlb.h
> > +++ b/include/linux/hugetlb.h
> > @@ -231,6 +231,19 @@ static inline unsigned long huge_page_size(struct hstate *h)
> > return (unsigned long)PAGE_SIZE << h->order;
> > }
> >
> > +static inline unsigned long vma_page_size(struct vm_area_struct *vma)
> > +{
> > + struct hstate *hstate;
> > +
> > + if (!is_vm_hugetlb_page(vma))
> > + return PAGE_SIZE;
> > +
> > + hstate = hstate_vma(vma);
> > + VM_BUG_ON(!hstate);
> > +
> > + return 1UL << (hstate->order + PAGE_SHIFT);
> > +}
> > +
>
> CONFIG_HUGETLB_PAGE=n?
>

Fails miserably.

> What did you hope to gain by inlining this?
>

Inclusion with similar helper functions in the header but it's the wrong thing
to do in this case, obvious when pointed out. It's too large and called from
multiple places. I'll revise the patch

--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab


\
 
 \ /
  Last update: 2008-09-22 18:19    [W:0.270 / U:1.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site