Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

kernel_task running wild!

Hi All,


I am currently running Lion on the new MacBook Air 2011 refresh (11", i7, 256 GB SD).


A problem started when I would plug my external hard disk into my Air to do a Time Machine backup. The kernel_task process shoots up to 100% cpu usage, and as far as I can tell, the external drive is never properly mounted by Lion and the Time Machine backup never begins. Even after unplugging the external drive, the kernel_task process still sits at over 100% cpu usage. Only a hard reboot (holding down the power button) allows me to reboot, and upon reboot the kernel_task process is no longer misbehaving (I'm only left with mds and other similar processes trying to fix my spotlight index for many hours). I had successfully backed up onto this external drive using Time Machine quite a few times already, and the problem doesn't always happen when I plug my external drive in. But when the problem happens, it's immediately right after I plug my external drive in. Nothing else is really happening on the laptop. All I have to do is plug my external drive in. Any ideas on what's causing this? Is this a Lion issue? Is this an Air issue? Is this simply my external hard disk?


Thanks to the community for any help. I've googled and read so many things regarding kernel_task cpu usage and none of them seem to apply to me. I don't seem to have the temperature issue everyone talks about.

MacBook Air, Mac OS X (10.7)

Posted on Aug 14, 2011 9:22 AM

Reply
125 replies

Nov 5, 2011 6:32 PM in response to ylluminate

I think ylluminate, you may be having a slightly different issue with the same symptoms. Eg your kernal_task cpu is caused by the IO blocking issue you describe where-as the OP has an issue with time-machine on encrypted backup disks.


I can state that I can reproduce the problem exactly as the OP describes.


I'm have a 17" MBP 8,3 w/ Lion 10.7.2 and have an external hard drive which I encrypted using Time Machine.

Its a 750GB disk with a majority partition of some 650GB devoted to time machine. The other partitions are one for Windows of < 50GB, and the remainder for a Linux partition + swap partition 50gb


Time machine goes to backup to an encrypted partition on a external usb drive. Its state says 'preparing backup' and stays their until I cancel.

At the same time, one virtual core of my i7 becomes pegged at 100% with system cpu activity. Activity monitor reports kernal_task using just over 100% of CPU. I can see its one core, using the menu-meters app.


The issue wont occur if I start the mac with the hard drive already connected, then kick off a TM backup. It will only occur if I plug in the disk after I've started it and then go to do so.


I think reporting to bugreport.apple.com is a fair idea though

Nov 8, 2011 7:55 AM in response to neversleepz

I think the real takeaway here is that Apple needs to add better kernel_taks logging output for us to ascertain issues. It's too much of a blackbox presently and even passing issues through gdb are extremely time consuming as there are too many moving parts generally to track an issue down without enormous time investments. When we get situations like this, it should offer a bit more verbosity in terms of what is going on so that we can isolate out what is actually happening and actually help Apple to resolve the issue. I think that's the bugreport that we should really file at this point.

Nov 9, 2011 4:13 AM in response to rodcha

It is more likely hardware than software.


So many of us using different software, on the same hardware - MBA have the same problem. I get it when I use Safari, Mail, iPhoto, iMovie, while doing a Time Machine Backup to a non-encrypted Time Capsue.


But ONLY on battery. (i.e. everything runs smoothly on AC, have you guys tried pluging in to AC?)


It's an energy saving thing beacuse the MBA batteries cannot deliver enough power for the processor and fans at the same time, should the demand for processor clock increase.

Nov 9, 2011 4:35 AM in response to colin N

@colinN What happens when the backup finishes? The problem described here keeps the kernal_task on high CPU AFTER Time Machine has done its work (or is cancelled) and remains pegged high until you reboot. Doesnt matter what apps you run. Is that what you are experiencing, or just slow perf when on battery?


My MBP is pretty beefy so I dont get the slowness but I am unable to keep the laptop in my lap once this starts as it gets very very hot when the one of the cores is pegged at 100%.


When I reboot with my USB plugged in, and can start a time machine backup without issue, my CPU doesnt peg.

Nov 9, 2011 4:45 AM in response to neversleepz

OK. I'm sorry, the slowness kicks in DURING backup. I'm getting this slowness on my MBA (Lion, latest gen) whenever:


  1. I'm on battery
  2. I'm doing more than one thing at a time: Mail+Safari OR iTunes+Safari OR Preview+Pages or a combination of these, making it even more disastrous! (or sometimes, just one thing, like watching a Youtube Video on Safari)


(Both conditions above fufilled. No problems on AC: I can render a video till it hits 90 degrees celcius and I don't get any slowness!)


I have a MBP that is never slow doing things. It gets hot, but whether on battery or AC, it is responsive. Sadly, no SSD there unless I upgrade.

Nov 9, 2011 5:05 AM in response to colin N

Yeah thats ok. My first thought was that it was slow because of disk IO, but then realised the MBA has an SSD in there!

The one thing I've noticed coming from PC land is that the Mac hides its power saving decisions. On a PC I could see and set what items (wireless, SSD, etc) went into power save mode and what level to put them on. If I had any issue with performance I could temporarily tweak it up. Its been good so far on OS X not having to worry about power management settings nor have to power saving settings from Economy mode but I can appreciate when the Mac is making bad decisions about how much power to use it can be frustrating to resolve.

Without wanting to distract too much from the original point of the thread, perhaps you can try:

  1. re-nice'ing the processes of the apps you are running so they have more priority cpu/time over the kernel_task (a windows/linux trick. dont know how you'd go about it on mac outside of the cmd line)
  2. find out how Mac does its power saving modes and tell it to stay in AC power mode
  3. find a tool or utility that disables or pauses time machine once you go on battery mode (google or start a new thread)

Good luck

Nov 9, 2011 6:01 AM in response to neversleepz

Yeah. You can't tell it what to do, it tells you what to do, and it has a mind of it's own.


I could re-nice the tasks, but I think nothing will override kernel_task

Perhaps we could see how they control the power. There's a coupple of AppleIntel kexts

You can disable Time Machine Auto backups by sliding the switch to "OFF" in System Preferences. I've already done that for some time, so I only backup when I'm going for a toilet break or a drink. (i.e. not doing anything else for a while)

Feb 29, 2012 4:43 AM in response to snow_bunny

same-same on my mbp8,3. i had'nt used the backup for a while and my kernel_task was always around 35-40%. after reading all that infos regarding kernel_task behaviour i found that nothing of all the suggested solutions worked for me.


as the only change since my kernel_task wen wild was switching off time machine i switched timemachine on again and used a different external drive as backup volume and did a backup.


my kernal_task behaves again... taking .5 to 1.5% max.


so for me the problem clearly was related to my backup situation.

Mar 14, 2012 8:49 PM in response to snow_bunny

I have a MBA and a connected 27" Cinema Display. The Activity Monitor shows the Kernel Task taking over 300% of CPU% at times. This seems to happen only after the MBA has been running for a while. From Googling this problem and looking at how my Mac behaves I think this is a problem due to CPU overheating: The CPU on an MBA works harder when an external display is connected. Likewise I would guess that other processor intensive tasks (encryption, video editing, and - Steve Jobs was right - Flash processing!) trigger this condition. Initially I solved like everyone else, by restarting the MBA. If I don't connect the external display the condition does not seem to occur, or at least the Kernel Task is not appropriating too many CPU cycles.


Having said this, when I reconnected the monitor and the problem arose again I followed Damitri's advice and clicked on the Inspect button in the Activity Monitor: the problem went away immediately (thanks Damitri). I suspect this resets a variable somewhere, and the Kernel Task runs out of control because of a bug in the OS that Apple hasn't fixed yet.

kernel_task running wild!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.