linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xuewen Yan <xuewen.yan94@gmail.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Xuewen Yan <xuewen.yan@unisoc.com>,
	rostedt@goodmis.org, surenb@google.com,  peterz@infradead.org,
	mingo@redhat.com, mhiramat@kernel.org,
	 mathieu.desnoyers@efficios.com, juri.lelli@redhat.com,
	 vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	bsegall@google.com,  andrii@kernel.org, vschneid@redhat.com,
	linux-kernel@vger.kernel.org,
	 linux-trace-kernel@vger.kernel.org, yuming.han@unisoc.com,
	ke.wang@unisoc.com
Subject: Re: [RFC PATCH] sched: psi: Add psi events trace point
Date: Fri, 15 Aug 2025 14:54:52 +0800	[thread overview]
Message-ID: <CAB8ipk_wAg5UWDyjNV8MYQu6FRocw9sD7YM4rnBs_Ee6yupNWw@mail.gmail.com> (raw)
In-Reply-To: <20250814135501.GD115258@cmpxchg.org>

Hi Johannes,

Thanks for the reply:)

On Thu, Aug 14, 2025 at 9:55 PM Johannes Weiner <hannes@cmpxchg.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@unisoc.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 */

      reply	other threads:[~2025-08-15  6:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14  7:07 [RFC PATCH] sched: psi: Add psi events trace point Xuewen Yan
2025-08-14 13:55 ` Johannes Weiner
2025-08-15  6:54   ` Xuewen Yan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAB8ipk_wAg5UWDyjNV8MYQu6FRocw9sD7YM4rnBs_Ee6yupNWw@mail.gmail.com \
    --to=xuewen.yan94@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=juri.lelli@redhat.com \
    --cc=ke.wang@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=surenb@google.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=xuewen.yan@unisoc.com \
    --cc=yuming.han@unisoc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).