SOLVED: Macbook Air kernel_task slowness

I love my Macbook Air more than I've loved any laptop before (my first experience with a 12″ iBook in 2005 was a thing of beauty, but pales in comparison to my relationship with my Air). However, its CPU throttling to prevent heat drives me batty due to its aggressiveness — play a Flash video, for example, for a few minutes and it will start stuttering as the CPU temperature rises. Let it continue and the entire computer will slow to a crawl. If you open Activity Monitor or look at top, you'll see a process owned by root called 'kernel_task' using 150% CPU usage or so. Kill the Flash video and the kernel_task will slowly scale back and things will return to normal.

What's going on here is an interesting approach to temperature management. As temperature rises due to load on the CPU, the kernel runs some low-cost operations over and over — think 'gettimeofday()'-style functions. Since the kernel has top priority, system CPU usage spikes while userland CPU usage is forced down, lowering the actual activity that the CPU is doing and thus lowering the temperature. A decent idea, I guess, but in practice it's way too aggressive.

Luckily, doing a bit of digging in /System/Library/Extensions, I came across an extension called 'AppleIntelPenrynProfile.kext' that, looking at the Info.plist, ties into power management and performance monitoring — the IOClass is 'AppleIntelPenrynPerformanceMonitor' and the IOProviderClass 'AppleACPICPU'.

This kernel extension is loaded on boot into userland, but interestingly, if you boot into safe mode (hold shift during boot), it is not loaded — and the kernel_task CPU spikes don't occur, even under heat-generating load. You can verify this by running `kextstat', which lists all loaded kernel extensions — run it in Terminal while booted normally and you should see an extension called 'com.apple.driver.AppleIntelPenrynProfile' loaded. Boot into safe mode by holding down shift before the chime and run `kextstat' again — no com.apple.driver.AppleIntelPenrynProfile, and no kernel_task CPU spike when generating heat (play a Flash video).

So… why load that module at all?

Back in normal OSX, launch Terminal and run the following:

cd /System/Library/Extensions/AppleProfileFamily.kext/Contents/PlugIns
sudo kextunload AppleIntelPenrynProfile.kext

Verify it's unloaded:

kextstat | grep Penryn

This should return no output if the module was successfully unloaded. Now, go play a Flash video and enjoy a less-crippled Air!

* Disclaimer: I take NO responsibility if you brick your Mac, it catches on fire, never boots again, or otherwise break. I've had no problems and it's been working quite well, but your experience/hardware/whatever may be different.

** Disclaimer 2: I highly recommend running SMCFanControl and pushing your fans to max when running heat-intensive operations. I do not recommend running your Air at 80ºC or hotter for extended periods — the kernel will no longer discourage this activity by slowing things down. It's unlikely that you will fry your CPU due to extensive hot use, as the CPU's thermal shutdown is lower than its point of combustion, but this doesn't mean you should push that threshold.

*** Disclaimer 3: The Penryn profile is for the Rev 2 Macbook Airs. Rev 1 is Merom, with the extension called AppleIntelMeromProfile.kext.

17. July 2010 by kale
Categories: howto | Tags: , , | 22 comments

Comments (22)

  1. I experienced this issue and my experience with apple-care was strange.

    First I was asked to mail my laptop in with geek squad being told their techs were apple trained.
    My laptop was returned in worse shape then sent with the kernel task still an issue (of coarse)

    It took me days to reach apple again, no e-mail was responded to and the extensions I had were all dead. Geek Squad got back to me quicker. When apple finally replied they asked me to mail it in again. I insisted on a store visit (closest store is 2 hours away)

    When I arrived the store did not have my reservation. They then insisted that sending my laptop into geek squad meant nothing and I would have to send it in again and this time it received level 4 tech support (they replaced nearly everything except the keyboard and hard drive)

    Within 30min I was able to replicate the kernel task issue.
    After a little phone tag with the very helpful genius who was assisting me in the store (I gave up on the extensions) Informed me that after talking to an engineer internally that it is indeed a design into the laptop and was a 'safety feature'

    My response was if a new car lost 75% of its power to preserve cooling it needs a bigger radiator.

    In short they replaced my 2nd gen macbook air with a new 2010 13″ Macbook pro. Apple took care of me so I'm happy but if they hadn't I couldn't see myself buying another apple.

  2. Thanks for the post. Mac newbie with the same problem. I have the MBA RevA, and I did it with Merom. Even after the kextstat | grep showed the command had succeeded, I went back to CPUTest and kernel_task was still present and gobbling 30% CPU, though it didn't appear to be going as high (into the 150% range).

    After a reboot, the Merom profile was loaded again a startup script is needed. However, in the meantime, I used CoolBookController, and this seemed to do a better job of preventing kernel_task from taking over.

  3. Oh. My. Fucking. God.

    How I wish I had seen your post say… two years ago now? Well, okay, let's make it one year, since you only posted it that long ago. I'll say this however: not having seen your post has led me through journeys indescribable, with my present position being oh, COMPILING MY OWN FUCKING KERNEL TO STOP THE SHIT.

    So, if I survive the sawn-off shotgun blast to the t'roat that I'm about to do to relieve this sudden headache I got out of fuckin' nowhere now (… weird, no? I mean I sometimes get a pain when I do something or feel really dumb, but this is waaay worse…), i will post back and let you know how it went on my Rev A.

    If it works, I will hump your leg forever while licking my face.

    Or, you know, just say "Thanks".

    It's one of those, but for the fuck of me, I can't think straight … just……… now…………….

  4. Hi,

    I was so hopeful finding your article here, but upon looking for AppleProfileFamily.kext, it wasn't in extensions at all. Nothing by that name was.

  5. The original article was posted over a year ago; updates to Snow Leopard and Lion, as well as new Macbook Air hardware, have sort of rendered it obsolete. Sorry :( Honestly, I gave up on my old air and gave it to my mother-in-law, moving on to a new 11″ Air myself. It doesn't have the same problems as the old ones in terms of heat. Alternatively, and this may sound silly, but try upgrading your Flash to the latest, Flash Player 11. It has much, much better hardware support and makes an astounding difference in performance.

  6. Fix MacBook Air kernel_task fix on Lion 10.7.3 (use these instructions as your own risk).

    Before you do this, note that I recommend you max your fax using smcFanControl and if you've got an old system and if you are capable, open the bottom cover and clean the fan super-well using compressed air. I also run my MacBook Air on a Belkin USB-powered laptop lap desk with a built-in fan. You are about to unleash this CPU to its maximum, so keep everything as cool as you can or else you might burn up the CPU and/or mainboard.

    I spent over 80 hours of my personal time figuring this out, so if my fix works for you, and if you feel like blessing me, send me a PayPal at chuck straughn at me dot com. No obligation, but anything you do helps me and my family. If these instructions are too technical for you, contact me and I'll do it for you for a small fee if you can afford that, otherwise I'm happy to help you for free and share the love.

    1) Open System Information (under Apple icon in upper-left, click About This Mac, click More Info)

    2) Click System Report button, under Hardware, find your "Model Identifier" -remember this for later use

    3) Navigate to /System/Library/Extensions an right-click, Show Package Contents of IOPlatformPluginFamily.kext

    4) Open Contents/PlugIns and Show Package Contents of ACPI_SMC_PlatformPlugin.kext

    5) Open Contents/Resources

    6) Find your MacBookAir?_?.plist (? = your model identifier from step 2) and delete the file

    7) Reboot! Remember, anytime you do a System Update, you may need to repeat this process

  7. I had a similar problem on an 2011 13″ MBA 4,2 & 10.7.3 Lion

    Removing IOPlatformPluginFamily.kext and rebooting solved this issue for me…

  8. Deleting this plist file solved the issue for me. Many thanks!

  9. Thanks for the post, I had this problem for ages and none of the posts I've seen linked the activity of kernel_task to the temperature. It makes more sense now, so just have to have fewer apps open. Thanks again

  10. Thank you so much Chuck! That worked perfectly for me. I have a 8.2 (2011) macbook pro 15 in which kernel task takes up 280% of the processing power when for example it's charging, many tabs open, connected to an external display, or in Aperture. Your fix has worked so far for the last 8 hours, i even tried to stress the computer by connecting an external display, playing several hd flash files, an mkv file, opening aperture etc. and the kernel task never spiked.
    I don't quite understand why this .kext was related to it, but deleting it worked, and for the record, this isn't only for macbook airs!

  11. I had the same problem, with sloooooooooooooooooooow boot and kernel_task using 120% cpu time.
    I solved simply clearing the PRAM at boot (option-cmd-P-R).
    After doing so the problem disappeared and didn't returned till now (2 months).

  12. Finally a usable Macbook Air. Thank you so much! My book never climbs past 71 C with this fix and I have put it through the numerous tests. I did so much searching until I finally found this fix, what a relief. Thanks Again.

  13. Glad the fix keeps working. Mads asked how the .kext was related so I'll explain. Basically the OS has a profile for every CPU type. That profile tells the OS when the CPU is being over-used and needs to be throttled back for CPU-life sake. The IOPlatformPluginFamily.kext for the CPU defines, based on the CPU model, at what usage thresholds the CPU should be throttled back. The mechanism Apple uses to throttle the CPU back is the kernel_task process increasing (which is basically an idle task that eats up the CPUs ability to do real tasks and thus throttles back the CPU). So when you remove the appropriate IOPlatformPluginFamily.kext file, the OS no longer understands when it should throttle back the CPU and thus it leaves the CPU running all the time. This can be a bad thing in the sense that opening up your CPU to hot and heavy usage can burn it up (in theory) and that's why Apple throttles it back. But my perspective is that I'd rather have a fried computer that worked for some time than a cool laptop that doesn't work at all because it's always having to be idled back. Amen?!?! Anyhow, thanks for the feedback.

  14. I cannot erase the file.. i dont get the option. help pls! im desperate!

  15. I bought a Mid 2010 13″ MBP from a guy on Craigslist (I know , don't say a word) He must have had it booted into he "Safe Mode" because when I checked it out it was working When I got home and turned it on it was a mess and the CPU was running at 189%

    I took it to the Genius bar in Chandler AZ and they looked at the history on it and it had water damage. They ran their diagnostics it was always the same response. Due to the water damage you have hardware issues. You can leave it and we will do a recondition for 750.00 ( more than I paid) I tried 3 different gust over 48 hrs and each had their own version of that story (They tried though) After doing a little investigating and realizing that in the safe mode it ran quite well I figured it might me a software issue and thus I ended up here. The unit is running well by following the instructions above and its not an expensive paperweight anymore.

    The one issue I am still having is it wont install Mnt Lion OSX 10.8 now and gets hung up where it says "Now Installing….. 34 minutes to go" and never leaves that screen….any ideas as to why

    I would like to thank Chuck for his work. The issue described was exactly what I was experiencing his fix worked great

  16. Thank you so much Chuck Straughb . I got rid of this annoyance.

  17. Thanks a lot mate.. worked like a charm.. u have done a remarkable job.. however my issue is that the fan is running at 6200 rpm continuously. Is it a problem if my fan keeps working continuously?

  18. I have a MBP (15″ late 2011 i7, 8Mb RAM running OS X Lion) that has been slow since i got it. Slower than my 3 yr old samsung laptop with mere dual core and 4G RAM. I found this website after looking into the activity monitor and seeing that with no programs open, this kernel_task thingy is using between 600-800Mb real memory. Here is my question: The CPU usage was not high. Does the CPU usage need to be high for this kernel_task to be causing a problem? I don't want to jeopardize the CPU by performing the fix, if it isn't the problem. Also, has anyone upgraded to Mountain Lion to see ifthis is still going on with the upgrade? I have been regretting switching to Mac like you would not believe. If I could fix this, I would be so much less miserable!! Thanks!

  19. Spilled liquid on my macbook air and cleaned it really well. Basically works on AC power but nothing on the battery. When on AC power the kernel was hitting up to 300+% usage. Basically thought my computer was shot.

    This method worked and now I can use my computer completeley normal when on AC power.

  20. My 2011 MBP15 4x-i7-2.3 -- MacBookPro8,2 just went nuts last night and the kernel_task started eating up 650% CPU. The temperature didn't go up at all. Nothing went over 122ºF. I thought I would end up using this detailed tutorial.

    One of the commenters, w4lly, said they fixed their problem by zapping the PRAM. I held those famous keys down five times, then let it boot completely. The kernal_task was gobbling up 689% now. I pulled the plug in frustration (the battery is currently showing an "X" in the menu status because it's totally dead so the machine turns off completely) and shut the lid. I just booted up this morning to test it some more and the problem is now solved. Kernel_task is running at a kin 13-19%.

    I'm glad I found this post and I'm glad that I read the comments. I'm also happy to hear, the more complicated fix is working for other people. Thanks to everyone for offering to share your experience.

  21. Thank you so much, you are the man! Worked for 2011 MBP OSX 10.7.5

  22. Chuck, you are the man…

    Have a Macbook Air 1.86 GHz Intel Core 2 Duo and attributed the extreme slowness when running on AC power (worked fine on battery) to the numerous times my son had thrown the airbook off the couch.

    Deleted the .plist file and rebooted and now its working like new. So happy that I can use it again while charging (what a pain that was for the past year!) Wish I had come across this article a long time ago. Thanks again (I can only imagine how many other mac users are just living with this…)

Leave a Reply

Required fields are marked *