lkml.org 
[lkml]   [2015]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/7] sched/deadline: reschedule if stop task slip in after pull operations
Hi Juri,
On Mon, Apr 20, 2015 at 11:27:22AM +0100, Juri Lelli wrote:
>Hi,
>
>On 06/04/2015 09:53, Wanpeng Li wrote:
>> pull_dl_task can drop (and re-acquire) rq->lock, this means a stop task
>> can slip in, in which case we need to reschedule. This patch add the
>> reschedule when the scenario occurs.
>>
>
>Ok, I guess it can happen. Doesn't RT have the same problem? It seems that
>it also has to deal with DL tasks slipping in, right?

Yeah, I will send another patch to handle RT class in the v2 patchset. :)

Regards,
Wanpeng Li

>
>Thanks,
>
>- Juri
>
>> Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
>> ---
>> kernel/sched/deadline.c | 16 +++++++++++++++-
>> 1 file changed, 15 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
>> index b8b9355..844da0f 100644
>> --- a/kernel/sched/deadline.c
>> +++ b/kernel/sched/deadline.c
>> @@ -1739,7 +1739,13 @@ static void switched_from_dl(struct rq *rq, struct task_struct *p)
>> if (!task_on_rq_queued(p) || rq->dl.dl_nr_running)
>> return;
>>
>> - if (pull_dl_task(rq))
>> + /*
>> + * pull_dl_task() can drop (and re-acquire) rq->lock; this
>> + * means a stop task can slip in, in which case we need to
>> + * reschedule.
>> + */
>> + if (pull_dl_task(rq) ||
>> + (rq->stop && task_on_rq_queued(rq->stop)))
>> resched_curr(rq);
>> }
>>
>> @@ -1786,6 +1792,14 @@ static void prio_changed_dl(struct rq *rq, struct task_struct *p,
>> pull_dl_task(rq);
>>
>> /*
>> + * pull_dl_task() can drop (and re-acquire) rq->lock; this
>> + * means a stop task can slip in, in which case we need to
>> + * reschedule.
>> + */
>> + if (rq->stop && task_on_rq_queued(rq->stop))
>> + resched_curr(rq);
>> +
>> + /*
>> * If we now have a earlier deadline task than p,
>> * then reschedule, provided p is still on this
>> * runqueue.
>>


\
 
 \ /
  Last update: 2015-04-21 01:21    [W:0.115 / U:6.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site