Patch "sched/dlserver: Fix dlserver time accounting" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sched/dlserver: Fix dlserver time accounting

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sched-dlserver-fix-dlserver-time-accounting.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c54ff10a7b8301b633e1aa2769b493f1ab170b56
Author: Vineeth Pillai (Google) <vineeth@xxxxxxxxxxxxxxx>
Date:   Thu Dec 12 22:22:37 2024 -0500

    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@xxxxxxxxxxxxxxx>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
    Tested-by: Marcel Ziswiler <marcel.ziswiler@xxxxxxxxxxxxxxx> # ROCK 5B
    Link: https://lore.kernel.org/r/20241213032244.877029-2-vineeth@xxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 93142f9077c7..1ca96c99872f 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1159,8 +1159,6 @@ static inline void update_curr_task(struct task_struct *p, s64 delta_exec)
 	trace_sched_stat_runtime(p, delta_exec);
 	account_group_exec_runtime(p, delta_exec);
 	cgroup_account_cputime(p, delta_exec);
-	if (p->dl_server)
-		dl_server_update(p->dl_server, delta_exec);
 }
 
 static inline bool did_preempt_short(struct cfs_rq *cfs_rq, struct sched_entity *curr)
@@ -1237,11 +1235,16 @@ static void update_curr(struct cfs_rq *cfs_rq)
 		update_curr_task(p, delta_exec);
 
 		/*
-		 * Any fair task that runs outside of fair_server should
-		 * account against fair_server such that it can account for
-		 * this time and possibly avoid running this period.
+		 * If the fair_server is active, we need to account for the
+		 * fair_server time whether or not the task is running on
+		 * behalf of fair_server or not:
+		 *  - If the task is running on behalf of fair_server, we need
+		 *    to limit its time based on the assigned runtime.
+		 *  - Fair task that runs outside of fair_server should account
+		 *    against fair_server such that it can account for this time
+		 *    and possibly avoid running this period.
 		 */
-		if (p->dl_server != &rq->fair_server)
+		if (dl_server_active(&rq->fair_server))
 			dl_server_update(&rq->fair_server, delta_exec);
 	}
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux