[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241009133328.23fc671c@gandalf.local.home>
Date: Wed, 9 Oct 2024 13:33:28 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Ankur Arora <ankur.a.arora@...cle.com>
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
linux-trace-kernel@...r.kernel.org, linux-kernel@...r.kernel.org, Peter
Zijlstra <peterz@...radead.org>, tglx@...utronix.de, mingo@...nel.org,
juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, bsegall@...gle.com, mgorman@...e.de,
vschneid@...hat.com, efault@....de, Masami Hiramatsu <mhiramat@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH 2/3] tracing: Record task flag NEED_RESCHED_LAZY.
On Wed, 09 Oct 2024 10:30:28 -0700
Ankur Arora <ankur.a.arora@...cle.com> wrote:
> > +++ b/kernel/trace/trace.c
> > @@ -2544,6 +2544,8 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status)
> > trace_flags |= TRACE_FLAG_NEED_RESCHED;
> > if (test_preempt_need_resched())
> > trace_flags |= TRACE_FLAG_PREEMPT_RESCHED;
> > + if (tif_test_bit(TIF_NEED_RESCHED_LAZY))
>
> TIF_NEED_RESCHED_LAZY falls back to TIF_NEED_RESCHED without
> CONFIG_ARCH_HAS_PREEMPT_LAZY. So, you might need to add an explicit
> check for that as well.
>
> With that,
> Reviewed-by: Ankur Arora <ankur.a.arora@...cle.com>
>
> Ankur
>
So this should be:
if (IS_ENABLED(CONFIG_ARCH_HAS_PREEMPT_LAZY) &&
tif_test_bit(TIF_NEED_RESCHED_LAZY))
?
-- Steve
> > + trace_flags |= TRACE_FLAG_NEED_RESCHED_LAZY;
> > return (trace_flags << 16) | (min_t(unsigned int, pc & 0xff, 0xf)) |
> > (min_t(unsigned int, migration_disable_value(), 0xf)) << 4;
> > }
> > diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
> > index 829daa0764dd9..23ca2155306b1 100644
> > --- a/kernel/trace/trace_output.c
> > +++ b/kernel/trace/trace_output.c
> > @@ -463,17 +463,29 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
> > !IS_ENABLED(CONFIG_TRACE_IRQFLAGS_SUPPORT) ? 'X' :
> > '.';
> >
> > - switch (entry->flags & (TRACE_FLAG_NEED_RESCHED |
> > + switch (entry->flags & (TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_NEED_RESCHED_LAZY |
> > TRACE_FLAG_PREEMPT_RESCHED)) {
> > + case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_NEED_RESCHED_LAZY | TRACE_FLAG_PREEMPT_RESCHED:
> > + need_resched = 'B';
> > + break;
> > case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_PREEMPT_RESCHED:
> > need_resched = 'N';
> > break;
> > + case TRACE_FLAG_NEED_RESCHED_LAZY | TRACE_FLAG_PREEMPT_RESCHED:
> > + need_resched = 'L';
> > + break;
> > + case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_NEED_RESCHED_LAZY:
> > + need_resched = 'b';
> > + break;
> > case TRACE_FLAG_NEED_RESCHED:
> > need_resched = 'n';
> > break;
> > case TRACE_FLAG_PREEMPT_RESCHED:
> > need_resched = 'p';
> > break;
> > + case TRACE_FLAG_NEED_RESCHED_LAZY:
> > + need_resched = 'l';
> > + break;
> > default:
> > need_resched = '.';
> > break;
Powered by blists - more mailing lists