Skip to content

Commit

Permalink
vmstat: Reduce time interval to stat update on idle cpu
Browse files Browse the repository at this point in the history
It was noted that the vm stat shepherd runs every 2 seconds and that the
vmstat update is then scheduled 2 seconds in the future.

This yields an interval of double the time interval which is not desired.

Change the shepherd so that it does not delay the vmstat update on the
other cpu.  We stil have to use schedule_delayed_work since we are using a
delayed_work_struct but we can set the delay to 0.

Signed-off-by: Christoph Lameter <cl@linux.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Christoph Lameter authored and torvalds committed Feb 12, 2015
1 parent 94f759d commit 57c2e36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1437,8 +1437,8 @@ static void vmstat_shepherd(struct work_struct *w)
if (need_update(cpu) &&
cpumask_test_and_clear_cpu(cpu, cpu_stat_off))

schedule_delayed_work_on(cpu, &per_cpu(vmstat_work, cpu),
__round_jiffies_relative(sysctl_stat_interval, cpu));
schedule_delayed_work_on(cpu,
&per_cpu(vmstat_work, cpu), 0);

put_online_cpus();

Expand Down

0 comments on commit 57c2e36

Please sign in to comment.