Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4486589pxf; Tue, 23 Mar 2021 11:46:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEmIl84zmY/xGLQwBOxNqrqxt/T7EXYIjH0B2dQwSlYen2y5DY4g3syEc9fVM+YQKn1pfr X-Received: by 2002:a05:6402:b31:: with SMTP id bo17mr5887405edb.113.1616525186188; Tue, 23 Mar 2021 11:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616525186; cv=none; d=google.com; s=arc-20160816; b=Ulrf0OTzO5s7w8GzvTxwcgVVqA8gtrq7K+q6XJ+QbT/B5kd6DRTYm9Cj+VByZ00bdj ZM/p9U88OCZI/dlro5Mq88rJHoLXUF968TKT3LNMRdsF1Wu2/6HGNqPSe1mR2dXj1w7J 5wSvpBFB31Zis5cyy8pbDGVtVOwF+ZPA77ilHi7xz2pMFVrJG8Q+GFqSAsl9PfWRhjNq O24K/clsjvbetB/7Yw9jaLXb5z6y/m/V7Nr5U8V8i3a7nJ533x+KhZlFBbMhwUfThXU6 gm+jIbIgSVhnE10Ba2dbRCFm+g4BP7EBVqqKlSoAzPqBUYuU15MQ1KA/wwCmKtiNRdSe Xd7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=vl7faK6/1rqIrCcJbYgXDZqkBD5XK7VIDZoxxGZCEDo=; b=TU8XvlJAFg0Wqptz8TPs12Yw/kjfNQplHhX1CMKurIcyszEoGQMypF/jc347Jrc/qD 9G21yWT2XDc8GKuzj4nvyvDtJhEsBoGVjH72tG/+Vy8TXbPPdv/JtopcU6bzpUt68hcC BST4H837iCsCZftqGTZzAPUdFmLiTxzkVoF7ytRSS7u0Y/ViyVXVd5o2No1ZU3OPGJzR /usjn8Wp8sgB7bdQVO0psJJmMaDq0P3eLQEG3zPBZNtNs0eM+j1DGLCazNFVD1NhWjf8 Yois8+mTjahbL+HBacN/4mKhslSqZ9khEHvvaFg2Bt56QAH+Bj0Cv2WCLwH4o0QDJdJZ Un7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u19si14013986edq.33.2021.03.23.11.45.55; Tue, 23 Mar 2021 11:46:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231344AbhCWSn3 (ORCPT + 99 others); Tue, 23 Mar 2021 14:43:29 -0400 Received: from outbound-smtp08.blacknight.com ([46.22.139.13]:54381 "EHLO outbound-smtp08.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232220AbhCWSnJ (ORCPT ); Tue, 23 Mar 2021 14:43:09 -0400 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp08.blacknight.com (Postfix) with ESMTPS id E237C1C3DC1 for ; Tue, 23 Mar 2021 18:43:06 +0000 (GMT) Received: (qmail 13406 invoked from network); 23 Mar 2021 18:43:06 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 23 Mar 2021 18:43:06 -0000 Date: Tue, 23 Mar 2021 18:43:05 +0000 From: Mel Gorman To: Jesper Dangaard Brouer Cc: Andrew Morton , Vlastimil Babka , Chuck Lever , Christoph Hellwig , Alexander Duyck , Matthew Wilcox , LKML , Linux-Net , Linux-MM , Linux-NFS Subject: Re: [PATCH 2/3] mm/page_alloc: Add a bulk page allocator Message-ID: <20210323184305.GN3697@techsingularity.net> References: <20210322091845.16437-1-mgorman@techsingularity.net> <20210322091845.16437-3-mgorman@techsingularity.net> <20210323170008.5d0732be@carbon> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20210323170008.5d0732be@carbon> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Mar 23, 2021 at 05:00:08PM +0100, Jesper Dangaard Brouer wrote: > > + /* > > + * If there are no allowed local zones that meets the watermarks then > > + * try to allocate a single page and reclaim if necessary. > > + */ > > + if (!zone) > > + goto failed; > > + > > + /* Attempt the batch allocation */ > > + local_irq_save(flags); > > + pcp = &this_cpu_ptr(zone->pageset)->pcp; > > + pcp_list = &pcp->lists[ac.migratetype]; > > + > > + while (allocated < nr_pages) { > > + page = __rmqueue_pcplist(zone, ac.migratetype, alloc_flags, > > + pcp, pcp_list); > > The function __rmqueue_pcplist() is now used two places, this cause the > compiler to uninline the static function. > This was expected. It was not something I was particularly happy with but avoiding it was problematic without major refactoring. > My tests show you should inline __rmqueue_pcplist(). See patch I'm > using below signature, which also have some benchmark notes. (Please > squash it into your patch and drop these notes). > The cycle savings per element is very marginal at just 4 cycles. I expect just the silly stat updates are way more costly but the series that addresses that is likely to be controversial. As I know the cycle budget for processing a packet is tight, I've applied the patch but am keeping it separate to preserve the data in case someone points out that is a big function to inline and "fixes" it. -- Mel Gorman SUSE Labs