lkml.org 
[lkml]   [2007]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC]handle error of rmqueue_bulk
On (14/12/07 17:08), Shaohua Li didst pronounce:
> if rmqueue_bulk fails, we might get page with wrong migratetype,
> shouldn't we consider the case?
>

No. It is not a page allocation failure when this occurs, at worst
fragmentation gets a little worse. At this point, it is known the
per-cpu list contains pages so if one of the appropriate migrate type
cannot be found, fragmentation is allowed to get a little worse instead
of failing.

> Thanks,
> Shaohua
>
> Index: linux/mm/page_alloc.c
> ===================================================================
> --- linux.orig/mm/page_alloc.c 2007-12-14 16:44:35.000000000 +0800
> +++ linux/mm/page_alloc.c 2007-12-14 16:45:42.000000000 +0800
> @@ -1067,8 +1067,12 @@ again:
>
> /* Allocate more to the pcp list if necessary */
> if (unlikely(&page->lru == &pcp->list)) {
> - pcp->count += rmqueue_bulk(zone, 0,
> + int cn;
> + cn = rmqueue_bulk(zone, 0,
> pcp->batch, &pcp->list, migratetype);
> + if (unlikely(!cn))
> + goto failed;
> + pcp->count += cn;
> page = list_entry(pcp->list.next, struct page, lru);
> }
>
>
>

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


\
 
 \ /
  Last update: 2007-12-14 12:57    [W:0.028 / U:1.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site