Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753228Ab0DMPZx (ORCPT ); Tue, 13 Apr 2010 11:25:53 -0400 Received: from mail-bw0-f219.google.com ([209.85.218.219]:51859 "EHLO mail-bw0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752731Ab0DMPZv (ORCPT ); Tue, 13 Apr 2010 11:25:51 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=bnRIBADG4y1ipNRa0pj8eG7Wab0U0eqbbpK6JFRZqeXs/0cHd8glOmPRgjaUetR2Ti V+5AtlV1L+2N/M353qZ4vjG9YR9WmVyXoR/fpOvCWFZDy/nnPRLoOkunfcxm80GlSw2c fjuxJ6PNXC81pU9jlIN0V4RoxQY9bhf7KrqDs= From: Minchan Kim To: Andrew Morton Cc: Mel Gorman , KAMEZAWA Hiroyuki , Bob Liu , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Minchan Kim , Tejun Heo , Christoph Lameter Subject: [PATCH 2/6] change alloc function in pcpu_alloc_pages Date: Wed, 14 Apr 2010 00:24:59 +0900 Message-Id: X-Mailer: git-send-email 1.7.0.5 In-Reply-To: <9918f566ab0259356cded31fd1dd80da6cae0c2b.1271171877.git.minchan.kim@gmail.com> References: <9918f566ab0259356cded31fd1dd80da6cae0c2b.1271171877.git.minchan.kim@gmail.com> In-Reply-To: <9918f566ab0259356cded31fd1dd80da6cae0c2b.1271171877.git.minchan.kim@gmail.com> References: <9918f566ab0259356cded31fd1dd80da6cae0c2b.1271171877.git.minchan.kim@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1232 Lines: 35 alloc_pages_node is called with cpu_to_node(cpu). I think cpu_to_node(cpu) never returns -1. (But I am not sure we need double check.) So we can use alloc_pages_exact_node instead of alloc_pages_node. It could avoid comparison and branch as 6484eb3e2a81807722 tried. Cc: Tejun Heo Cc: Christoph Lameter Signed-off-by: Minchan Kim --- mm/percpu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/percpu.c b/mm/percpu.c index 768419d..ec3e671 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -720,7 +720,7 @@ static int pcpu_alloc_pages(struct pcpu_chunk *chunk, for (i = page_start; i < page_end; i++) { struct page **pagep = &pages[pcpu_page_idx(cpu, i)]; - *pagep = alloc_pages_node(cpu_to_node(cpu), gfp, 0); + *pagep = alloc_pages_exact_node(cpu_to_node(cpu), gfp, 0); if (!*pagep) { pcpu_free_pages(chunk, pages, populated, page_start, page_end); -- 1.7.0.5 -- 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/