]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sched/dlserver: Fix dlserver time accounting
authorVineeth Pillai (Google) <vineeth@bitbyteword.org>
Fri, 13 Dec 2024 03:22:37 +0000 (22:22 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 13:01:59 +0000 (14:01 +0100)
commitbaedaacee165744cd8980b8acca64bcca32e56e0
tree6ec1a371550c2c87fe3269f6ed7395c3aa236a46
parentbdd68033d11a90bcbdcb67b0ba3b683d1fbeabac
sched/dlserver: Fix dlserver time accounting

[ Upstream commit c7f7e9c73178e0e342486fd31e7f363ef60e3f83 ]

dlserver time is accounted when:
 - dlserver is active and the dlserver proxies the cfs task.
 - dlserver is active but deferred and cfs task runs after being picked
   through the normal fair class pick.

dl_server_update is called in two places to make sure that both the
above times are accounted for. But it doesn't check if dlserver is
active or not. Now that we have this dl_server_active flag, we can
consolidate dl_server_update into one place and all we need to check is
whether dlserver is active or not. When dlserver is active there is only
two possible conditions:
 - dlserver is deferred.
 - cfs task is running on behalf of dlserver.

Fixes: a110a81c52a9 ("sched/deadline: Deferrable dl server")
Signed-off-by: "Vineeth Pillai (Google)" <vineeth@bitbyteword.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Marcel Ziswiler <marcel.ziswiler@codethink.co.uk> # ROCK 5B
Link: https://lore.kernel.org/r/20241213032244.877029-2-vineeth@bitbyteword.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/sched/fair.c