[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJuCfpH3mzLi4bhaLUYLDDXA6uVM5Pn67aXyPefseEsAYDatSA@mail.gmail.com>
Date: Fri, 1 Apr 2022 09:19:17 -0700
From: Suren Baghdasaryan <surenb@...gle.com>
To: Hailong Liu <liuhailong@...ux.alibaba.com>
Cc: Johannes Weiner <hannes@...xchg.org>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
aniel Bristot de Oliveira <bristot@...hat.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] psi: Fix trigger being fired unexpectedly at initial
On Thu, Mar 31, 2022 at 10:10 PM Hailong Liu
<liuhailong@...ux.alibaba.com> wrote:
>
> When a trigger being created, its win.start_value and win.start_time are
> reset to zero. If group->total[PSI_POLL][t->state] has accumulated before,
> this trigger will be fired unexpectedly in the next period, even if its
> growth time does not reach its threshold.
>
> So set the window of the new trigger to the current state value.
Makes sense to me. Thanks!
>
> Signed-off-by: Hailong Liu <liuhailong@...ux.alibaba.com>
Acked-by: Suren Baghdasaryan <surenb@...gle.com>
> ---
> kernel/sched/psi.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
> index a4fa3aadfcba..5a49a8c8783e 100644
> --- a/kernel/sched/psi.c
> +++ b/kernel/sched/psi.c
> @@ -1117,7 +1117,8 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group,
> t->state = state;
> t->threshold = threshold_us * NSEC_PER_USEC;
> t->win.size = window_us * NSEC_PER_USEC;
> - window_reset(&t->win, 0, 0, 0);
> + window_reset(&t->win, sched_clock(),
> + group->total[PSI_POLL][t->state], 0);
>
> t->event = 0;
> t->last_event_time = 0;
> --
> 2.19.1.6.gb485710b
>
Powered by blists - more mailing lists