* [PATCH]sched/rt.c: leaf_rt_rq_list contains empty queues. Fix it
@ 2012-09-21 13:35 Kirill Tkhai
2012-09-21 14:21 ` Kirill Tkhai
2012-09-21 14:31 ` Steven Rostedt
0 siblings, 2 replies; 5+ messages in thread
From: Kirill Tkhai @ 2012-09-21 13:35 UTC (permalink / raw)
To: linux-kernel; +Cc: Steven Rostedt, Ingo Molnar, Peter Zijlstra
Function __enqueue_rt_entity() adds an empty queue to leaf_rt_rq_list.
So, pick_next_highest_task_rt() picks empty queues. Fix it.
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);
if (head)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH]sched/rt.c: leaf_rt_rq_list contains empty queues. Fix it
2012-09-21 13:35 [PATCH]sched/rt.c: leaf_rt_rq_list contains empty queues. Fix it Kirill Tkhai
@ 2012-09-21 14:21 ` Kirill Tkhai
2012-09-21 14:32 ` Steven Rostedt
2012-09-21 14:31 ` Steven Rostedt
1 sibling, 1 reply; 5+ messages in thread
From: Kirill Tkhai @ 2012-09-21 14:21 UTC (permalink / raw)
To: linux-kernel; +Cc: Steven Rostedt, Ingo Molnar, Peter Zijlstra
Second version. Add every not empty queue once. The patch:
Function __enqueue_rt_entity() adds an empty queue to leaf_rt_rq_list.
So, pick_next_highest_task_rt() picks empty queues. Fix it.
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..97a0954 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 == 1)
list_add_leaf_rt_rq(rt_rq);
if (head)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH]sched/rt.c: leaf_rt_rq_list contains empty queues. Fix it
2012-09-21 13:35 [PATCH]sched/rt.c: leaf_rt_rq_list contains empty queues. Fix it Kirill Tkhai
2012-09-21 14:21 ` Kirill Tkhai
@ 2012-09-21 14:31 ` Steven Rostedt
1 sibling, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2012-09-21 14:31 UTC (permalink / raw)
To: Kirill Tkhai; +Cc: linux-kernel, Ingo Molnar, Peter Zijlstra
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)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH]sched/rt.c: leaf_rt_rq_list contains empty queues. Fix it
2012-09-21 14:21 ` Kirill Tkhai
@ 2012-09-21 14:32 ` Steven Rostedt
2012-09-21 14:39 ` Kirill Tkhai
0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2012-09-21 14:32 UTC (permalink / raw)
To: Kirill Tkhai; +Cc: linux-kernel, Ingo Molnar, Peter Zijlstra
On Fri, 2012-09-21 at 18:21 +0400, Kirill Tkhai wrote:
> Second version. Add every not empty queue once. The patch:
>
> Function __enqueue_rt_entity() adds an empty queue to leaf_rt_rq_list.
>
> So, pick_next_highest_task_rt() picks empty queues. Fix it.
>
> 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..97a0954 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 == 1)
> list_add_leaf_rt_rq(rt_rq);
Again, the rt_nr_running hasn't been incremented yet. This patch will
add it when the rq gets a second task.
-- Steve
>
> if (head)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH]sched/rt.c: leaf_rt_rq_list contains empty queues. Fix it
2012-09-21 14:32 ` Steven Rostedt
@ 2012-09-21 14:39 ` Kirill Tkhai
0 siblings, 0 replies; 5+ messages in thread
From: Kirill Tkhai @ 2012-09-21 14:39 UTC (permalink / raw)
To: Steven Rostedt; +Cc: linux-kernel, Ingo Molnar, Peter Zijlstra
> Again, the rt_nr_running hasn't been incremented yet. This patch will
> add it when the rq gets a second task.
>
> -- Steve
Right, thanks for the explanation
Kirill
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-09-21 14:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-21 13:35 [PATCH]sched/rt.c: leaf_rt_rq_list contains empty queues. Fix it 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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).