* [PATCH] mm: make pcp decay work with onhz
@ 2024-10-11 10:36 alexjlzheng
2024-10-12 22:43 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: alexjlzheng @ 2024-10-11 10:36 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, alexjlzheng, MengEn Sun
From: MengEn Sun <mengensun@tencent.com>
when a cpu stops tick, quiet_vmstat may flush all the per cpu
statistics counter.
while, the shepherd is needed those counters to kick the
vmstat_work.
when a cpu in nohz with a lot of pcp pages, and do not do page
allocating and freeing. the pcp pages of the cpu may not be hold
for a long time
we make shepherd keep a eye on the pcp high_min and high_max
Reviewed-by: Jinliang Zheng <alexjlzheng@tencent.com>
Signed-off-by: MengEn Sun <mengensun@tencent.com>
---
mm/vmstat.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 1917c034c045..32768fb8f769 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -2024,8 +2024,13 @@ static bool need_update(int cpu)
for_each_populated_zone(zone) {
struct per_cpu_zonestat *pzstats = per_cpu_ptr(zone->per_cpu_zonestats, cpu);
+ struct per_cpu_pages *pcp = per_cpu_ptr(zone->per_cpu_pageset, cpu);
struct per_cpu_nodestat *n;
+ /* in onhz or nohz full make pcp decay work */
+ if (pcp->high_max > pcp->high_min)
+ return true;
+
/*
* The fast way of checking if there are any vmstat diffs.
*/
--
2.43.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: make pcp decay work with onhz
2024-10-11 10:36 [PATCH] mm: make pcp decay work with onhz alexjlzheng
@ 2024-10-12 22:43 ` Andrew Morton
2024-10-18 6:06 ` MengEn Sun
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2024-10-12 22:43 UTC (permalink / raw)
To: alexjlzheng; +Cc: linux-mm, linux-kernel, alexjlzheng, MengEn Sun
On Fri, 11 Oct 2024 18:36:10 +0800 alexjlzheng@gmail.com wrote:
> Subject: [PATCH] mm: make pcp decay work with onhz
"NOHZ".
> Date: Fri, 11 Oct 2024 18:36:10 +0800
> X-Mailer: git-send-email 2.39.3
>
> From: MengEn Sun <mengensun@tencent.com>
>
> when a cpu stops tick, quiet_vmstat may flush all the per cpu
> statistics counter.
>
> while, the shepherd is needed those counters to kick the
> vmstat_work.
>
> when a cpu in nohz with a lot of pcp pages, and do not do page
> allocating and freeing. the pcp pages of the cpu may not be hold
> for a long time
>
> we make shepherd keep a eye on the pcp high_min and high_max
I can see what you're saying here, but it's hard to understand. Please
spend a little time clarifying the text? And please start sentences
with a capital letter!
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -2024,8 +2024,13 @@ static bool need_update(int cpu)
>
> for_each_populated_zone(zone) {
> struct per_cpu_zonestat *pzstats = per_cpu_ptr(zone->per_cpu_zonestats, cpu);
> + struct per_cpu_pages *pcp = per_cpu_ptr(zone->per_cpu_pageset, cpu);
> struct per_cpu_nodestat *n;
>
> + /* in onhz or nohz full make pcp decay work */
"NOHZ".
> + if (pcp->high_max > pcp->high_min)
> + return true;
> +
> /*
> * The fast way of checking if there are any vmstat diffs.
> */
> --
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] mm: make pcp decay work with onhz
2024-10-12 22:43 ` Andrew Morton
@ 2024-10-18 6:06 ` MengEn Sun
0 siblings, 0 replies; 3+ messages in thread
From: MengEn Sun @ 2024-10-18 6:06 UTC (permalink / raw)
To: akpm; +Cc: alexjlzheng, alexjlzheng, linux-kernel, linux-mm, mengensun
On Sat, 12 Oct 2024 15:43:28 -0700 akpm@linux-foundation.org wrote:
> On Fri, 11 Oct 2024 18:36:10 +0800 alexjlzheng@gmail.com wrote:
>
> > Subject: [PATCH] mm: make pcp decay work with onhz
>
> "NOHZ".
>
> > Date: Fri, 11 Oct 2024 18:36:10 +0800
> > X-Mailer: git-send-email 2.39.3
> >
> > From: MengEn Sun <mengensun@tencent.com>
> >
> > when a cpu stops tick, quiet_vmstat may flush all the per cpu
> > statistics counter.
> >
> > while, the shepherd is needed those counters to kick the
> > vmstat_work.
> >
> > when a cpu in nohz with a lot of pcp pages, and do not do page
> > allocating and freeing. the pcp pages of the cpu may not be hold
> > for a long time
> >
> > we make shepherd keep a eye on the pcp high_min and high_max
>
> I can see what you're saying here, but it's hard to understand. Please
> spend a little time clarifying the text? And please start sentences
> with a capital letter!
Thank you for your suggestion
I will create a v2 version, and make text clarifyed
>
> > --- a/mm/vmstat.c
> > +++ b/mm/vmstat.c
> > @@ -2024,8 +2024,13 @@ static bool need_update(int cpu)
> >
> > for_each_populated_zone(zone) {
> > struct per_cpu_zonestat *pzstats = per_cpu_ptr(zone->per_cpu_zonestats, cpu);
> > + struct per_cpu_pages *pcp = per_cpu_ptr(zone->per_cpu_pageset, cpu);
> > struct per_cpu_nodestat *n;
> >
> > + /* in onhz or nohz full make pcp decay work */
>
> "NOHZ".
>
> > + if (pcp->high_max > pcp->high_min)
> > + return true;
> > +
> > /*
> > * The fast way of checking if there are any vmstat diffs.
> > */
> > --
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-18 6:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-11 10:36 [PATCH] mm: make pcp decay work with onhz alexjlzheng
2024-10-12 22:43 ` Andrew Morton
2024-10-18 6:06 ` MengEn Sun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox