This is a note to let you know that I've just added the patch titled sched/psi: Fix possible missing or delayed pending event to the 6.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: sched-psi-fix-possible-missing-or-delayed-pending-ev.patch and it can be found in the queue-6.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 2edf35859c58e5cb34ac63eac152912be79e0389 Author: Hao Lee <haolee.swjtu@xxxxxxxxx> Date: Mon Sep 19 07:23:56 2022 +0000 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@xxxxxxxxx> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx> Acked-by: Suren Baghdasaryan <surenb@xxxxxxxxxx> Link: https://lore.kernel.org/r/20220919072356.GA29069@xxxxxxxxx Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index ecb4b4ff4ce0..559416a27c0e 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -537,10 +537,12 @@ static u64 update_triggers(struct psi_group *group, u64 now) /* Calculate growth since last update */ growth = window_update(&t->win, now, total[t->state]); - if (growth < t->threshold) - continue; + if (!t->pending_event) { + if (growth < t->threshold) + continue; - t->pending_event = true; + t->pending_event = true; + } } /* Limit event signaling to once per window */ if (now < t->last_event_time + t->win.size)