> As I remember timer interrupt as well is an NMI so, it is<br>
> possible (although not advised) to call schedule function while<br>
> holding spinlock on same core.<br>><br>
> spin_lock_irqsave();<br>
> schedule();<br>
> 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'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"><<a href="mailto:nilesh.tayade@netscout.com">nilesh.tayade@netscout.com</a>></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>
><br>
><br>
> On Fri, Jan 7, 2011 at 1:19 PM, nilesh <<a href="mailto:nilesh.tayade@netscout.com">nilesh.tayade@netscout.com</a>><br>
> wrote:<br>
> On Fri, 2011-01-07 at 13:05 +0530, Rajat Sharma wrote:<br>
> > As I remember timer interrupt as well is an NMI so, it is<br>
> possible<br>
> > (although not advised) to call schedule function while<br>
> holding<br>
> > spinlock on same core.<br>
> ><br>
> > spin_lock_irqsave();<br>
> > schedule();<br>
> > spin_lock_irqrestore();<br>
> ><br>
> > however if you have debugging options turned on like<br>
> > CONFIG_DEBUG_SPINLOCK, you may likely get kernel warning for<br>
> > 'scheduling in atomic context'.<br>
> ><br>
> > Then what can happen if this core is allowed to switched to<br>
> new<br>
> > process? Consider the case where new process as well tries<br>
> to aquire<br>
> > same spin_lock() which new process can not aquire and start<br>
> spinning<br>
> > for the lock for ever :). Likewise, other cores will also<br>
> get locked<br>
> > down.<br>
> ><br>
> > However stil you can detect softlockup through NMI watchdog.<br>
><br>
><br>
> >>Sorry if I am building up the confusion here. But as Dave<br>
> Hylands<br>
> >>initially mentioned, there will be no timer interrupt. So<br>
> shouldn't the<br>
> >>NMI watchdog get triggered then? No interrupts -> system<br>
> freeze -> NMI<br>
> >>Wdt reboot.<br>
><br>
> In my opinion(uninformed ) NMI watchdog will be triggered only in case<br>
> where you are holding a spinlock.It will not be triggered just because<br>
> timer interrupts are disabled due to holding a spinlock.<br>
><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's as good<br>
as system freeze. And we should trigger the NMI watchdog, isn't it?<br>
<br>
--<br>
Thanks,<br>
<font color="#888888">Nilesh<br>
</font></blockquote></div><br>