mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Kirill Tkhai <tkhai@yandex.ru>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH]sched/rt.c: leaf_rt_rq_list contains empty queues. Fix it
Date: Fri, 21 Sep 2012 10:31:30 -0400	[thread overview]
Message-ID: <1348237890.13080.72.camel@gandalf.local.home> (raw)
In-Reply-To: <668281348234555@web30d.yandex.ru>

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)



      parent reply	other threads:[~2012-09-21 14:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 13:35 Kirill Tkhai
2012-09-21 14:21 ` Kirill Tkhai
2012-09-21 14:32   ` Steven Rostedt
2012-09-21 14:39     ` Kirill Tkhai
2012-09-21 14:31 ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348237890.13080.72.camel@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tkhai@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®