Skip to contentSkip to conversation

sched/fair: Optimize vlag entity placement

PATCH In review Fernand Sieber 2 participants 2 messages Jul 4, 2024 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/fair: Optimize vlag entity placement

Optimize for common path when placing an entity with no lag. Since adjusting a zero lag is always going to produce a zero lag regardless of the local load, don't bother about calaculating the adjusting factor.

Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Juri Lelli <[email protected]>
Cc Vincent Guittot <[email protected]>
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
index 8a5b1ae0aa55..e78272c87274 100644
@@ -5190,7 +5190,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
 	 *
 	 * EEVDF: placement strategy #1 / #2
 	 */
-	if (sched_feat(PLACE_LAG) && cfs_rq->nr_running) {
+	if (se->vlag && sched_feat(PLACE_LAG) && cfs_rq->nr_running) {
 		struct sched_entity *curr = cfs_rq->curr;
 		unsigned long load;
 
Signature · 1 line
2.40.1
#1 lore raw
Quoted 3 lines · Fernand Sieber

Optimize for common path when placing an entity with no lag. Since adjusting a zero lag is always going to produce a zero lag regardless of the local load, don't bother about calaculating the adjusting factor.

calculating

Quoted 15 lines
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Juri Lelli <[email protected]>
Cc Vincent Guittot <[email protected]>
---
  kernel/sched/fair.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +0 -0
index 8a5b1ae0aa55..e78272c87274 100644

kernel/sched/fair.c place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) · line 5196

Quoted 8 lines
kernel/sched/fair.c +1 -1
@@ -5190,7 +5190,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
  	 *
  	 * EEVDF: placement strategy #1 / #2
  	 */
-	if (sched_feat(PLACE_LAG) && cfs_rq->nr_running) {
+	if (se->vlag && sched_feat(PLACE_LAG) && cfs_rq->nr_running) {
  		struct sched_entity *curr = cfs_rq->curr;
  		unsigned long load;
 

Thanks,