From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 844F3C433DB for ; Tue, 23 Mar 2021 18:43:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E4F98619B8 for ; Tue, 23 Mar 2021 18:43:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4F98619B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 61FBE6B0291; Tue, 23 Mar 2021 14:43:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F6DD6B0292; Tue, 23 Mar 2021 14:43:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E6916B0293; Tue, 23 Mar 2021 14:43:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id 316806B0291 for ; Tue, 23 Mar 2021 14:43:11 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E6B331802E8B0 for ; Tue, 23 Mar 2021 18:43:10 +0000 (UTC) X-FDA: 77952011340.36.0EBA8FB Received: from outbound-smtp32.blacknight.com (outbound-smtp32.blacknight.com [81.17.249.64]) by imf23.hostedemail.com (Postfix) with ESMTP id 87748A000844 for ; Tue, 23 Mar 2021 18:43:09 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp32.blacknight.com (Postfix) with ESMTPS id 07A99BECEB for ; Tue, 23 Mar 2021 18:43:07 +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) X-Stat-Signature: 656si9ioirkibnr7nzxn4bbze7zjoyrn X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 87748A000844 Received-SPF: none (techsingularity.net>: No applicable sender policy available) receiver=imf23; identity=mailfrom; envelope-from=""; helo=outbound-smtp32.blacknight.com; client-ip=81.17.249.64 X-HE-DKIM-Result: none/none X-HE-Tag: 1616524989-923180 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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