Resolve similar bug:soft lockup-cpu#2 stuck for 67s! The idea of the problem

Source: Internet
Author: User

Writing a kernel program, there are soft lockup errors are more common, similar to the Bug:soft lockup-cpu#2 stuck for 67s!.

Just start debugging the kernel, this error, often two eyes a smear, do not know how to do. But actually, this kind of problem solves many, can discover the reason basically on two kinds of situations, deadlock and dead loop .

Therefore, in the presence of soft lockup error, do not panic, as long as the analysis of the relevant code is not a dead loop, such as for the exit conditions of the loop to cause the loop can not exit, and so on, or to analyze whether the relevant code in the use of locks incorrectly caused the deadlock. For example, spinlock nested calls can lead to deadlocks if the order is not correct, and so on.

In short, in the presence of soft lockup error, basically from these two reasons to find it. Even if other call trace is likely to be given in the core dump file, the two aspects are carefully analyzed to dispel to find the real cause of the problem.

<span style= "FONT-FAMILY:ARIAL,HELVETICA,SANS-SERIF;" ><span style= "White-space:normal" > About lockup we can simply understand. Lockup are divided into soft lockup and hard lockup. </span></span>
<span style= "FONT-FAMILY:ARIAL,HELVETICA,SANS-SERIF;" ><span style= "White-space:normal" ><strong>soft lockup</strong> Refers to a bug in the kernel that causes the time in kernel mode to loop longer than 67s (depending on implementation and configuration), while other processes do not get the chance to run. </span></span>
<span style= "FONT-FAMILY:ARIAL,HELVETICA,SANS-SERIF;" ><span style= "White-space:normal" ><strong>hard lockup</strong> occurs because all interrupts to the CPU have been blocked for more than a certain amount of time (a few seconds) In this case, the interruption of external devices can not be processed, the kernel believes that the so-called hard lockup occurred at this time, this situation may be caused by spin_lock_irqsave. </span></span>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.