[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1b72c0b1-4615-4287-bac2-c8806e56f44a@intel.com>
Date: Wed, 8 Oct 2025 08:34:21 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Joshua Hahn <joshua.hahnjy@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Brendan Jackman <jackmanb@...gle.com>, Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...e.com>, Suren Baghdasaryan <surenb@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>, Zi Yan <ziy@...dia.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
ying.huang@...ux.alibaba.com
Subject: Re: [RFC] [PATCH] mm/page_alloc: pcp->batch tuning
First of all, I do agree that the comment should go away or get fixed up.
But...
On 10/6/25 07:54, Joshua Hahn wrote:
> This leaves us with a /= 4 with no corresponding *= 4 anywhere, which
> leaves pcp->batch mistuned from the original intent when it was
> introduced. This is made worse by the fact that pcp lists are generally
> larger today than they were in 2013, meaning batch sizes should have
> increased, not decreased.
pcp->batch and pcp->high do very different things. pcp->high is a limit
on the amount of memory that can be tied up. pcp->batch balances
throughput with latency. I'm not sure I buy the idea that a higher
pcp->high means we should necessarily do larger batches.
So I dunno... f someone wanted to alter the initial batch size, they'd
ideally repeat some of Ying's experiments from: 52166607ecc9 ("mm:
restrict the pcp batch scale factor to avoid too long latency").
Better yet, just absorb the /=4 into the two existing batch assignments.
It will probably compile to exactly the same code and have no functional
changes and get rid of the comment.
Wouldn't this compile to the same thing?
batch = zone->managed_pages / 4096;
if (batch * PAGE_SIZE > 128 * 1024)
batch = (128 * 1024) / PAGE_SIZE;
Powered by blists - more mailing lists