From: "Srivatsa S. Bhat" <srivatsa@csail.mit.edu>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Saurabh Sengar <ssengar@linux.microsoft.com>,
akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, ssengar@microsoft.com,
wei.liu@kernel.org
Subject: Re: [PATCH v2] mm/vmstat: Defer the refresh_zone_stat_thresholds after all CPUs bringup
Date: Fri, 20 Sep 2024 09:14:06 +0000 [thread overview]
Message-ID: <Zu083vRBZRwvvVz5@csail.mit.edu> (raw)
In-Reply-To: <b1dc2aa1-cd38-4f1f-89e9-6d009a619541@arm.com>
Hey Anshuman,
Long time... :-) Hope you are doing great!
On Fri, Sep 20, 2024 at 12:28:44PM +0530, Anshuman Khandual wrote:
[...]
> > @@ -1908,6 +1908,7 @@ static const struct seq_operations vmstat_op = {
> > #ifdef CONFIG_SMP
> > static DEFINE_PER_CPU(struct delayed_work, vmstat_work);
> > int sysctl_stat_interval __read_mostly = HZ;
> > +static int vmstat_late_init_done;
> >
> > #ifdef CONFIG_PROC_FS
> > static void refresh_vm_stats(struct work_struct *work)
> > @@ -2110,7 +2111,8 @@ static void __init init_cpu_node_state(void)
> >
> > static int vmstat_cpu_online(unsigned int cpu)
> > {
> > - refresh_zone_stat_thresholds();
> > + if (vmstat_late_init_done)
> > + refresh_zone_stat_thresholds();
> >
> > if (!node_state(cpu_to_node(cpu), N_CPU)) {
> > node_set_state(cpu_to_node(cpu), N_CPU);
> > @@ -2142,6 +2144,14 @@ static int vmstat_cpu_dead(unsigned int cpu)
> > return 0;
> > }
> >
> > +static int __init vmstat_late_init(void)
> > +{
> > + refresh_zone_stat_thresholds();
> > + vmstat_late_init_done = 1;
> > +
> > + return 0;
> > +}
> > +late_initcall(vmstat_late_init);> #endif
> >
> > struct workqueue_struct *mm_percpu_wq;
>
> late_initcall() triggered vmstat_late_init() guaranteed to be called
> before the last call into vmstat_cpu_online() during a normal boot ?
> Otherwise refresh_zone_stat_thresholds() will never be called unless
> there is a CPU online event later.
The vmstat_late_init() function itself calls
refresh_zone_stat_thresholds(). So, we don't need another CPU online
event to happen later just to invoke refresh_zone_stat_thresholds().
Does that address your concern?
Regards,
Srivatsa
Microsoft Linux Systems Group
prev parent reply other threads:[~2024-09-20 9:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-12 6:13 Saurabh Sengar
2024-08-23 9:30 ` Saurabh Singh Sengar
2024-08-23 9:32 ` Saurabh Singh Sengar
2024-09-19 19:52 ` Saurabh Singh Sengar
2024-09-20 8:16 ` Andrew Morton
2024-09-20 9:25 ` Srivatsa S. Bhat
2024-09-23 20:17 ` Christoph Lameter (Ampere)
2024-09-24 2:56 ` Srivatsa S. Bhat
2024-09-24 7:40 ` Saurabh Singh Sengar
2024-09-24 7:39 ` Saurabh Singh Sengar
2024-09-20 6:58 ` Anshuman Khandual
2024-09-20 9:14 ` Srivatsa S. Bhat [this message]
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=Zu083vRBZRwvvVz5@csail.mit.edu \
--to=srivatsa@csail.mit.edu \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ssengar@linux.microsoft.com \
--cc=ssengar@microsoft.com \
--cc=wei.liu@kernel.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