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:	Fri, 3 Jun 2011 22:11:27 +0800
From:	Hillf Danton <dhillf@...il.com>
To:	LKML <linux-kernel@...r.kernel.org>
Cc:	Steven Rostedt <rostedt@...dmis.org>,
	Mike Galbraith <efault@....de>,
	Yong Zhang <yong.zhang0@...il.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...e.hu>
Subject: [PATCH] sched: find all lowest run-queues for RT task

When finding the lowest run-queue for a given RT task, as seen in cases such as
select_task_rq_rt() and find_lock_lowest_rq(), RQs with no RT tasks are also
eligible for both RR and FIFO RT tasks.

Minor change is added, when initializing cpupri, to record non-RT RQs which are
upated automatically, due to the cool design and implementation of cpupri, when
RT RQs are set and unset. Then they could be included in the selected CPUs by
cpupri_find().

A call for cpupri_set() is also added when a RQ has no RT task to run.

Signed-off-by: Hillf Danton <dhillf@...il.com>
---
 kernel/sched_cpupri.c |    4 +++-
 kernel/sched_rt.c     |    4 ++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/kernel/sched_cpupri.c b/kernel/sched_cpupri.c
index 2722dc1..d4c0b46 100644
--- a/kernel/sched_cpupri.c
+++ b/kernel/sched_cpupri.c
@@ -181,8 +181,10 @@ int cpupri_init(struct cpupri *cp)
 			goto cleanup;
 	}

-	for_each_possible_cpu(i)
+	for_each_possible_cpu(i) {
 		cp->cpu_to_pri[i] = CPUPRI_INVALID;
+		cpupri_set(cp, i, MAX_RT_PRIO);
+	}
 	return 0;

 cleanup:
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 88725c9..4dd6e45 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -1158,6 +1158,10 @@ static struct task_struct
*pick_next_task_rt(struct rq *rq)
 	 * lock again later if there is no need to push
 	 */
 	rq->post_schedule = has_pushable_tasks(rq);
+
+	/* this CPU is no longer RT if no task picked to feed it */
+	if (! p)
+		cpupri_set(&rq->rd->cpupri, rq->cpu, MAX_RT_PRIO);
 #endif

 	return p;
--
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