Skip to contentSkip to conversation

sched: convert wall-time to vruntime for check_preempt_tick

PATCH In review Shaohua Li 2 participants 6 messages Apr 7, 2011 – Apr 8, 2011

lore
Share & tools
lore

Shaohua Li

author
#0 lore raw

PATCH 1/1 sched: convert wall-time to vruntime for check_preempt_tick

In check_preempt_tick(), delta is vruntime and ideal_runtime is wall runtime. Comparing vruntime and ideal_runtime looks buggy.

kernel/sched_fair.c +1 -1
index 3f7ec9e..0b76e3a 100644
@@ -1121,7 +1121,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
 		if (delta < 0)
 			return;
 
-		if (delta > ideal_runtime)
+		if (delta > calc_delta_fair(ideal_runtime, curr))
 			resched_task(rq_of(cfs_rq)->curr);
 	}
 }
#1 lore raw
Quoted 2 lines · Shaohua Li

In check_preempt_tick(), delta is vruntime and ideal_runtime is wall runtime. Comparing vruntime and ideal_runtime looks buggy.

Why is that buggy? It's a distance in units ns, ala wakeup_granularity, a number. This number just happens to be variable.

Quoted 20 lines
kernel/sched_fair.c +1 -2
index 3f7ec9e..0b76e3a 100644
@@ -1121,7 +1121,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
 		if (delta < 0)
 			return;
 
-		if (delta > ideal_runtime)
+		if (delta > calc_delta_fair(ideal_runtime, curr))
 			resched_task(rq_of(cfs_rq)->curr);
 	}
 }
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

author
#2 lore raw
Quoted 6 lines · Mike Galbraith
Quoted 2 lines · Shaohua Li

In check_preempt_tick(), delta is vruntime and ideal_runtime is wall runtime. Comparing vruntime and ideal_runtime looks buggy.

Why is that buggy? It's a distance in units ns, ala wakeup_granularity, a number. This number just happens to be variable.

vruntime is scaled wall-time. In all other places we do the scale from my understanding. I'm wondering why not do it here.

#3 lore raw
Quoted 9 lines · Shaohua Li
Quoted 6 lines · Mike Galbraith
Quoted 2 lines · Shaohua Li

In check_preempt_tick(), delta is vruntime and ideal_runtime is wall runtime. Comparing vruntime and ideal_runtime looks buggy.

Why is that buggy? It's a distance in units ns, ala wakeup_granularity, a number. This number just happens to be variable.

vruntime is scaled wall-time. In all other places we do the scale from my understanding. I'm wondering why not do it here.

The purpose was to ensure that there is not too much spread, just like wakeup preemption. Using the number that determines tick induced spread as the spread caliper seems perfectly fine to me.

-Mike

author
#4 lore raw
Quoted 6 lines · Mike Galbraith
Quoted 5 lines · Shaohua Li
Quoted 4 lines · Mike Galbraith
Quoted 2 lines · Shaohua Li

In check_preempt_tick(), delta is vruntime and ideal_runtime is wall runtime. Comparing vruntime and ideal_runtime looks buggy.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Why is that buggy? It's a distance in units ns, ala wakeup_granularity, a number. This number just happens to be variable.

vruntime is scaled wall-time. In all other places we do the scale from my understanding. I'm wondering why not do it here.

The purpose was to ensure that there is not too much spread, just like wakeup preemption. Using the number that determines tick induced spread as the spread caliper seems perfectly fine to me.

But we scale wakeup_granularity too for wakeup preemption, see wakeup_gran(), am I missing anything?

#5 lore raw
Quoted 12 lines · Shaohua Li
Quoted 11 lines · Mike Galbraith
Quoted 9 lines · Shaohua Li
Quoted 6 lines · Mike Galbraith
Quoted 2 lines · Shaohua Li

In check_preempt_tick(), delta is vruntime and ideal_runtime is wall runtime. Comparing vruntime and ideal_runtime looks buggy.

Why is that buggy? It's a distance in units ns, ala wakeup_granularity, a number. This number just happens to be variable.

vruntime is scaled wall-time. In all other places we do the scale from my understanding. I'm wondering why not do it here.

Quoted 6 lines
Quoted 3 lines

The purpose was to ensure that there is not too much spread, just like wakeup preemption. Using the number that determines tick induced spread as the spread caliper seems perfectly fine to me.

But we scale wakeup_granularity too for wakeup preemption, see wakeup_gran(), am I missing anything?

Only because we want lighter tasks to be easier to preempt, and heavier tasks harder. Weight is already built into vruntime.

-Mike