Skip to content

Commit e38f89a

Browse files
hao-leePeter Zijlstra
authored andcommitted
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 e6df4ea ("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: e6df4ea ("psi: fix possible trigger missing in the window") Signed-off-by: Hao Lee <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Suren Baghdasaryan <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 851a723 commit e38f89a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

kernel/sched/psi.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,12 @@ static u64 update_triggers(struct psi_group *group, u64 now)
539539

540540
/* Calculate growth since last update */
541541
growth = window_update(&t->win, now, total[t->state]);
542-
if (growth < t->threshold)
543-
continue;
542+
if (!t->pending_event) {
543+
if (growth < t->threshold)
544+
continue;
544545

545-
t->pending_event = true;
546+
t->pending_event = true;
547+
}
546548
}
547549
/* Limit event signaling to once per window */
548550
if (now < t->last_event_time + t->win.size)

0 commit comments

Comments
 (0)