<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 29, 2013 at 8:28 AM, Vipul Jain <span dir="ltr"><<a href="mailto:vipulsj@gmail.com" target="_blank">vipulsj@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">Hi Kernel alias,</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">I am a newbie and I am trying to figure out ways where in I can recover the</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">Linux in below two scenarios:</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">1. my specific process hangs.</span></div>
</blockquote><div><br></div><div style>how to recover i cannot tell you, because it is application specific (but best is to design your system to reboot completely. eg temporary stuff or files should be stored in memory - eg, tmpfs, and rebooting will be all "gone", not erased and removed securely, but logically "gone"). And how to detect that is this:</div>
<div style><br></div><div style>assuming one mother process is monitoring 10 child process, so inside each child process, simply just setup a PERIODIC (eg, per 5 sec) mechanism to toggle a binary variables through IPC means. It will be reset when the mother process go around checking all the variable status and, if not reset it therefore implies that the particular process might be hung. it can wait further, or continue checking other process. at the end of checking ALL the process, if everything is OK, it should feed the kernel watchdog timer. if the kernel watchdog timer is not reset, the kernel module will then reboot the system. (ie, reboot is from kernel module).</div>
<div style> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">2. kernel gets hung partially or completely.</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">I have done some reading and seems like there is softlockup and hardlockup</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">mechanisms in Linux source base that I can use but not sure, if yes I have</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">below questions:</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">1. Which kernel version is minimum required for this?</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">2. How do I know that soft and hard lockup are enabled in my kernel?</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">3. How can I customize the behavior of default action that been taken?</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">4. Can I use these two lockup mechanism to find out if my process is hung</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">or not?</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">5. Any pointers to any docs that can help will be appreciated.</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">I will greatly appreciate any help here.</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">Regards,</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">Vipul.</span><br></div>
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Peter Teoh
</div></div>