mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: byungchul.park@lge.com
Cc: mingo@kernel.org, minchan.kim@lge.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] sched: make update_min_vruntime() more readable
Date: Mon, 6 Jul 2015 13:26:53 +0200	[thread overview]
Message-ID: <20150706112653.GC3644@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1436088829-25768-1-git-send-email-byungchul.park@lge.com>

On Sun, Jul 05, 2015 at 06:33:48PM +0900, byungchul.park@lge.com wrote:
> From: Byungchul Park <byungchul.park@lge.com>
> 
> update_min_vruntime() condition flow can be simpler

This changelog needs help; a few more words on why this is correct and
simpler would not go amiss, and you should mention you're deleting some
spurious trailing whitespace.

> 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

  reply	other threads:[~2015-07-06 11:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-05  9:33 byungchul.park
2015-07-06 11:26 ` Peter Zijlstra [this message]
2015-07-06 11:57   ` Byungchul Park
2016-09-05 11:53 ` [tip:sched/core] sched/fair: Make " tip-bot for Byungchul Park

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150706112653.GC3644@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=byungchul.park@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan.kim@lge.com \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome