[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cbb840b204f7de7e6304bc811e9c629eb0f77486.camel@redhat.com>
Date: Wed, 16 Jul 2025 17:09:43 +0200
From: Gabriele Monaco <gmonaco@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>, Steven
Rostedt <rostedt@...dmis.org>, Masami Hiramatsu <mhiramat@...nel.org>,
linux-trace-kernel@...r.kernel.org, Nam Cao <namcao@...utronix.de>, Tomas
Glozar <tglozar@...hat.com>, Juri Lelli <jlelli@...hat.com>, Clark
Williams <williams@...hat.com>, John Kacur <jkacur@...hat.com>
Subject: Re: [PATCH v3 12/17] sched: Adapt sched tracepoints for RV task
model
On Wed, 2025-07-16 at 14:38 +0200, Peter Zijlstra wrote:
> On Tue, Jul 15, 2025 at 09:14:29AM +0200, Gabriele Monaco wrote:
> > Add the following tracepoints:
> > * sched_set_need_resched(tsk, cpu, tif)
> > Called when a task is set the need resched [lazy] flag
> > * sched_switch_vain(preempt, tsk, tsk_state)
> > Called when a task is selected again during __schedule
> > i.e. prev == next == tsk : no real context switch
>
> > @@ -6592,6 +6598,7 @@ static bool try_to_block_task(struct rq *rq,
> > struct task_struct *p,
> > int flags = DEQUEUE_NOCLOCK;
> >
> > if (signal_pending_state(task_state, p)) {
> > + trace_sched_set_state_tp(p, TASK_RUNNING, true);
> > WRITE_ONCE(p->__state, TASK_RUNNING);
> > *task_state_p = TASK_RUNNING;
> > return false;
>
> I'm confused on the purpose of this. How does this relate to say the
> wakeup in signal_wake_up_state() ?
Also this adds more context: models like sssw (in this series) expect
that, after a task is set to sleepable, it either goes to sleep or is
woken up/set to runnable.
In this specific case, the task is set to runnable without tracing it,
so the model doesn't know what happened, since it may not see a wakeup
after that (the task is already runnable).
Now I'm not sure if there are other events that we are guaranteed to
see to reconstruct this specific case (at some point we should see the
signal, I assume).
This just simplified things as that is the only state change that was
not traced.
Am I missing anything obvious here?
Thanks,
Gabriele
Powered by blists - more mailing lists