lkml.org 
[lkml]   [2009]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched: fix unfairness when upgrade weight

* 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


\
 
 \ /
  Last update: 2009-02-25 12:17    [W:0.040 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site