From: Chris Li <chrisl@kernel.org>
To: Kemeng Shi <shikemeng@huaweicloud.com>
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
Date: Tue, 15 Aug 2023 10:46:55 -0700 [thread overview]
Message-ID: <ZNu6D+1y3agQRZgr@google.com> (raw)
In-Reply-To: <20230809100754.3094517-3-shikemeng@huaweicloud.com>
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 <shikemeng@huaweicloud.com>
> ---
> 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
next prev parent reply other threads:[~2023-08-15 17:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-09 10:07 [PATCH 0/2] Two minor cleanups for pcp list in page_alloc Kemeng Shi
2023-08-09 10:07 ` [PATCH 1/2] mm/page_alloc: remove track of active PCP lists range in bulk free Kemeng Shi
2023-08-15 17:45 ` Chris Li
2023-08-17 2:22 ` Kemeng Shi
2023-08-17 7:51 ` Chris Li
2023-08-09 10:07 ` [PATCH 2/2] mm/page_alloc: remove unnecessary parameter batch of nr_pcp_free Kemeng Shi
2023-08-15 17:46 ` Chris Li [this message]
2023-08-17 2:43 ` Kemeng Shi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZNu6D+1y3agQRZgr@google.com \
--to=chrisl@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=shikemeng@huaweicloud.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox