<br><br><div class="gmail_quote">On Thu, Jan 19, 2012 at 10:54 PM, Dave Hylands <span dir="ltr">&lt;<a href="mailto:dhylands@gmail.com">dhylands@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi,<br>
<div class="im">On Thu, Jan 19, 2012 at 7:26 AM, Mulyadi Santosa<br>
&lt;<a href="mailto:mulyadi.santosa@gmail.com">mulyadi.santosa@gmail.com</a>&gt; wrote:<br>
&gt; Hi again :)<br>
&gt;<br>
&gt; On Thu, Jan 19, 2012 at 16:03, Darshan Ghumare<br>
&gt; &lt;<a href="mailto:darshan.ghumare@gmail.com">darshan.ghumare@gmail.com</a>&gt; wrote:<br>
&gt;&gt; What if, there is one process which is in middle of a syscall which has<br>
&gt;&gt; infinite loop in it received SIGKILL &amp; there are no other processes in the<br>
&gt;&gt; system?<br>
&gt;<br>
&gt; infinite loop such as &quot;for(;;)&quot; ? well as long as it doesn&#39;t disable<br>
&gt; or masked out the timer interrupt, sooner or later timer interrupt<br>
&gt; will kick in. It then followed by the usual tick handler. Inside it,<br>
&gt; IIRC, will provoke the current running process to check queued signal<br>
&gt; and handle it.<br>
<br>
</div>If the process was in an infinite loop in user space, what Mulyadi<br>
says is true. If it were a real-time process in an infinite loop then<br>
it might very well be unkillable (unless there is a higher priority<br>
thread which can do the killing).<br>
<br>
My understanding is that in kernel space signals only get handled when<br>
you run into code which specifically deals with signals. All of the<br>
syscalls are wrapped with such code. So, if you&#39;re in an infinite loop<br>
in kernel space, then you&#39;re in essentially the same situation as<br>
doing a non-interruptible down which never completes.<br>
<br>
If the kernel were to kill the process just because a preemption<br>
occurred (while in kernel space) then you would very often be killing<br>
processes which are currently holding a semaphore or something and<br>
leaving the kernel in a potentially unstable state.<br>
<br>
There is always at least one runnable thread, called the idle thread.<br>
There is an idle thread for each CPU.<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div>What if,</div><div>spin_lock_irqsave(&amp;lock, flags);</div><div>for ( ; ; )</div><div>{</div><div>       ;</div><div>}</div><div>spin_lock_irqrestore(&amp;lock, flags);</div>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
--<br>
Dave Hylands<br>
Shuswap, BC, Canada<br>
<a href="http://www.davehylands.com" target="_blank">http://www.davehylands.com</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>DarshanŽ<br>