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>] [day] [month] [year] [list]
Date:	Wed, 6 Jun 2012 21:20:17 +0800
From:	Hillf Danton <dhillf@...il.com>
To:	LKML <linux-kernel@...r.kernel.org>,
	Hillf Danton <dhillf@...il.com>
Subject: [patch] BFS 421: fix try_preempt

We have to keep deadline latest, so no update if not checked.

Alternatively we could try preempt in the following way,

	rcu_read_lock();
	for_each_domain(task_cpu(q), sd) {
		for_each_cpu_and(cpu, tsk_cpus_allowed(p),
						sched_domain_span(sd)) {
			if (!cpu_online(cpu))
				continue;
			if (can_preempt(p, cpu_rq(cpu)->rq_prio,
						cpu_rq(cpu)->rq_deadline)) {
				resched_task(cpu_rq(cpu)->curr);
				goto out;
			}
		}
	}
out:
	rcu_read_unlock();


where the upside is that the LLC is invovled, and the downside is that we are
not sure the preempted task has the highest priority and the latest deadline.

What to do next?


--- a/kernel/sched/bfs.c	Wed Jun  6 20:14:36 2012
+++ b/kernel/sched/bfs.c	Wed Jun  6 20:16:48 2012
@@ -1452,10 +1452,11 @@ static void try_preempt(struct task_stru
 		if (rq_prio < highest_prio)
 			continue;

-		if (rq_prio > highest_prio ||
-		    deadline_after(rq->rq_deadline, latest_deadline)) {
+		if (rq_prio > highest_prio)
+			goto set;
+		if (deadline_after(rq->rq_deadline, latest_deadline)) {
 			latest_deadline = rq->rq_deadline;
-			highest_prio = rq_prio;
+set:			highest_prio = rq_prio;
 			highest_prio_rq = rq;
 		}
 	}
--
--
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