All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] sched: make update_min_vruntime() more readable
@ 2015-07-05  9:33 byungchul.park
  2015-07-06 11:26 ` Peter Zijlstra
  2016-09-05 11:53 ` [tip:sched/core] sched/fair: Make " tip-bot for Byungchul Park
  0 siblings, 2 replies; 4+ messages in thread
From: byungchul.park @ 2015-07-05  9:33 UTC (permalink / raw)
  To: mingo, peterz; +Cc: minchan.kim, linux-kernel, Byungchul Park

From: Byungchul Park <byungchul.park@lge.com>

update_min_vruntime() condition flow can be simpler

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
---
 kernel/sched/fair.c |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 3d57cc0..59de964 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -463,20 +463,17 @@ static void update_min_vruntime(struct cfs_rq *cfs_rq)
 {
 	u64 vruntime = cfs_rq->min_vruntime;
 
-	if (cfs_rq->curr)
-		vruntime = cfs_rq->curr->vruntime;
-
 	if (cfs_rq->rb_leftmost) {
 		struct sched_entity *se = rb_entry(cfs_rq->rb_leftmost,
 						   struct sched_entity,
 						   run_node);
 
-		if (!cfs_rq->curr)
-			vruntime = se->vruntime;
-		else
-			vruntime = min_vruntime(vruntime, se->vruntime);
+		vruntime = se->vruntime;
 	}
 
+	if (cfs_rq->curr)
+		vruntime = min_vruntime(vruntime, cfs_rq->curr->vruntime);
+
 	/* ensure we never gain time by being placed backwards. */
 	cfs_rq->min_vruntime = max_vruntime(cfs_rq->min_vruntime, vruntime);
 #ifndef CONFIG_64BIT
@@ -5552,7 +5549,7 @@ static bool yield_to_task_fair(struct rq *rq, struct task_struct *p, bool preemp
  *
  * The adjacency matrix of the resulting graph is given by:
  *
- *             log_2 n     
+ *             log_2 n
  *   A_i,j = \Union     (i % 2^k == 0) && i / 2^(k+1) == j / 2^(k+1)  (6)
  *             k = 0
  *
@@ -5598,7 +5595,7 @@ static bool yield_to_task_fair(struct rq *rq, struct task_struct *p, bool preemp
  *
  * [XXX write more on how we solve this.. _after_ merging pjt's patches that
  *      rewrite all of this once again.]
- */ 
+ */
 
 static unsigned long __read_mostly max_load_balance_interval = HZ/10;
 
@@ -6337,7 +6334,7 @@ void update_group_capacity(struct sched_domain *sd, int cpu)
 		/*
 		 * !SD_OVERLAP domains can assume that child groups
 		 * span the current group.
-		 */ 
+		 */
 
 		group = child->groups;
 		do {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-05 11:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-05  9:33 [PATCH 1/1] sched: make update_min_vruntime() more readable byungchul.park
2015-07-06 11:26 ` Peter Zijlstra
2015-07-06 11:57   ` Byungchul Park
2016-09-05 11:53 ` [tip:sched/core] sched/fair: Make " tip-bot for Byungchul Park

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.