lkml.org 
[lkml]   [2011]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: Bug in scheduler when using rt_mutex
From
On Thu, Jan 20, 2011 at 12:27 PM, Yong Zhang <yong.zhang0@gmail.com> wrote:
> on Thu, Jan 20, 2011 at 12:18 PM, Yong Zhang <yong.zhang0@gmail.com> wrote:
>> On Wed, Jan 19, 2011 at 9:30 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>>> +static void switched_from_fair(struct rq *rq, struct task_struct *p)
>>> +{
>>> +       struct sched_entity *se = &p->se;
>>> +       struct cfs_rq *cfs_rq = cfs_rq_of(se);
>>> +
>>> +       /*
>>> +        * Ensure the task's vruntime is normalized, so that when its
>>> +        * switched back to the fair class the enqueue_entity(.flags=0) will
>>> +        * do the right thing.
>>> +        *
>>> +        * If it was on_rq, then the dequeue_entity(.flags=0) will already
>>> +        * have normalized the vruntime, if it was !on_rq, then only when
>>> +        * the task is sleeping will it still have non-normalized vruntime.
>>> +        */
>>> +       if (!se->on_rq && p->state != TASK_RUNNING)
>>> +               se->vruntime -= cfs_rq->min_vruntime;
>>
>> Here it's possible that se->vruntime is little than cfs_rq->min_vruntime.
>
> Maybe we can:
>                       place_entity(cfs_rq, se, 0);
>                       se->vruntime -= cfs_rq->min_vruntime;

Hmmm, this doesn't make sense since we don't know how long the task
will sleep after we do this.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-01-20 06:35    [W:0.064 / U:17.940 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site