mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "figo.zhang" <figo.zhang@kolorific.com>
Cc: mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: Re: [PATCH]kernel/sched_fair.c: task_new_fair() have call update_curr() twice
Date: Wed, 08 Apr 2009 11:54:41 +0200	[thread overview]
Message-ID: <1239184481.24828.1374.camel@twins> (raw)
In-Reply-To: <20090408021038.2D1A4F50054@mail.kolorific.com>

On Wed, 2009-04-08 at 10:10 +0800, figo.zhang wrote:
> The task_new_fair() will call update_curr() twice, one is in
> task_new_fair(), and other one in
> enqueue_task_fair()->enqueue_entity(), they do the same,  so  it
> should be need one time.
> 
> Signed-off-by: figo.zhang <figo.zhang@kolorific.com>
> 
> 
> diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
> index 3816f21..d5913bb 100644
> --- a/kernel/sched_fair.c
> +++ b/kernel/sched_fair.c
> @@ -1713,7 +1713,7 @@ static void task_new_fair(struct rq *rq, struct
> task_struct *p) 
>  	sched_info_queued(p);
>  
> -	update_curr(cfs_rq);
> +
>  	place_entity(cfs_rq, se, 1);
>  
>  	/* 'curr' will be NULL if the child belongs to a different
> group */

Except that update_curr() changes ->vruntime, and place_entity() uses
->vruntime. Therefore the above is not a NOP.



      reply	other threads:[~2009-04-08  9:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08  2:10 figo.zhang
2009-04-08  9:54 ` Peter Zijlstra [this message]

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=1239184481.24828.1374.camel@twins \
    --to=peterz@infradead.org \
    --cc=figo.zhang@kolorific.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

all inboxes | Powered by JetHome®