Re: [PATCH -V3 6/9] mm: add framework for PCP high auto-tuning

Mel Gorman
2023-10-19T12:16:50Z

On Mon, Oct 16, 2023 at 01:29:59PM +0800, Huang Ying wrote:
> The page allocation performance requirements of different workloads
> are usually different. So, we need to tune PCP (per-CPU pageset) high
> to optimize the workload page allocation performance. Now, we have a
> system wide sysctl knob (percpu_pagelist_high_fraction) to tune PCP
> high by hand. But, it's hard to find out the best value by hand. And
> one global configuration may not work best for the different workloads
> that run on the same system. One solution to these issues is to tune
> PCP high of each CPU automatically.
>
> This patch adds the framework for PCP high auto-tuning. With it,
> pcp->high of each CPU will be changed automatically by tuning
> algorithm at runtime. The minimal high (pcp->high_min) is the
> original PCP high value calculated based on the low watermark pages.
> While the maximal high (pcp->high_max) is the PCP high value when
> percpu_pagelist_high_fraction sysctl knob is set to
> MIN_PERCPU_PAGELIST_HIGH_FRACTION. That is, the maximal pcp->high
> that can be set via sysctl knob by hand.
>
> It's possible that PCP high auto-tuning doesn't work well for some
> workloads. So, when PCP high is tuned by hand via the sysctl knob,
> the auto-tuning will be disabled. The PCP high set by hand will be
> used instead.
>
> This patch only adds the framework, so pcp->high will be set to
> pcp->high_min (original default) always. We will add actual
> auto-tuning algorithm in the following patches in the series.
>
> Signed-off-by: "Huang, Ying" <ying.huang@intel.com>

Acked-by: Mel Gorman <mgorman@techsingularity.net>

--
Mel Gorman
SUSE Labs