&gt; As I remember timer interrupt as well is an NMI so, it is<br>
&gt; possible (although not advised) to call schedule function while<br>
&gt; holding spinlock on same core.<br>&gt;<br>
&gt; spin_lock_irqsave();<br>
&gt; schedule();<br>
&gt; spin_lock_irqrestore();<br><br>sorry for confusion created by my last mail, looks like its only watchdog timer which are NMI and above function call to schedule() does not require any help from scheduler&#39;s timer interrupts (not sure if same timer hardware is used for watchdog and scheduler timer interrupts, my guess is both may share the hardware, but different IRQL line, one maskable other non-maskable). However it is still possible to voluntarily schedule the CPU core by currently executing code even with spin_locks disabled.<br>
<br>Rajat <br><br><div class="gmail_quote">On Fri, Jan 7, 2011 at 3:01 PM, nilesh <span dir="ltr">&lt;<a href="mailto:nilesh.tayade@netscout.com">nilesh.tayade@netscout.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On Fri, 2011-01-07 at 13:33 +0530, anish singh wrote:<br>
&gt;<br>
&gt;<br>
&gt; On Fri, Jan 7, 2011 at 1:19 PM, nilesh &lt;<a href="mailto:nilesh.tayade@netscout.com">nilesh.tayade@netscout.com</a>&gt;<br>
&gt; wrote:<br>
&gt;         On Fri, 2011-01-07 at 13:05 +0530, Rajat Sharma wrote:<br>
&gt;         &gt; As I remember timer interrupt as well is an NMI so, it is<br>
&gt;         possible<br>
&gt;         &gt; (although not advised) to call schedule function while<br>
&gt;         holding<br>
&gt;         &gt; spinlock on same core.<br>
&gt;         &gt;<br>
&gt;         &gt; spin_lock_irqsave();<br>
&gt;         &gt; schedule();<br>
&gt;         &gt; spin_lock_irqrestore();<br>
&gt;         &gt;<br>
&gt;         &gt; however if you have debugging options turned on like<br>
&gt;         &gt; CONFIG_DEBUG_SPINLOCK, you may likely get kernel warning for<br>
&gt;         &gt; &#39;scheduling in atomic context&#39;.<br>
&gt;         &gt;<br>
&gt;         &gt; Then what can happen if this core is allowed to switched to<br>
&gt;         new<br>
&gt;         &gt; process? Consider the case where new process as well tries<br>
&gt;         to aquire<br>
&gt;         &gt; same spin_lock() which new process can not aquire and start<br>
&gt;         spinning<br>
&gt;         &gt; for the lock for ever :). Likewise, other cores will also<br>
&gt;         get locked<br>
&gt;         &gt; down.<br>
&gt;         &gt;<br>
&gt;         &gt; However stil you can detect softlockup through NMI watchdog.<br>
&gt;<br>
&gt;<br>
&gt;         &gt;&gt;Sorry if I am building up the confusion here. But as Dave<br>
&gt;         Hylands<br>
&gt;         &gt;&gt;initially mentioned, there will be no timer interrupt. So<br>
&gt;         shouldn&#39;t the<br>
&gt;         &gt;&gt;NMI watchdog get triggered then? No interrupts -&gt; system<br>
&gt;         freeze -&gt; NMI<br>
&gt;         &gt;&gt;Wdt reboot.<br>
&gt;<br>
&gt; In my opinion(uninformed ) NMI watchdog will be triggered only in case<br>
&gt; where you are holding a spinlock.It will not be triggered just because<br>
&gt; timer interrupts are disabled due to holding a spinlock.<br>
&gt;<br>
</div></div>No, what I meant is - we have masked all the interrupts before holding<br>
the spinlock (and not even getting the timer interrupts) so it&#39;s as good<br>
as system freeze. And we should trigger the NMI watchdog, isn&#39;t it?<br>
<br>
--<br>
Thanks,<br>
<font color="#888888">Nilesh<br>
</font></blockquote></div><br>