Recovering Linux system from hung state via software

Peter Teoh htmldeveloper at
Wed Dec 4 03:04:28 EST 2013

On Fri, Nov 29, 2013 at 8:28 AM, Vipul Jain <vipulsj at> wrote:

> Hi Kernel alias,
> I am a newbie and I am trying to figure out ways where in I can recover the
> Linux in below two scenarios:
> 1. my specific process hangs.

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:

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).

> 2. kernel gets hung partially or completely.
> I have done some reading and seems like there is softlockup and hardlockup
> mechanisms in Linux source base that I can use but not sure, if yes I have
> below questions:
> 1. Which kernel version is minimum required for this?
> 2. How do I know that soft and hard lockup are enabled in my kernel?
> 3. How can I customize the behavior of default action that been taken?
> 4. Can I use these two lockup mechanism to find out if my process is hung
> or not?
> 5. Any pointers to any docs that can help will be appreciated.
> I will greatly appreciate any help here.
> Regards,
> Vipul.
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at

Peter Teoh
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Kernelnewbies mailing list