public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mel Gorman <mel@csn.ul.ie>
To: Shaohua Li <shaohua.li@intel.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC]handle error of rmqueue_bulk
Date: Fri, 14 Dec 2007 11:53:46 +0000	[thread overview]
Message-ID: <20071214115346.GC11046@csn.ul.ie> (raw)
In-Reply-To: <1197623337.3732.1.camel@sli10-desk.sh.intel.com>

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

      reply	other threads:[~2007-12-14 11:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-14  9:08 [RFC]handle error of rmqueue_bulk Shaohua Li
2007-12-14 11:53 ` Mel Gorman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071214115346.GC11046@csn.ul.ie \
    --to=mel@csn.ul.ie \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaohua.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox