Re: [PATCH 06/16] sched: SCHED_DEADLINE push and pull logic

From: Juri Lelli
Date: Wed Apr 11 2012 - 13:48:08 EST


On 04/11/2012 07:25 PM, Steven Rostedt wrote:
On Fri, 2012-04-06 at 09:14 +0200, Juri Lelli wrote:

static void set_cpus_allowed_dl(struct task_struct *p,
@@ -622,10 +1346,145 @@ static void set_cpus_allowed_dl(struct task_struct *p,

BUG_ON(!dl_task(p));

+ /*
+ * Update only if the task is actually running (i.e.,
+ * it is on the rq AND it is not throttled).
+ */
+ if (on_dl_rq(&p->dl)&& (weight != p->dl.nr_cpus_allowed)) {
+ struct rq *rq = task_rq(p);
+
+ if (!task_current(rq, p)) {
+ /*
+ * If the task was on the pushable list,
+ * make sure it stays there only if the new
+ * mask allows that.
+ */
+ if (p->dl.nr_cpus_allowed> 1)
+ dequeue_pushable_dl_task(rq, p);
+
+ if (weight> 1)
+ enqueue_pushable_dl_task(rq, p);
+ }
+
+ if ((p->dl.nr_cpus_allowed<= 1)&& (weight> 1)) {
+ rq->dl.dl_nr_migratory++;
+ } else if ((p->dl.nr_cpus_allowed> 1)&& (weight<= 1)) {
+ BUG_ON(!rq->dl.dl_nr_migratory);
+ rq->dl.dl_nr_migratory--;
+ }
+
+ update_dl_migration(&rq->dl);

Note, I'm in the process of testing this patch:

https://lkml.org/lkml/2012/4/11/7

Just giving you a heads up, as this looks like you can benefit from this
change as well.


Sure! I noticed it just today and started wondering how it would apply in
my case.

+ }
+
cpumask_copy(&p->cpus_allowed, new_mask);
p->dl.nr_cpus_allowed = weight;
}
+



Thanks,

- Juri
--
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/