Thread (7 messages) 7 messages, 3 authors, 2015-03-27

Re: [PATCH v5] sched/rt: Use IPI to trigger RT task push migration instead of pulling

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2015-03-20 14:27:41
Also in: lkml

On Fri, 20 Mar 2015 11:25:42 +0100
Peter Zijlstra [off-list ref] wrote:
On Wed, Mar 18, 2015 at 02:49:46PM -0400, Steven Rostedt wrote:
quoted
+static int find_next_push_cpu(struct rq *rq)
+{
+	struct rq *next_rq;
+	int cpu;
+
+	while (1) {
We typically tend to write: for (;;), instead, however would a do { }
while () loop not make more sense here?
You know, I use to do "for (;;)" instead of "while (1)" because to me
"for (;;)" == "forever". But people have since convinced me that
"while (1)" is better. I don't really care so I just did the switch :-p

	do {
		cpu = rto_next_cpu(rq);
		if (cpu >= nr_cpu_ids)
			break;

		next_rq = cpu_rq(cpu);
	} while (next_rq->rt.highest_prio.next >= rq->rt.highest_prio.curr);
Ah, that does make sense. Not sure why I had it the way I did. I think
it had to do with the way I thought about the algorithm. I did it in
layers. As there were more than one break, I probably just figured to
do them explicitly.

Want me to send an updated patch?

-- Steve

quoted
+	return cpu;
+}
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help