lkml.org 
[lkml]   [2012]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 2/4] sched: Push put_prev_task() into pick_next_task()
On 06/15/2012 02:03 PM, Peter Zijlstra wrote:
> On Fri, 2012-06-15 at 13:49 +0400, Glauber Costa wrote:
>> On 06/14/2012 05:29 PM, Peter Zijlstra wrote:
>>> +static struct task_struct *
>>> +pick_next_task_rt(struct rq *rq, struct task_struct *prev)
>>> {
>>> - struct task_struct *p = _pick_next_task_rt(rq);
>>> + struct task_struct *p;
>>> + struct rt_rq *rt_rq =&rq->rt;
>>> +
>>> + if (!rt_rq->rt_nr_running)
>>> + return NULL;
>>> +
>>> + if (rt_rq_throttled(rt_rq))
>>> + return NULL;
>>> +
>>> + if (prev)
>>> + prev->sched_class->put_prev_task(rq, prev);
>>> +
>> it might be me, but this one sounds strange. If the responsibility of
>> putting the task now lays with pic_next_task, you can't return NULL
>> without doing this first.
>
> Its the responsibility of the sched_class::pick_next_task implementation
> that will return the next task. Not of the first one called.
>
> Clearly this needs a comment.. /me adds.

hummmm, yeah, you are right. The comment does make it clearer.


\
 
 \ /
  Last update: 2012-06-15 12:42    [W:0.070 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site