public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC]handle error of rmqueue_bulk
@ 2007-12-14  9:08 Shaohua Li
  2007-12-14 11:53 ` Mel Gorman
  0 siblings, 1 reply; 2+ messages in thread
From: Shaohua Li @ 2007-12-14  9:08 UTC (permalink / raw)
  To: lkml; +Cc: Andrew Morton, mel

if rmqueue_bulk fails, we might get page with wrong migratetype,
shouldn't we consider the case? 

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);
 		}
 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-12-14 11:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-14  9:08 [RFC]handle error of rmqueue_bulk Shaohua Li
2007-12-14 11:53 ` Mel Gorman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox