lkml.org 
[lkml]   [2012]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH]sched/rt.c: leaf_rt_rq_list contains empty queues. Fix it
From
Date
On Fri, 2012-09-21 at 17:35 +0400, Kirill Tkhai wrote:
> Function __enqueue_rt_entity() adds an empty queue to leaf_rt_rq_list.
>
> So, pick_next_highest_task_rt() picks empty queues. Fix it.

Do you have an example where this breaks?

>
> Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
> ---
> kernel/sched/rt.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index 944cb68..b07edb9 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -1103,7 +1103,7 @@ static void __enqueue_rt_entity(struct sched_rt_entity *rt_se, bool head)
> if (group_rq && (rt_rq_throttled(group_rq) || !group_rq->rt_nr_running))
> return;
>
> - if (!rt_rq->rt_nr_running)
> + if (rt_rq->rt_nr_running)
> list_add_leaf_rt_rq(rt_rq);

Note, the list_add_leaf_rt_rq() is called when the first task is queued
up. The function here is __enqueue_rt_entity(), which will increment
rt_rq->rt_nr_running. If this is the first entry we add the queue now,
as the __dequeue_rt_entity() does the list_del_leaf_rt_rq() when it goes
to zero.

-- Steve

>
> if (head)




\
 
 \ /
  Last update: 2012-09-21 17:01    [W:0.049 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site