psi: fix possible trigger missing in the window
authorZhaoyang Huang <zhaoyang.huang@unisoc.com>
Tue, 25 Jan 2022 06:56:58 +0000 (14:56 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 16 Feb 2022 14:57:54 +0000 (15:57 +0100)
commite6df4ead85d9da1b07dd40bd4c6d2182f3e210c4
tree1af29301a0595cc3d539c7927b31d41e6a5812ce
parent5c7b1aaf139dab5072311853bacc40fc3457d1f9
psi: fix possible trigger missing in the window

When a new threshold breaching stall happens after a psi event was
generated and within the window duration, the new event is not
generated because the events are rate-limited to one per window. If
after that no new stall is recorded then the event will not be
generated even after rate-limiting duration has passed. This is
happening because with no new stall, window_update will not be called
even though threshold was previously breached. To fix this, record
threshold breaching occurrence and generate the event once window
duration is passed.

Suggested-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Suren Baghdasaryan <surenb@google.com>
Link: https://lore.kernel.org/r/1643093818-19835-1-git-send-email-huangzhaoyang@gmail.com
include/linux/psi_types.h
kernel/sched/psi.c