From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail172.messagelabs.com (mail172.messagelabs.com [216.82.254.3]) by kanga.kvack.org (Postfix) with ESMTP id CDD6B6B0089 for ; Mon, 16 Mar 2009 13:51:34 -0400 (EDT) From: Mel Gorman Subject: [PATCH 16/27] Save text by reducing call sites of __rmqueue() Date: Mon, 16 Mar 2009 17:53:30 +0000 Message-Id: <1237226020-14057-17-git-send-email-mel@csn.ul.ie> In-Reply-To: <1237226020-14057-1-git-send-email-mel@csn.ul.ie> References: <1237226020-14057-1-git-send-email-mel@csn.ul.ie> Sender: owner-linux-mm@kvack.org 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 List-ID: __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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org