Re: [RFC PATCH 14/17] sched: Add deadline tracepoints
From: Juri Lelli <juri.lelli@redhat.com>
Date: 2025-08-19 14:02:13
Also in:
lkml
On 19/08/25 12:34, Gabriele Monaco wrote:
On Tue, 2025-08-19 at 12:12 +0200, Peter Zijlstra wrote:quoted
On Tue, Aug 19, 2025 at 11:56:57AM +0200, Juri Lelli wrote:quoted
Hi! On 14/08/25 17:08, Gabriele Monaco wrote:
...
quoted
quoted
quoted
@@ -1482,6 +1486,7 @@ static void update_curr_dl_se(struct rq*rq, struct sched_dl_entity *dl_se, s64 throttle: if (dl_runtime_exceeded(dl_se) || dl_se->dl_yielded) { + trace_sched_dl_throttle_tp(dl_se); dl_se->dl_throttled = 1;I believe we also need to trace the dl_check_constrained_dl() throttle, please take a look.Probably yes, strangely I couldn't see failures without it, but it may be down to my test setup. I'm going to have a look.
Not sure if you tested with constrained (deadline != period) tasks.
quoted
quoted
Also - we discussed this point a little already offline - but I still wonder if we have to do anything special for dl-server defer. Those entities are started as throttled until 0-lag, so maybe we should still trace them explicitly as so?The naming might need a bit of a consistency check here, but for the monitor, the server is running, armed or preempted. Before the 0-lag, it will never be running, so it will stay as armed (fair tasks running) or preempted (rt tasks running). armed and preempted have the _throttled version just to indicate an explicit throttle event occurred. We might want to start it in the armed_throttled if we are really guaranteed not to see a throttle event, but I think that would complicate the model considerably. We could instead validate the 0-lag concept in a separate, server- specific model. Does this initial model feel particularly wrong for the server case?
No it doesn't atm. :-) Thanks for the additional information.
quoted
quoted
In addition, since it's related, maybe we should do something about sched_switch event, that is currently not aware of deadlines, runtimes, etc.I'm not sure I follow you here, what relation with switch and runtime/deadline should we enforce? We don't really force the switch to occur timely after throttling, is that what you mean? Or a switch must occur again timely after replenishing?
Hummm, yeah I was wondering if we need something along these lines, but we can also maybe leave it for the future.
quoted
As per the whole _tp() thing, you can attach to the actual sched_switch tracepoint with a module and read whatever you want.Yeah I believe Juri referred to model constraints on the already existing events rather than new tracepoints here.
Separately from this series, maybe we should put such a module/bpf thing somewhere shared, so it's easier to use it when needed.