lkml.org 
[lkml]   [2022]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch v12 12/13] mm: vmstat_refresh: avoid queueing work item if cpu stats are clean
Date
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?

Thanks,

tglx

\
 
 \ /
  Last update: 2022-04-27 09:24    [W:0.506 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site