LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-01-2018, 10:03 AM   #1
bharathm1
LQ Newbie
 
Registered: Jun 2018
Posts: 5

Rep: Reputation: Disabled
Does linux kernel try to recover from CPU stall?


Does Linux OS have any way to recover from problems that stalled CPU causes. By stalling CPU I mean a kernel thread that is not yielding a CPU in a non preemptible kernel (possibly a buggy kernel module).

Problems it may cause include lost CPU resource if it is a buggy process not doing any useful work. So does Linux forcefully yield such kernel thread or kill such kernel thread if it detects it is stalling for long long time

Some other problems I faced when one kernel module stalls CPU is that some functionality doesn't work. e.g., sudo,echo didn't work for me.

I am running a 2-core UBUNTU machine with 2 GB ram and ran a kernel module that does while(1)

Last edited by bharathm1; 08-01-2018 at 10:05 AM.
 
Old 08-01-2018, 02:52 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,373

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
From what I recall of the kernel config, there is/was a watchdog in there? Sounds like what you want.
 
Old 08-02-2018, 12:57 AM   #3
bharathm1
LQ Newbie
 
Registered: Jun 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Watchdog helps in detection of a soft lockup in CPU, but I want to know what Linux does when it detects there is a soft lockup causing by some kthread.
 
Old 08-02-2018, 03:43 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,373

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
The traditional watchdog throws the cpu a reset (back in the primitive era). In primitive era industrial controllers, that was fine. I presume the kernel watchdog is a bit more sophisticated, but you'd want to read the options you have. You may also be able to do something by regularly checking top and grepping for that particular process; then kill it if it gets too busy.

Can't you restrain it with nice? From the problems you mention I gather you're writing software, not running a server? If you're having lockups, you may need a watchdog card, to have some monitoring intelligence at your disposal. There are some kernel hot keys, and you should look them up.
 
Old 08-02-2018, 04:35 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Non-preempt kernels are non-preemptible. Period.

This is how 2.4 was, and why preempt was introduced.
 
1 members found this post helpful.
Old 08-30-2018, 05:15 PM   #6
Ron Vaughan
LQ Newbie
 
Registered: Nov 2009
Location: Boston
Distribution: Fedora 34
Posts: 12

Rep: Reputation: 0
Fedora 29 not finishing boot

I have beeun enjoying fedora 29 recently on my Toshiba laptop. Plenty of memory and HD space. I did a sudo dnf update as I often do, however this time it does not finish. It seems to be doing the update but hangs on the "Watchdog did not finish". I get this message when I am forced to hit CTL_ALT_DEL to restart. At that point I see a quick message appear briefly "Startin Hold until boot process finishes up... " - Previous updates have worked fine.
Not sure how I can get by this hold.
Suggestions or ideas would be appreciated.
~ Ron
 
Old 08-30-2018, 06:29 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
You should really have started a new thread - but try adding "nowatchdog" to the kernel parameters.
 
  


Reply

Tags
kernel module, linux, recovery, stall



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
System Stall [kernel > 2.6.24.5] dlinux Slackware 5 09-13-2008 04:51 PM
Downloads stall after kernel update cidrolin Linux - Networking 4 08-31-2004 09:06 AM
Linux Kernel Problem -- Kernel panic: CPU context corrupt crcooney Linux - Distributions 0 01-15-2004 08:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration