aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched_rt.c
diff options
context:
space:
mode:
authorGregory Haskins <ghaskins@novell.com>2008-01-25 15:08:09 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-25 15:08:09 -0500
commit697f0a487f294e634a342764472b79375bb3158a (patch)
treeedfee23b36eef33027368bf488a731d5373765aa /kernel/sched_rt.c
parent73fe6aae84400e2b475e2a1dc4e8592cd3ed6e69 (diff)
sched: clean up this_rq use in kernel/sched_rt.c
"this_rq" is normally used to denote the RQ on the current cpu (i.e. "cpu_rq(this_cpu)"). So clean up the usage of this_rq to be more consistent with the rest of the code. Signed-off-by: Gregory Haskins <ghaskins@novell.com> Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_rt.c')
-rw-r--r--kernel/sched_rt.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index ae4995c09aac..b788e35ffd3f 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -328,21 +328,21 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task,
328 * running task can migrate over to a CPU that is running a task 328 * running task can migrate over to a CPU that is running a task
329 * of lesser priority. 329 * of lesser priority.
330 */ 330 */
331static int push_rt_task(struct rq *this_rq) 331static int push_rt_task(struct rq *rq)
332{ 332{
333 struct task_struct *next_task; 333 struct task_struct *next_task;
334 struct rq *lowest_rq; 334 struct rq *lowest_rq;
335 int ret = 0; 335 int ret = 0;
336 int paranoid = RT_MAX_TRIES; 336 int paranoid = RT_MAX_TRIES;
337 337
338 assert_spin_locked(&this_rq->lock); 338 assert_spin_locked(&rq->lock);
339 339
340 next_task = pick_next_highest_task_rt(this_rq, -1); 340 next_task = pick_next_highest_task_rt(rq, -1);
341 if (!next_task) 341 if (!next_task)
342 return 0; 342 return 0;
343 343
344 retry: 344 retry:
345 if (unlikely(next_task == this_rq->curr)) { 345 if (unlikely(next_task == rq->curr)) {
346 WARN_ON(1); 346 WARN_ON(1);
347 return 0; 347 return 0;
348 } 348 }
@@ -352,24 +352,24 @@ static int push_rt_task(struct rq *this_rq)
352 * higher priority than current. If that's the case 352 * higher priority than current. If that's the case
353 * just reschedule current. 353 * just reschedule current.
354 */ 354 */
355 if (unlikely(next_task->prio < this_rq->curr->prio)) { 355 if (unlikely(next_task->prio < rq->curr->prio)) {
356 resched_task(this_rq->curr); 356 resched_task(rq->curr);
357 return 0; 357 return 0;
358 } 358 }
359 359
360 /* We might release this_rq lock */ 360 /* We might release rq lock */
361 get_task_struct(next_task); 361 get_task_struct(next_task);
362 362
363 /* find_lock_lowest_rq locks the rq if found */ 363 /* find_lock_lowest_rq locks the rq if found */
364 lowest_rq = find_lock_lowest_rq(next_task, this_rq); 364 lowest_rq = find_lock_lowest_rq(next_task, rq);
365 if (!lowest_rq) { 365 if (!lowest_rq) {
366 struct task_struct *task; 366 struct task_struct *task;
367 /* 367 /*
368 * find lock_lowest_rq releases this_rq->lock 368 * find lock_lowest_rq releases rq->lock
369 * so it is possible that next_task has changed. 369 * so it is possible that next_task has changed.
370 * If it has, then try again. 370 * If it has, then try again.
371 */ 371 */
372 task = pick_next_highest_task_rt(this_rq, -1); 372 task = pick_next_highest_task_rt(rq, -1);
373 if (unlikely(task != next_task) && task && paranoid--) { 373 if (unlikely(task != next_task) && task && paranoid--) {
374 put_task_struct(next_task); 374 put_task_struct(next_task);
375 next_task = task; 375 next_task = task;
@@ -380,7 +380,7 @@ static int push_rt_task(struct rq *this_rq)
380 380
381 assert_spin_locked(&lowest_rq->lock); 381 assert_spin_locked(&lowest_rq->lock);
382 382
383 deactivate_task(this_rq, next_task, 0); 383 deactivate_task(rq, next_task, 0);
384 set_task_cpu(next_task, lowest_rq->cpu); 384 set_task_cpu(next_task, lowest_rq->cpu);
385 activate_task(lowest_rq, next_task, 0); 385 activate_task(lowest_rq, next_task, 0);
386 386