Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1158705rdb; Wed, 16 Aug 2023 03:40:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFm2VVW94jGdgjwwwUDEuymUR1EYnQ0KUQuBX8MzOFBb2FnYXPuMN6Gj8vVKyNEcFTrOHTd X-Received: by 2002:a17:906:9bd4:b0:988:f1ec:7400 with SMTP id de20-20020a1709069bd400b00988f1ec7400mr1131891ejc.36.1692182435187; Wed, 16 Aug 2023 03:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692182435; cv=none; d=google.com; s=arc-20160816; b=HdomqXuzxDVQZs/DXwbfQbk91JHQLzBoUdpzuxDqgHfG/7KKMhvt7doRX3LX7v3o6D yPm2eTzA8+jC2sq7I3F/XRBnfp5zMDpBXg1YHXkEstCmZgwbnsntRwQWPRKboXV+wzd3 akKAQpW4Fc0Y7pWYF/+5Fv+gh6o1rG8J5b7chBG/a1MktWhStuKckVrjbjYVneK47Fdv I/M0InluLy0T9Pw7SEVfk5yrv5AUqQQGsFCytBCrbg7ihf+EnR+iC+LzMpEndXGxAEVm BZHGO3T6GS7uzrxnfxgHtTZpwLOsQa1kEw6+dgvOWyBPwnZLHFHHCHeU4ttFHf/83VG8 lKmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=dWOl44MdEXHjkdY4LHDAS9q5SEU7NW4jDw7TvoiIkzs=; fh=xSqeBmA0dEpYQriSb9oC8DH+3FSC+ez5b3qbIuOkUiM=; b=YliwoOGIPOIyncXj1o7lRJl4McH319imsVNVo6VpWUAB8p8CjihVKH3cYThAeEkkVX 5yFMcuUJ9vQ78QyFNp4WNYstzHygCDJ1XNwjQjPv5/NteU8KIP99QZ+rGpqg1aippcOF mYFRQwbo5M691GAdfVv2OePorXGLoI0UMQ8rrIVL9uJWKX2dGpFEhvAg8hnJB+VTPLHJ oVQ5+GtEAyiFIUJS9nK4Te342a1XHq7jsfCeVBI1jDzGy+N0H9Zw6SwhEibUyXTOhGnc 7Pmx7cJCcnqXmh1U2M3vUV9PU5ebNJXxC/MgRPb/pIp76C6Zkec6c1WROG09r6yE2iSq x3hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="WZ/UtuLe"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mh13-20020a170906eb8d00b0099bcd1fa5acsi11088125ejb.359.2023.08.16.03.40.10; Wed, 16 Aug 2023 03:40:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="WZ/UtuLe"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238942AbjHORrF (ORCPT + 99 others); Tue, 15 Aug 2023 13:47:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239000AbjHORq7 (ORCPT ); Tue, 15 Aug 2023 13:46:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26D971BD2 for ; Tue, 15 Aug 2023 10:46:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AF7ED65313 for ; Tue, 15 Aug 2023 17:46:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C48A2C433C8; Tue, 15 Aug 2023 17:46:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692121617; bh=EgN0FumDkhZ0MVW7N3arVVnjWU5cWx8JVh19S9+fGtE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WZ/UtuLePrd6cpAfJQvckif9G6ui3J5q9uxnrTGiW6p+sagXMWY1zyMd+Er9j5SJZ dOIqZTTcKzbcNN7+KDyRwtv5Ol3kHcYwXsgo+VZUF0/YSuyT8lOYho16xonITrro97 LX8zZcdJ5x0KyTbzbdl7rz6zeIyzp5khg953CvdfQOjD53c1XhzpnochQCrVPDgkeb gnLT9V2NGSMv1+lE0dacCjCG3+xhSAV+M7PN23fgYUMB4MwHIymuhMqVGZCMAsrEoO j7FtFzxS86sH9ni1RRMmoeclCcIw38TQdgqLNsU7qH4cLcxv1rqf6I1FtfliEDbZAL Lf3bcWTVJbzNg== Date: Tue, 15 Aug 2023 10:46:55 -0700 From: Chris Li To: Kemeng Shi Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, mgorman@techsingularity.net, david@redhat.com, willy@infradead.org Subject: Re: [PATCH 2/2] mm/page_alloc: remove unnecessary parameter batch of nr_pcp_free Message-ID: References: <20230809100754.3094517-1-shikemeng@huaweicloud.com> <20230809100754.3094517-3-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230809100754.3094517-3-shikemeng@huaweicloud.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kemeng, Since I am discussing the other patch in this series, I might just commend on this one as well. On Wed, Aug 09, 2023 at 06:07:54PM +0800, Kemeng Shi wrote: > We get batch from pcp and just pass it to nr_pcp_free immediately. Get > batch from pcp inside nr_pcp_free to remove unnecessary parameter batch. > > Signed-off-by: Kemeng Shi > --- > mm/page_alloc.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 1ddcb2707d05..bb1d14e806ad 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -2376,10 +2376,10 @@ static bool free_unref_page_prepare(struct page *page, unsigned long pfn, > return true; > } > > -static int nr_pcp_free(struct per_cpu_pages *pcp, int high, int batch, > - bool free_high) > +static int nr_pcp_free(struct per_cpu_pages *pcp, int high, bool free_high) > { > int min_nr_free, max_nr_free; > + int batch = READ_ONCE(pcp->batch); Because nr_pcp_free is static and has only one caller. This function gets?inlined at the caller's side. I verified that on X86_64 compiled code. So this fix in my opinion is not worthwhile to fix. It will produce the same machine code. One minor side effect is that it will hide the commit under it in "git blame". Chris