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]
Date:   Tue, 3 May 2022 16:17:02 -0300
From:   Marcelo Tosatti <mtosatti@...hat.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, Nitesh Lal <nilal@...hat.com>,
        Nicolas Saenz Julienne <nsaenzju@...hat.com>,
        Frederic Weisbecker <frederic@...nel.org>,
        Christoph Lameter <cl@...ux.com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Alex Belits <abelits@...its.com>, Peter Xu <peterx@...hat.com>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Oscar Shiang <oscar0225@...email.tw>
Subject: Re: [patch v12 12/13] mm: vmstat_refresh: avoid queueing work item
 if cpu stats are clean

On Wed, Apr 27, 2022 at 09:23:06AM +0200, Thomas Gleixner wrote:
> On Tue, Mar 15 2022 at 12:31, Marcelo Tosatti wrote:
> >  	/*
> >  	 * The regular update, every sysctl_stat_interval, may come later
> > @@ -1948,9 +1977,19 @@ int vmstat_refresh(struct ctl_table *tab
> >  	 * transiently negative values, report an error here if any of
> >  	 * the stats is negative, so we know to go looking for imbalance.
> >  	 */
> > -	err = schedule_on_each_cpu(refresh_vm_stats);
> > -	if (err)
> > -		return err;
> > +	cpus_read_lock();
> > +	for_each_online_cpu(cpu) {
> > +		struct work_struct *work = per_cpu_ptr(works, cpu);
> > +
> > +		INIT_WORK(work, refresh_vm_stats);
> > +		if (need_update(cpu) || need_drain_remote_zones(cpu))
> 
> Of course that makes sense in general, but now you have two ways of
> deciding whether updating this is required.
> 
>    1) The above
> 
>    2) The per CPU boolean which tells whether vmstats are dirty or not.
> 
> Can we have a third method perhaps?

Ok, will think of a third method to increase clarity :-)

By the fourth method it will be clear for sure!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ