lkml.org 
[lkml]   [2009]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 19/22] Update NR_FREE_PAGES only as necessary
On Thu, Apr 23, 2009 at 04:06:10PM -0700, Andrew Morton wrote:
> On Wed, 22 Apr 2009 14:53:24 +0100
> Mel Gorman <mel@csn.ul.ie> wrote:
>
> > When pages are being freed to the buddy allocator, the zone
> > NR_FREE_PAGES counter must be updated. In the case of bulk per-cpu page
> > freeing, it's updated once per page. This retouches cache lines more
> > than necessary. Update the counters one per per-cpu bulk free.
> >
> > ...
> >
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -460,7 +460,6 @@ static inline void __free_one_page(struct page *page,
> > int migratetype)
> > {
> > unsigned long page_idx;
> > - int order_size = 1 << order;
> >
> > if (unlikely(PageCompound(page)))
> > if (unlikely(destroy_compound_page(page, order)))
> > @@ -470,10 +469,9 @@ static inline void __free_one_page(struct page *page,
> >
> > page_idx = page_to_pfn(page) & ((1 << MAX_ORDER) - 1);
> >
> > - VM_BUG_ON(page_idx & (order_size - 1));
> > + VM_BUG_ON(page_idx & ((1 << order) - 1));
> > VM_BUG_ON(bad_range(zone, page));
> >
>
> <head spins>
>
> Is this all a slow and obscure way of doing
>
> VM_BUG_ON(order > MAX_ORDER);
>
> ?

Nope.

>
> If not, what _is_ it asserting?
>

That the page is properly placed. The start of the page being freed has to
be size-of-page-aligned. If it isn't the calculation that works out where
the buddy is will break.

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


\
 
 \ /
  Last update: 2009-04-24 15:09    [W:0.574 / U:1.636 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site