From: Christoph Lameter Date: Wed, 11 Feb 2015 23:28:36 +0000 (-0800) Subject: vmstat: Reduce time interval to stat update on idle cpu X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=57c2e36b6f4dd52e7e90f4c748a665b13fa228d2;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git vmstat: Reduce time interval to stat update on idle cpu 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 Acked-by: Michal Hocko Cc: Vinayak Menon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/vmstat.c b/mm/vmstat.c index 470cdd5b924b..4f5cd974e11a 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -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();