[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAB8ipk_wAg5UWDyjNV8MYQu6FRocw9sD7YM4rnBs_Ee6yupNWw@mail.gmail.com>
Date: Fri, 15 Aug 2025 14:54:52 +0800
From: Xuewen Yan <xuewen.yan94@...il.com>
To: Johannes Weiner <hannes@...xchg.org>
Cc: Xuewen Yan <xuewen.yan@...soc.com>, rostedt@...dmis.org, surenb@...gle.com,
peterz@...radead.org, mingo@...hat.com, mhiramat@...nel.org,
mathieu.desnoyers@...icios.com, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com, bsegall@...gle.com,
andrii@...nel.org, vschneid@...hat.com, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, yuming.han@...soc.com, ke.wang@...soc.com
Subject: Re: [RFC PATCH] sched: psi: Add psi events trace point
Hi Johannes,
Thanks for the reply:)
On Thu, Aug 14, 2025 at 9:55 PM Johannes Weiner <hannes@...xchg.org> wrote:
>
> On Thu, Aug 14, 2025 at 03:07:19PM +0800, Xuewen Yan wrote:
> > Add trace point to psi triggers. This is useful to
> > observe the psi events in the kernel space.
> >
> > Signed-off-by: Xuewen Yan <xuewen.yan@...soc.com>
>
> Can you elaborate on a situation in which you would use this?
In the Android system, lmkd will kill processes by monitoring the
pressure of psi,
but lmkd may enter the UN state for some reasons, and be unable to
kill the process in time, resulting in OOM.
This hook can be used to detect psi just like lmkd, if lmkd was blocked,
the kernel could kill processes to avoid the occurrence of OOM.
Thanks!
BR
>
> > ---
> > include/trace/events/sched.h | 5 +++++
> > kernel/sched/psi.c | 2 ++
> > 2 files changed, 7 insertions(+)
> >
> > diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
> > index 7b2645b50e78..c23cb2bc76fd 100644
> > --- a/include/trace/events/sched.h
> > +++ b/include/trace/events/sched.h
> > @@ -896,6 +896,11 @@ DECLARE_TRACE(sched_set_need_resched,
> > TP_PROTO(struct task_struct *tsk, int cpu, int tif),
> > TP_ARGS(tsk, cpu, tif));
> >
> > +struct psi_trigger *t
>
> Missing ;
sorry for missing this, would add it later...
>
> > +DECLARE_TRACE(psi_event,
> > + TP_PROTO(struct psi_trigger *t),
> > + TP_ARGS(t));
> > +
> > #endif /* _TRACE_SCHED_H */
> >
> > /* This part must be outside protection */
Powered by blists - more mailing lists