Re: Diff. between CPU Hard-lockup and Soft-lockup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi Devendra,

On Tue, Jan 31, 2012 at 1:28 AM, devendra rawat
<devendra.rawat.singh@xxxxxxxxx> wrote:
>
> Hi,
>
> What are the Differences between CPU Hard-lockup and Soft-lockup.

When the watchdog is enabled, there is a HW timer that counts down. If
the HW timer reaches 0, then it asserts (triggers an NMI or processor
RESET). Normally, the watchdog has something like a 30 second timeout,
and there is a watchdog thread which runs with a low real-time
priority. So that places it at a higher priority than all of the
normal threads.

The watchdog normally kicks (resets) the timer once per second. When
the timer reaches zero, then the hardlockup has considered to occur.
On some architectures, this will cause an NMI (non-maskable interrupt)
to fire. On architectures which don't support NMI, a reset will occur
(in the reset case you get no reporting of hard lockup - the processor
just reboots).

If the watchdog timer interrupt is running, but the watchdog thread is
not running for some period of time, then this is considered a soft
lockup. Because the watchdog timer interrupt is running, we know that
interrupts are enabled. The fact that the watchdog thread is not
running means either that context switching has been disabled, or some
interrupt or higher priority real-time thread is consuming 100% of the
CPU.

One common reason for hard-lockup is to disable interrupts and not
reenable them.
One common reason for soft lockup is when interrupts fire continuously
(typically happens when writing a new drive and you forgot to deal
with a particular interrupt source).

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Networking]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

Add to Google Powered by Linux