lkml.org 
[lkml]   [2004]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] little schedule() cleanup: use cached current value
Hello.

schedule() can use prev/next instead of get_current().

Oleg.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 2.6.10-rc1/kernel/sched.c~ 2004-11-08 19:43:29.000000000 +0300
+++ 2.6.10-rc1/kernel/sched.c 2004-11-08 22:52:26.547195920 +0300
@@ -2508,7 +2508,7 @@ need_resched:
* The idle thread is not allowed to schedule!
* Remove this check after it has been exercised a bit.
*/
- if (unlikely(current == rq->idle) && current->state != TASK_RUNNING) {
+ if (unlikely(prev == rq->idle) && prev->state != TASK_RUNNING) {
printk(KERN_ERR "bad: scheduling from the idle thread!\n");
dump_stack();
}
@@ -2531,8 +2531,8 @@ need_resched:

spin_lock_irq(&rq->lock);

- if (unlikely(current->flags & PF_DEAD))
- current->state = EXIT_DEAD;
+ if (unlikely(prev->flags & PF_DEAD))
+ prev->state = EXIT_DEAD;
/*
* if entering off of a kernel preemption go straight
* to picking the next task.
@@ -2636,7 +2636,7 @@ switch_tasks:
} else
spin_unlock_irq(&rq->lock);

- reacquire_kernel_lock(current);
+ reacquire_kernel_lock(next);
preempt_enable_no_resched();
if (unlikely(test_thread_flag(TIF_NEED_RESCHED)))
goto need_resched;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.036 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site