lkml.org 
[lkml]   [2022]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] psi: fix possible missing or delayed pending event
On Mon, Sep 19, 2022 at 12:23 AM Hao Lee <haolee.swjtu@gmail.com> wrote:
>
> 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>

Acked-by: Suren Baghdasaryan <surenb@google.com>

Thanks!

> ---
> kernel/sched/psi.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
> index 9711827e3..7d305d0e0 100644
> --- a/kernel/sched/psi.c
> +++ b/kernel/sched/psi.c
> @@ -539,10 +539,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)
> --
> 2.21.0
>

\
 
 \ /
  Last update: 2022-09-22 07:19    [W:0.109 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site