Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755706AbZCPJt4 (ORCPT ); Mon, 16 Mar 2009 05:49:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754338AbZCPJoc (ORCPT ); Mon, 16 Mar 2009 05:44:32 -0400 Received: from gir.skynet.ie ([193.1.99.77]:49716 "EHLO gir.skynet.ie" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753539AbZCPJo2 (ORCPT ); Mon, 16 Mar 2009 05:44:28 -0400 From: Mel Gorman To: Mel Gorman , Linux Memory Management List Cc: Pekka Enberg , Rik van Riel , KOSAKI Motohiro , Christoph Lameter , Johannes Weiner , Nick Piggin , Linux Kernel Mailing List , Lin Ming , Zhang Yanmin , Peter Zijlstra Subject: [PATCH 16/35] Save text by reducing call sites of __rmqueue() Date: Mon, 16 Mar 2009 09:46:11 +0000 Message-Id: <1237196790-7268-17-git-send-email-mel@csn.ul.ie> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1237196790-7268-1-git-send-email-mel@csn.ul.ie> References: <1237196790-7268-1-git-send-email-mel@csn.ul.ie> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1325 Lines: 41 __rmqueue is inlined in the fast path but it has two call sites, the low order and high order paths. However, a slight modification to the high-order path reduces the call sites of __rmqueue. This reduces text at the slight increase of complexity of the high-order allocation path. Signed-off-by: Mel Gorman --- mm/page_alloc.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0ba9e4f..795cfc5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1123,11 +1123,14 @@ again: list_del(&page->lru); pcp->count--; } else { - spin_lock_irqsave(&zone->lock, flags); - page = __rmqueue(zone, order, migratetype); - spin_unlock(&zone->lock); - if (!page) + LIST_HEAD(list); + local_irq_save(flags); + + /* Calling __rmqueue would bloat text, hence this */ + if (!rmqueue_bulk(zone, order, 1, &list, migratetype)) goto failed; + page = list_entry(list.next, struct page, lru); + list_del(&page->lru); } __count_zone_vm_events(PGALLOC, zone, 1 << order); -- 1.5.6.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/