===================================================================
@@ -29,6 +29,7 @@
#include <linux/page_ext.h>
#include <linux/page_owner.h>
#include <linux/migrate.h>
+#include <linux/tick.h>
#include "internal.h"
@@ -1973,19 +1974,27 @@ static void vmstat_update(struct work_st
*/
void quiet_vmstat(void)
{
+ struct delayed_work *dw;
+
if (system_state != SYSTEM_RUNNING)
return;
if (!__this_cpu_read(vmstat_dirty))
return;
+ refresh_cpu_vm_stats(false);
+
/*
- * Just refresh counters and do not care about the pending delayed
- * vmstat_update. It doesn't fire that often to matter and canceling
- * it would be too expensive from this path.
- * vmstat_shepherd will take care about that for us.
+ * If the tick is stopped, cancel any delayed work to avoid
+ * interruptions to this CPU in the future.
+ *
+ * Otherwise just refresh counters and do not care about the pending
+ * delayed vmstat_update. It doesn't fire that often to matter
+ * and canceling it would be too expensive from this path.
*/
- refresh_cpu_vm_stats(false);
+ dw = &per_cpu(vmstat_work, smp_processor_id());
+ if (delayed_work_pending(dw) && tick_nohz_tick_stopped())
+ cancel_delayed_work(dw);
}
/*
@@ -2007,6 +2016,9 @@ static void vmstat_shepherd(struct work_
for_each_online_cpu(cpu) {
struct delayed_work *dw = &per_cpu(vmstat_work, cpu);
+ if (tick_nohz_tick_stopped_cpu(cpu))
+ continue;
+
if (!delayed_work_pending(dw) && per_cpu(vmstat_dirty, cpu))
queue_delayed_work_on(cpu, mm_percpu_wq, dw, 0);
===================================================================
@@ -905,9 +905,6 @@ static void tick_nohz_stop_tick(struct t
ts->do_timer_last = 0;
}
- /* Attempt to fold when the idle tick is stopped or not */
- quiet_vmstat();
-
/* Skip reprogram of event if its not changed */
if (ts->tick_stopped && (expires == ts->next_tick)) {
/* Sanity check: make sure clockevent is actually programmed */
@@ -935,6 +932,9 @@ static void tick_nohz_stop_tick(struct t
trace_tick_stop(1, TICK_DEP_MASK_NONE);
}
+ /* Attempt to fold when the idle tick is stopped or not */
+ quiet_vmstat();
+
ts->next_tick = tick;
/*