提交 e38f89af 编写于 作者: H Hao Lee 提交者: Peter Zijlstra

sched/psi: Fix possible missing or delayed pending event

When a pending event exists and growth is less than the threshold, the
current logic is to skip this trigger without generating event. However,
from e6df4ead ("psi: fix possible trigger missing in the window"),
our purpose is to generate event as long as pending event exists and the
rate meets the limit, no matter what growth is.
This patch handles this case properly.

Fixes: e6df4ead ("psi: fix possible trigger missing in the window")
Signed-off-by: NHao Lee <haolee.swjtu@gmail.com>
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: NSuren Baghdasaryan <surenb@google.com>
Link: https://lore.kernel.org/r/20220919072356.GA29069@haolee.io
上级 851a723e
...@@ -539,10 +539,12 @@ static u64 update_triggers(struct psi_group *group, u64 now) ...@@ -539,10 +539,12 @@ static u64 update_triggers(struct psi_group *group, u64 now)
/* Calculate growth since last update */ /* Calculate growth since last update */
growth = window_update(&t->win, now, total[t->state]); growth = window_update(&t->win, now, total[t->state]);
if (growth < t->threshold) if (!t->pending_event) {
continue; if (growth < t->threshold)
continue;
t->pending_event = true; t->pending_event = true;
}
} }
/* Limit event signaling to once per window */ /* Limit event signaling to once per window */
if (now < t->last_event_time + t->win.size) if (now < t->last_event_time + t->win.size)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册