public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: miaox@cn.fujitsu.com, Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched: fix unfairness when upgrade weight
Date: Wed, 25 Feb 2009 12:13:55 +0100	[thread overview]
Message-ID: <20090225111355.GD15453@elte.hu> (raw)
In-Reply-To: <1235550053.4645.3035.camel@laptop>


* Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:

> > --- a/kernel/sched_fair.c
> > +++ b/kernel/sched_fair.c
> > @@ -1690,6 +1690,15 @@ static void task_new_fair(struct rq *rq, struct task_struct *p)
> >  static void prio_changed_fair(struct rq *rq, struct task_struct *p,
> >  			      int oldprio, int running)
> >  {
> > +	struct cfs_rq *cfs_rq = task_cfs_rq(p);
> > +	struct sched_entity *se = &p->se;
> > +	int on_rq = se->on_rq;
> > +
> > +	if (p->prio < oldprio && on_rq) {
> > +		dequeue_entity(cfs_rq, se, 0);
> > +		se->vruntime = cfs_rq->min_vruntime + sched_vslice(cfs_rq, se);
> > +		enqueue_entity(cfs_rq, se, 0);
> > +	}
> 
> we very likely just enqueued the thing, and now we dequeue/enqueue
> again.. not very nice.

but priority-change is a slowpath, so it shouldnt matter much, 
should it?

	Ingo

  reply	other threads:[~2009-02-25 11:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25  7:32 [PATCH] sched: fix unfairness when upgrade weight Miao Xie
2009-02-25  8:20 ` Peter Zijlstra
2009-02-25 11:13   ` Ingo Molnar [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-06-30  6:27 Lai Jiangshan
2008-07-02 21:49 ` Peter Zijlstra
2008-07-03 11:30   ` jha
2008-07-04  2:39     ` Lai Jiangshan

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=20090225111355.GD15453@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miaox@cn.fujitsu.com \
    /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