Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763066AbXLNJJn (ORCPT ); Fri, 14 Dec 2007 04:09:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757486AbXLNJJ3 (ORCPT ); Fri, 14 Dec 2007 04:09:29 -0500 Received: from mga11.intel.com ([192.55.52.93]:6520 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757108AbXLNJJ1 (ORCPT ); Fri, 14 Dec 2007 04:09:27 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.24,166,1196668800"; d="scan'208";a="238023968" Subject: [RFC]handle error of rmqueue_bulk From: Shaohua Li To: lkml Cc: Andrew Morton , mel Content-Type: text/plain Date: Fri, 14 Dec 2007 17:08:57 +0800 Message-Id: <1197623337.3732.1.camel@sli10-desk.sh.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 972 Lines: 31 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); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/