2012-12-30

[Technology] kernel_task consumes almost 100% of CPU on Mac OS X


The Problem


A friend spilt tea on their MacBook Air and this has probably killed their battery.  In an attempt to see if it was just a firmware problem, they attempted an SMC reset, which resulted in their computer becoming incredibly slow (and the battery still not working).  Reviewing CPU usage showed that kernel_task was opaquely consuming all available CPU cycles.  Oh nos!



(spoiler: this post does not end in a working battery, just in eliminating the excessive CPU usage)


Possible solutions


I googled a bit.  Some people recommended trying a PRAM reset (which did nothing (to do it, use command + option + P + R at boot after the tone, until you hear a second tone)).  Starting up in safe mode to see if disabling all non-core kernel extensions helped did not (to do that, hold shift at the start up tone until the grey Apple logo appears).   Finally, someone suggested disabling one of the plists for power management in one of the kernel extensions.  The idea there was that the kernel thought the computer was overheating and was trying to take misguided measures to deal with it that resulted in total CPU consumption (and more heat).  I thought this might be relevant, not due to heat, but because a part of the device was no longer working, and perhaps the kernel didn't understand and was making a bad decisions.


The solution


This turned out to be the right idea.  Under /System/Library exist many kernel extensions, and the relevant one is the IOPlatformPluginFamily.kext.  There suggestion was to disable the plist for your model of computer that was located in that kext's Contents/PlugIns/ACPI_SMC_PlatformPlugin.kext (a sub kext!).  First, his MacBook Air didn't have a relevant plist, and second, disabling that entire kext (simply by renaming it to something else so Mac OS X wouldn't find and load it) did not help.



I then tried disabling IOPlatformPluginFamily.kext altogether, and it worked!  Thinking that a bit too brutish, though, I re-enabled it, and tested disabling a variety of its sub kernel extensions (under /System/Library/IOPlatformPluginFamily.kext/Contents/Plugins) to see which one was the culprit.



Here are the sub kernel extensions within IOPlatformPluginFamily.kext:


  • ACPI_SMC_PlatformPlugin.kext

  • AppleSMCPDRC.kext

  • IOPlatformPluginLegacy.kext

  • X86PlatformPlugin.kext

  • X86PlatformShim.kext   < this is the one I had to disable.



Steps


Here are the steps for disabling them.  Pardon any errors, as I'm doing this from memory and photographs after the fact.



1. Open a Terminal (Applications > Utilities > Terminal).  This took a dreadfully long time, given how slow the computer was running.

2. Run these commands (text precede by a # is just a comment)

> cd /System/Library/IOPlatformPluginFamily.kext # enter main kext directory> cd Contents/Plugins  # enter kext's plugins (other kexts)

> ls  # list the available kexts

ACPI_SMC_PlatformPlugin.kext
AppleSMCPDRC.kext
IOPlatformPluginLegacy.kext
X86PlatformPlugin.kext
X86PlatformShim.kext


> sudo mv X86PlatformShim.kext X86PlatformShim.kext.disabled # rename the culprit .kext (after trial and error) to something different so it can't be loaded (doesn't need to add .disabled specifically); start  with sudo to do this as the root user (or you won't have permission); this will request your user password

3. Then, restart your computer to see if it works.



You should be able to actually rename /System/Library/IOPlatformPluginFamily.kext as a quick test to start to see whether a problematic .kext exists within it, and then try this (or maybe ACPI_SMC_PlatformPlugin.kext's specific plist, depending on your actual problem) to be more specific (who knows, some of the plugins might actually be there for a reason ;). 

Keine Kommentare:

Kommentar veröffentlichen

Dieses Blog durchsuchen

Labels

#Technology #GNOME gnome gxml fedora bugs linux vala google #General firefox security gsoc GUADEC android bug xml fedora 18 javascript libxml2 programming web blogger encryption fedora 17 gdom git libgdata memory mozilla open source serialisation upgrade web development API Spain design emacs evolution fedora 16 fedora 20 fedora 22 fedup file systems friends future glib gnome shell internet luks music performance phone photos preupgrade tablet testing yum #Microblog Network Manager adb art automation bash brno catastrophe containers css data loss deja-dup disaster emusic errors ext4 facebook fedora 19 gee gir gitlab gitorious gmail gobject google talk google+ html libxml mail microsoft mtp namespaces nautilus php picasaweb podman ptp resizing rpm school selinux sms speech dispatcher systemd technology texting time management typescript uoguelph usability video web design youtube #Tech Air Canada C Empathy Europe GError GNOME 3 GNOME Files Go Google Play Music Grimes IRC Mac OS X Mario Kart Memento Nintendo Nintendo Switch PEAP Selenium Splatoon UI VPN Xiki accessibility advertising ai albums anaconda anonymity apache apple ask asus eee top automake autonomous automobiles b43 backup battery berlin bit rot broadcom browsers browsing canada canadian english cars chrome clarity comments communication compiler complaints computer computers configuration console constructive criticism cron customisation dataloss dconf debian debug symbols debugging design patterns desktop summit development discoverability distribution diy dnf docker documentation drm duplicity e-mail efficiency email english environment estate experimenting ext3 fedora 11 festival file formats firejail flac forgottotagit freedom friendship fuse galaxy nexus galton gay rights gdb german germany gimp gio gjs gnome software gnome-control-center google assistant google calendar google chrome google hangouts google reader gqe graphviz growth gtest gtg gtk gvfs gvfs metadata hard drive hard drives hardware help hp humour identity instagram installation instant messaging integration intel interactivity introspection jabber java java 13 jobs kernel keyboard language languages law learning lenovo letsencrypt libreoffice librpm life livecd liveusb login macbook maintainership mario memory leaks messaging mounting mouse mysql netflix new zealand node nodelist numix obama oci ogg oggenc oh the humanity open open standards openoffice optimisation org-mode organisation package management packagekit paint shedding parallelism pdo perl pipelight pitivi privacy productivity progress progressive web apps pumpkin pwa python quality recursion redhat refactoring repairs report rhythmbox sandboxes scheduling screenshots self-navigating car shell signal sleep smartphones software software engineering speed sql ssd synergy tabs test tests themes thesis tracker travel triumf turtles tv tweak twist typing university update usb user experience valadoc volunteering vpnc waf warm wayland weather web apps website wifi wiki wireless wishes work xinput xmpp xorg xpath
Powered by Blogger.