lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 23 Jun 2011 21:43:19 +0800
From:	Hillf Danton <dhillf@...il.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: [RFC] sched: update rto_mask for RT runqueue

Hi Steven

Since {de, en}queue_pushable_task() is not always accompanied with
{dec, inc}_rt_migration(), when the last pushable RT task on RQ is picked in
pick_next_task_rt(), we have to update rto_mask for the RQ in question, which
helps puller that is guided by rto_mask.

Thanks,

Hillf
---
 kernel/sched_rt.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index b03cd89..4daf0ae 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -96,6 +96,15 @@ static void update_rt_migration(struct rt_rq *rt_rq)
 	}
 }

+static void update_rt_migratory(struct rt_rq *rt_rq, int inc)
+{
+	if (inc)
+		rt_rq->rt_nr_migratory++;
+	else
+		rt_rq->rt_nr_migratory--;
+	update_rt_migration(rt_rq);
+}
+
 static void inc_rt_migration(struct sched_rt_entity *rt_se, struct
rt_rq *rt_rq)
 {
 	if (!rt_entity_is_task(rt_se))
@@ -1148,11 +1157,13 @@ static struct task_struct
*pick_next_task_rt(struct rq *rq)
 {
 	struct task_struct *p = _pick_next_task_rt(rq);

+#ifdef CONFIG_SMP
 	/* The running task is never eligible for pushing */
-	if (p)
+	if (p && p->rt.nr_cpus_allowed > 1) {
 		dequeue_pushable_task(rq, p);
+		update_rt_migratory(&rq->rt, 0);
+	}

-#ifdef CONFIG_SMP
 	/*
 	 * We detect this state here so that we can avoid taking the RQ
 	 * lock again later if there is no need to push
@@ -1168,12 +1179,16 @@ static void put_prev_task_rt(struct rq *rq,
struct task_struct *p)
 	update_curr_rt(rq);
 	p->se.exec_start = 0;

+#ifdef CONFIG_SMP
 	/*
 	 * The previous task needs to be made eligible for pushing
 	 * if it is still active
 	 */
-	if (on_rt_rq(&p->rt) && p->rt.nr_cpus_allowed > 1)
+	if (on_rt_rq(&p->rt) && p->rt.nr_cpus_allowed > 1) {
 		enqueue_pushable_task(rq, p);
+		update_rt_migratory(&rq->rt, 1);
+	}
+#endif
 }

 #ifdef CONFIG_SMP
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ