Skip to contentSkip to conversation

mm/vmstat.c: erase latency in vmstat_shepherd

PATCH Applied Jiang Biao 1 participant 1 message Jan 11, 2021

Subsystems (2)
lore
Share & tools
lore

Jiang Biao

author
#0 lore raw

PATCH 1/1 mm/vmstat.c: erase latency in vmstat_shepherd

From: Jiang Biao <[email protected]>

Many 100us+ latencies have been deteceted in vmstat_shepherd() on CPX platform which has 208 logic cpus. And vmstat_shepherd is queued every second, which could make the case worse.

Add schedule point in vmstat_shepherd() to erase the latency.

---
 mm/vmstat.c | 2 ++
 1 file changed, 2 insertions(+)
mm/vmstat.c +2 -0
index f8942160fc95..b538199883b5 100644
@@ -1953,6 +1953,8 @@ static void vmstat_shepherd(struct work_struct *w)
 
 		if (!delayed_work_pending(dw) && need_update(cpu))
 			queue_delayed_work_on(cpu, mm_percpu_wq, dw, 0);
+
+		cond_resched();
 	}
 	put_online_cpus();
 
Signature · 1 line
2.21.0