Re: [PATCH v5 15/29] sched/deadline: Rebuild the root domains' accounting from the task list
From: Mathieu Desnoyers
Date: Fri Nov 13 2026 - 14:31:15 EST
Hi Juri,
The new walk drops the per-task pi_lock that dominated the old cost, so
the approach might be OK, but since this is Cc: stable and will
eventually reach Android, maybe someone from there can confirm before we
pull the trigger?
Alternatively, a single global "any deadline task exist" bail would keep
suspend/resume free for the no-DL case without reintroducing any
per-cpuset bookkeeping to drift?
You are right: the walk costs too much with no deadline task. I
measured it.
The test runs in a 64-vCPU guest with no debug options and no deadline
task. A process holds N sleeping threads. A partition root is made and
removed, and each change rebuilds the accounting. The time of one
rebuild with this patch, in testing:
threads one rebuild
0 0.04 to 0.08 ms
1000 0.12 to 0.17 ms
10000 0.7 to 1.2 ms
30000 2.3 ms
The first three lines are from three runs, the last from one. Upstream
returns early for a cpuset with no deadline task, so its rebuild does
not grow with the number of threads. I did not measure it.
From reading, a suspend runs one rebuild for each CPU it takes offline,
and a resume one for each CPU it brings back. With 8 CPUs and 10000
threads that is 14 rebuilds: 10 to 16 ms on this host, and more on a
phone.
So the planned next version skips the walk when no task holds a
deadline bandwidth, as you suggest. It keeps one count for the whole
system, and none per cpuset: the number of tasks whose dl_bw is not 0.
__setparam_dl() and __dl_clear_params() are the only places that change
the dl_bw of a task, and they keep it.
In the same test, a rebuild then takes 0.03 ms whatever the number of
threads. With a deadline task in the system, the walk runs as before. A
test on an Android device would still be welcome.
For comparison, the single list of accounted tasks you suggested on
patch 13 takes 0.03 ms in this test, whatever the number of threads. I
left it out because the rebuild then runs with interrupts disabled for
its whole length, which grows with the number of deadline tasks.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com