Skip to content

Commit

Permalink
mm: align vmstat_work's timer
Browse files Browse the repository at this point in the history
Even though vmstat_work is marked deferrable, there are still benefits to
aligning it.  For certain applications we want to keep OS jitter as low as
possible and aligning timers and work so they occur together can reduce
their overall impact.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
antonblanchard authored and torvalds committed Apr 3, 2009
1 parent d2caa3c commit 98f4ebb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mm/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,15 +891,16 @@ static void vmstat_update(struct work_struct *w)
{
refresh_cpu_vm_stats(smp_processor_id());
schedule_delayed_work(&__get_cpu_var(vmstat_work),
sysctl_stat_interval);
round_jiffies_relative(sysctl_stat_interval));
}

static void __cpuinit start_cpu_timer(int cpu)
{
struct delayed_work *vmstat_work = &per_cpu(vmstat_work, cpu);

INIT_DELAYED_WORK_DEFERRABLE(vmstat_work, vmstat_update);
schedule_delayed_work_on(cpu, vmstat_work, HZ + cpu);
schedule_delayed_work_on(cpu, vmstat_work,
__round_jiffies_relative(HZ, cpu));
}

/*
Expand Down

0 comments on commit 98f4ebb

Please sign in to comment.