<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;

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

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/kernel/sched.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN kernel/sched.c~sched-use-cached-current-value kernel/sched.c
--- 25/kernel/sched.c~sched-use-cached-current-value	2004-12-03 20:56:32.185867192 -0800
+++ 25-akpm/kernel/sched.c	2004-12-03 20:56:32.193865976 -0800
@@ -2552,7 +2552,7 @@ need_resched_nonpreemptible:
 	 * The idle thread is not allowed to schedule!
 	 * Remove this check after it has been exercised a bit.
 	 */
-	if (unlikely(current == rq-&gt;idle) &amp;&amp; current-&gt;state != TASK_RUNNING) {
+	if (unlikely(prev == rq-&gt;idle) &amp;&amp; prev-&gt;state != TASK_RUNNING) {
 		printk(KERN_ERR "bad: scheduling from the idle thread!\n");
 		dump_stack();
 	}
@@ -2572,8 +2572,8 @@ need_resched_nonpreemptible:
 
 	spin_lock_irq(&amp;rq-&gt;lock);
 
-	if (unlikely(current-&gt;flags &amp; PF_DEAD))
-		current-&gt;state = EXIT_DEAD;
+	if (unlikely(prev-&gt;flags &amp; PF_DEAD))
+		prev-&gt;state = EXIT_DEAD;
 	/*
 	 * if entering off of a kernel preemption go straight
 	 * to picking the next task.
_
</pre></body></html>