sched/psi: Fix possible missing or delayed pending event
authorHao Lee <haolee.swjtu@gmail.com>
Mon, 19 Sep 2022 07:23:56 +0000 (07:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:31:55 +0000 (13:31 +0100)
commit44de1adb24841511c82386fe4e3892954d1ccf3b
tree930238b1f784008ad7fcdccf7a9bbe878472727c
parent3878f601e14c344f06b797bec97ba6b0e96627e0
sched/psi: Fix possible missing or delayed pending event

[ Upstream commit e38f89af6a13e895805febd3a329a13ab7e66fa4 ]

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 e6df4ead85d9 ("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: e6df4ead85d9 ("psi: fix possible trigger missing in the window")
Signed-off-by: Hao Lee <haolee.swjtu@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Suren Baghdasaryan <surenb@google.com>
Link: https://lore.kernel.org/r/20220919072356.GA29069@haolee.io
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/sched/psi.c