lkml.org 
[lkml]   [1999]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: question about spin_lock_irqsave
mathijs wrote:
>
> I noticed something "funny". In wake_up_process (kernel/sched.c
> line 324, 2.3.34) reschedule_idle is called after doing a
> spin_lock_irqsave. In reschedule_idle, every exit has an spin_unlock_irqrestore.
> Except when the kernel is compiled without __SMP__. In this case, no unlock is
> preformed.
>
> Will this not leak on the stack? What am i missing?

it won't leak as in the UP case it only restores the flags, but it might
delay servicing interrupts unnecessarily. The obvious patch would be:

diff -urNp /img/linux-2.3.34/kernel/sched.c linux-2.3.34as/kernel/sched.c
--- /img/linux-2.3.34/kernel/sched.c Wed Dec 15 07:33:33 1999
+++ linux-2.3.34as/kernel/sched.c Mon Dec 27 16:05:30 1999
@@ -273,6 +261,7 @@ send_now:
tsk = cpu_curr(this_cpu);
if (preemption_goodness(tsk, p, this_cpu) > 0)
tsk->need_resched = 1;
+ spin_unlock_irqrestore(&runqueue_lock, flags);
#endif
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.132 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site