[Question] sched: migrate RT task on throttled leaf RT runqueue?
From: Hillf Danton
Date: Thu Jul 14 2011 - 09:44:01 EST
Hi Steven
When a non-boosted RT task is enqueued, if it is attached to task group, as
shown in the following diff format for clarity, and even if the RT runqueue
owned by the task group is throttled, the rt_rq is loaded up as leaf and the
task is added to pushable list if it is pushable.
Since RT tasks on throttled rt_runqueue will not be picked to be the next task
when scheduling, could they be migrated by pushing and pulling?
Thanks,
Hillf
---
kernel/sched_rt.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 97540f0..8489953 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -882,6 +882,9 @@ 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_throttled(rt_rq) && !rt_se_boosted(rt_se))
+ return; */
+
if (!rt_rq->rt_nr_running)
list_add_leaf_rt_rq(rt_rq);
@@ -1418,6 +1421,9 @@ retry:
return 0;
}
+ if (rt_rq_throttled(rt_rq_of_se(&next_task->rt)))
+ return 0;
+
/* We might release rq lock */
get_task_struct(next_task);
@@ -1519,6 +1525,9 @@ static int pull_rt_task(struct rq *this_rq)
p = pick_next_highest_task_rt(src_rq, this_cpu);
+ if (p && rt_rq_throttled(rt_rq_of_se(&p->rt)))
+ goto skip;
+
/*
* Do we have an RT task that preempts
* the to-be-scheduled task?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/