Re: [PATCH v3 12/17] sched: Adapt sched tracepoints for RV task model
From: Gabriele Monaco <gmonaco@redhat.com>
Date: 2025-07-16 15:09:50
Also in:
lkml
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:quoted
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 switchquoted
@@ -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