From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753836AbdJIFoi (ORCPT ); Mon, 9 Oct 2017 01:44:38 -0400 Received: from mga03.intel.com ([134.134.136.65]:30411 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795AbdJIFoh (ORCPT ); Mon, 9 Oct 2017 01:44:37 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,499,1500966000"; d="scan'208";a="1203686958" Date: Mon, 9 Oct 2017 13:44:35 +0800 From: Aaron Lu To: linux-mm , lkml Cc: Andrew Morton , Andi Kleen , Dave Hansen , Huang Ying , Tim Chen , Kemi Wang Subject: [PATCH] page_alloc.c: inline __rmqueue() Message-ID: <20171009054434.GA1798@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __rmqueue() is called by rmqueue_bulk() and rmqueue() under zone->lock and that lock can be heavily contended with memory intensive applications. Since __rmqueue() is a small function, inline it can save us some time. With the will-it-scale/page_fault1/process benchmark, when using nr_cpu processes to stress buddy: On a 2 sockets Intel-Skylake machine: base %change head 77342 +6.3% 82203 will-it-scale.per_process_ops On a 4 sockets Intel-Skylake machine: base %change head 75746 +4.6% 79248 will-it-scale.per_process_ops This patch adds inline to __rmqueue(). Signed-off-by: Aaron Lu --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0e309ce4a44a..c9605c7ebaf6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2291,7 +2291,7 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype) * Do the hard work of removing an element from the buddy allocator. * Call me with the zone->lock already held. */ -static struct page *__rmqueue(struct zone *zone, unsigned int order, +static inline struct page *__rmqueue(struct zone *zone, unsigned int order, int migratetype) { struct page *page; -- 2.13.6