LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-27-2013, 02:00 PM   #1
animesh
LQ Newbie
 
Registered: Aug 2011
Posts: 7

Rep: Reputation: Disabled
why does too many printk hog the cpu ?


kernel documentation says:
" We try to grab the console_lock. If we succeed, it's easy - we log the output and call the console drivers. If we fail to get the semaphore, we place the output into the log buffer and return. The current holder of the console_sem will notice the new output in console_unlock(); and will send it to the consoles before releasing the lock."

Updating log buffer should not be high latency operation. However, flushing to console would have high latency based on how fast is console device. Is this the reason why cpu is throttled ? Anything else ?
 
Old 05-27-2013, 02:06 PM   #2
animesh
LQ Newbie
 
Registered: Aug 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
From printk implementation, I see that while updating log buffer and flushing to console, local irqs are disabled and spin lock is held. This means that if flushing operation is slow(console device is slow), preemption and interrupts would be disabled for longer time making the system sluggish.
Does this seam to be fair explanation of the question in hand ?
 
  


Reply



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
gam_server CPU Hog SqdnGuns Slackware 14 06-12-2019 01:27 AM
Flash CPU hog malloc Slackware 3 07-16-2011 01:49 AM
Opera CPU hog? SVwander Linux - General 3 10-11-2006 05:22 AM
frostrwire cpu hog lou Linux - Software 4 03-28-2006 08:36 AM
frosrwire cpu hog lou Linux - Software 2 03-26-2006 07:59 PM

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

All times are GMT -5. The time now is 01:20 AM.

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