public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] psi: fix possible missing or delayed pending event
@ 2022-09-14  9:29 Hao Lee
  2022-09-17  6:08 ` Suren Baghdasaryan
  0 siblings, 1 reply; 7+ messages in thread
From: Hao Lee @ 2022-09-14  9:29 UTC (permalink / raw)
  To: hannes; +Cc: surenb, peterz, zhaoyang.huang, haolee.swjtu, linux-kernel

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. This patch fixes the possible pending-event
missing or delay.

Fixes: e6df4ead85d9 ("psi: fix possible trigger missing in the window")
Signed-off-by: Hao Lee <haolee.swjtu@gmail.com>
---
 kernel/sched/psi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 9711827e3..0bae4ee2b 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -539,7 +539,7 @@ 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)
+			if (growth < t->threshold && !t->pending_event)
 				continue;
 
 			t->pending_event = true;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-19  7:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-14  9:29 [PATCH] psi: fix possible missing or delayed pending event Hao Lee
2022-09-17  6:08 ` Suren Baghdasaryan
2022-09-17  7:31   ` Hao Lee
2022-09-18  4:44     ` Suren Baghdasaryan
2022-09-18 10:55       ` Hao Lee
2022-09-19  5:16         ` Suren Baghdasaryan
2022-09-19  7:10           ` Hao Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox