sched/fair: Set se->vruntime directly in place_entity()

Message ID ae59db1945518d6f6250920d46eb1f1a9cc0024e.1352361704.git.viresh.kumar@linaro.org
State Accepted
Commit 16c8f1c72ece3871a6c93003cd888fc2d003a7eb
Headers show

Commit Message

Viresh Kumar Nov. 8, 2012, 8:03 a.m.
We are first storing the new vruntime in a variable and then storing it in
se->vruntime. Simply update se->vruntime directly.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 kernel/sched/fair.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Viresh Kumar Jan. 2, 2013, 5:44 a.m. | #1
On 8 November 2012 13:33, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> We are first storing the new vruntime in a variable and then storing it in
> se->vruntime. Simply update se->vruntime directly.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  kernel/sched/fair.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index a319d56c..820a2f1 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -1454,9 +1454,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
>         }
>
>         /* ensure we never gain time by being placed backwards. */
> -       vruntime = max_vruntime(se->vruntime, vruntime);
> -
> -       se->vruntime = vruntime;
> +       se->vruntime = max_vruntime(se->vruntime, vruntime);
>  }

Ping!!

Patch

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a319d56c..820a2f1 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1454,9 +1454,7 @@  place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
 	}
 
 	/* ensure we never gain time by being placed backwards. */
-	vruntime = max_vruntime(se->vruntime, vruntime);
-
-	se->vruntime = vruntime;
+	se->vruntime = max_vruntime(se->vruntime, vruntime);
 }
 
 static void check_enqueue_throttle(struct cfs_rq *cfs_rq);