lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zu083vRBZRwvvVz5@csail.mit.edu>
Date: Fri, 20 Sep 2024 09:14:06 +0000
From: "Srivatsa S. Bhat" <srivatsa@...il.mit.edu>
To: Anshuman Khandual <anshuman.khandual@....com>
Cc: Saurabh Sengar <ssengar@...ux.microsoft.com>, akpm@...ux-foundation.org,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	ssengar@...rosoft.com, wei.liu@...nel.org
Subject: Re: [PATCH v2] mm/vmstat: Defer the refresh_zone_stat_thresholds
 after all CPUs bringup


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ