From: Andrew Morton <akpm@linux-foundation.org>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: linux-mm@kvack.org, Matthew Wilcox <willy@infradead.org>,
David Rientjes <rientjes@google.com>,
"Huang, Ying" <ying.huang@intel.com>,
Mel Gorman <mgorman@techsingularity.net>
Subject: Re: [PATCH] mm: Enable setting -1 for vm.percpu_pagelist_high_fraction to set the minimum pagelist
Date: Mon, 1 Jul 2024 19:51:43 -0700 [thread overview]
Message-ID: <20240701195143.7e8d597abc14b255f3bc4bcd@linux-foundation.org> (raw)
In-Reply-To: <20240701142046.6050-1-laoar.shao@gmail.com>
On Mon, 1 Jul 2024 22:20:46 +0800 Yafang Shao <laoar.shao@gmail.com> wrote:
> Currently, we're encountering latency spikes in our container environment
> when a specific container with multiple Python-based tasks exits. These
> tasks may hold the zone->lock for an extended period, significantly
> impacting latency for other containers attempting to allocate memory.
Is this locking issue well understood? Is anyone working on it? A
reasonably detailed description of the issue and a description of any
ongoing work would be helpful here.
> --- a/Documentation/admin-guide/sysctl/vm.rst
> +++ b/Documentation/admin-guide/sysctl/vm.rst
> @@ -856,6 +856,10 @@ on per-cpu page lists. This entry only changes the value of hot per-cpu
> page lists. A user can specify a number like 100 to allocate 1/100th of
> each zone between per-cpu lists.
>
> +The minimum number of pages that can be stored in per-CPU page lists is
> +four times the batch value. By writing '-1' to this sysctl, you can set
> +this minimum value.
I suggest we also describe why an operator would want to set this, and
the expected effects of that action.
> The batch value of each per-cpu page list remains the same regardless of
> the value of the high fraction so allocation latencies are unaffected.
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 2e22ce5675ca..e7313f9d704b 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5486,6 +5486,10 @@ static int zone_highsize(struct zone *zone, int batch, int cpu_online,
> int nr_split_cpus;
> unsigned long total_pages;
>
> + /* Setting -1 to set the minimum pagelist size, four times the batch size */
Some old-timers still use 80-column xterms ;)
> + if (high_fraction == -1)
> + return batch << 2;
> +
> if (!high_fraction) {
> /*
> * By default, the high value of the pcp is based on the zone
next prev parent reply other threads:[~2024-07-02 2:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-01 14:20 Yafang Shao
2024-07-02 2:51 ` Andrew Morton [this message]
2024-07-02 6:37 ` Yafang Shao
2024-07-02 9:08 ` Huang, Ying
2024-07-02 12:07 ` Yafang Shao
2024-07-03 1:55 ` Huang, Ying
2024-07-03 2:13 ` Yafang Shao
2024-07-03 3:21 ` Huang, Ying
2024-07-03 3:44 ` Yafang Shao
2024-07-03 5:34 ` Huang, Ying
2024-07-04 13:27 ` Yafang Shao
2024-07-05 1:28 ` Huang, Ying
2024-07-05 3:03 ` Yafang Shao
2024-07-05 5:31 ` Huang, Ying
2024-07-05 13:09 ` Mel Gorman
2024-07-02 7:23 ` Huang, Ying
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=20240701195143.7e8d597abc14b255f3bc4bcd@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=laoar.shao@gmail.com \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=rientjes@google.com \
--cc=willy@infradead.org \
--cc=ying.huang@intel.com \
/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