[How to] Solve problem with Intel graphics caused by high CPU usage of Kslowd / Kworker – Linux kernel 2.35 – 3.8

EDIT on 05/11/2013: On Kernel 3.8.x you may have to add echo N> /sys/module/drm_kms_helper/parameters/poll to /etc/rc.local (before exit 0) to fix the issue.

EDIT on 05/21/2013: On Kernel 3.8.x – 3.9-rc5 a regression causes an irq storm from the i915 and the drm polling parameter is somehow ignored, and the suggested fix won’t work anymore. If you are experiencing the issue:

1) Downgrade to a different kernel, preferably 3.2.x

2) Add echo N> /sys/module/drm_kms_helper/parameters/poll to /etc/rc.local (before exit 0) OR add drm_kms_helper.poll=0 to grub boot parameters, to bring your system back to sanity.

This is just a workaround, track the issue here: https://patchwork.kernel.org/patch/2400621/

–Original post–

Some minor issues with the Linux kernel release starting from version 2.35 causes the X-Server on the system to perform miserably. I started experiencing the problem ever since I upgraded to kernel 2.35. It became almost impossible to use by laptop so I’m summing all the information I gathered from various Bug reports.

And yeah, the solution to it of course 🙂

Affects: Lots of computers with the Intel Graphics Accelerator

Issues:

  • Kernel 2.35* : Mouse freezes intermittently some time after boot up. Keyboard activity is good. This results in an almost unusable desktop environment. Top will report the high CPU usage by 3-4 processes named – kslowd000, kslowd001, kslowd002 …
  • Kernel 2.36* and beyond : Mouse freezes some time after boot up. This is more like a permanent freeze and system activity is impossible. Only solution is to reboot but it’s just a matter of a moment that the problem will come back.

Fix:

  1. Type ‘uname -a’ to the shell to find out the version of kernel you are using. uname will return something like:
     Linux souri.razr 2.6.36.1-11.fc15.i686 #1 SMP Fri Dec 3 12:38:48 UTC 2010 i686 i686 i386 GNU/Linux
  2. Here 2.6.36.1.-11 shows which version of kernel I’m using right now.
  3. For those of you using some kernel that has version 2.36.* proceed to step 5.
  4. For those of you using kernel 2.35.* , a kernel upgrade is required. Nothing to be scared of! Just need to type in:

    #yum update kernel [in Fedora] OR #apt-get upgrade #apt-get install kernel [in Ubuntu]
  5. This should update your kernel to the latest version that your distribution provides. Uname should now report a kernel version >=2.36.The update to kernel >=2.36 is essential because it enable a feature to disable the DRM_KMS_POLLING feature of the kernel. It is bot possible to disable DRM_KMS_POLLING for the 2.5 kernel. Maybe in some future bug-fix release of the 2.35 kernel they are going to patch this.
  6. Reboot your system with the new kernel.
  7. Open shell and become root.
  8. Type #echo N> /sys/module/drm_kms_helper/parameters/poll This should drastically reduce the system load and put your system back to normal.
  9. Note that this will only be sustained till system reboot. After reboot the value will revert back to poll=Y
  10. For a sustained effect:  #echo "options drm_kms_helper poll=N">/etc/modprobe.d/local.conf

Hope this will help your woes. Enjoy! Please post any problems you may experience.

Also, kindly post the output of your uname -a, in case this helped you.

Advertisements

61 thoughts on “[How to] Solve problem with Intel graphics caused by high CPU usage of Kslowd / Kworker – Linux kernel 2.35 – 3.8

  1. Hardware Detection - Problems

    • I appreciate the valuable feedback 🙂 I can’t figure out why the persistent behaviour is not achieved.

      However a forced workaround can be done by adding the line:

      echo N> /sys/module/drm_kms_helper/parameters/poll

      to the file: /etc/rc.local

      I’ve tried it in a a friend’s system. Works great 🙂 I believe it will serve you people just fine. Let me know.

  2. Thank you so much, I was about to give up on using Linux on my TP 😦

    Your solution works well for me, except for the long term solution. On my Ubuntu 11.04 with kernel 2.6.39 it’s not enough to write options drm_kms_helper poll=N
    to /etc/modprobe.d/local.conf.

    • I appreciate the valuable feedback 🙂 I can’t figure out why the persistent behaviour is not achieved.

      However a forced workaround can be done by adding the line:

      echo N> /sys/module/drm_kms_helper/parameters/poll

      to the file: /etc/rc.local

      I’ve tried it in a a friend’s system. Works great 🙂 I believe it will serve you just fine. Let me know.

  3. Thx dude, that solved my problem. Having 2.6.38-11-generic-pae #48-Ubuntu SMP Fri Jul 29 20:51:21 UTC 2011 i686 i686 i386 GNU/Linux

    Cheers
    Andre

  4. Confirmed on a T400 — it has always been bad but after a recent update to 2.6.38-11-generic-pae the system became completely unusable. This fix works as advertised and should be spread far and wide.

    I’ve always purchased Thinkpads specifically for their better than average linux support so this one was highly irritating indeed.

  5. Bad Performance using Thinkpad X200, Arch Linux and X

  6. Oh jeeze… Thank you! I’ve been looking for a way around this bug for ages. It’s not particularly bad on my two Intel chipset machines, but the cursor lag is quite annoying.

    I’ll note though that, as far as I can tell, KMS polling (whatever it is) is still enabled by default in the latest kernel version. I really have to wonder why… As far as I can tell, turning it off does not compromise functionality at all.

  7. Processo “kworker” deixando seu computador inutilizável?

  8. I have Debian running on a mid-2011 Macbook Air (4,2) and I was seeing this problem with 3.1 and 3.2-rc kernels. It was driving me crazy. This solved it completely. Thanks!!! With this Debian is running very well.

  9. Cheers. This solved a problem I faced today where my laptop was continously laggy because of that stupid module. Now, since I applied that fix you wrote about, it’s all good! 🙂

    Thanks again.

    PS. Kernel version what this happened on:
    Linux FedoraM200 3.1.0-7.fc16.i686 #1 SMP Tue Nov 1 21:00:16 UTC 2011 i686 i686 i386 GNU/Linux

  10. Great

    echo N> /sys/module/drm_kms_helper/parameters/poll

    solved the problem in my T400 with kernel 3.0.0-12-generic Ubuntu SMP

    thx

  11. That’s a perfect solution for Mouse Freezing and Kworker issue.
    It is working perfectly after fixing with the suggested changes.

    Many many thanks.

  12. Hey, thank you very much! i’m using 3.2.0-17-generic kernel. But Is there any solution for always? Sorry for my english..!

  13. I have used this solution on a T400 and found that the contents of the poll file revert spontaneously to ‘Y’ after a day or so. I will make a cron job that pokes ‘N’ into it every so often.

    It’s great that such an easy solution is available, but it seems odd that the kernel folks have allowed it to persist across so many releases.

  14. Thank you so much, resulted in my newly installed ubuntu 12 🙂 was to give up but luckily I found your post …
    once again thank you!

    Linux nelson-ubuntu12 3.2.0-24-generic-pae #37-Ubuntu SMP Wed Apr 25 10:47:59 UTC 2012 i686 i686 i386 GNU/Linux

  15. Ubuntu 12.04 precise, kernel 3.2.0-24-generic on a thinkpad x200; this workaround seems to have helped me (keeping my fingers crossed). thanks a lot!

    @theguy: second.

  16. Thinkpad X200 & ralentissements Xorg | Hippopota.me : le bloc-notes de deK

  17. Thank you so much! I was, almost, going crazy about this high cpu load.
    It helped me with my T400 (cpu P8600), where I experienced about 45% cpu load on both cpu´s (debian wheezy ).
    I wonder why this setting is still the default.

  18. Great! You saved my day, works like a charm also on a Lenovo X200, where these darn kworker processes made it unusable.
    Thanks for posting this.

  19. Stichpunkte vom Wochenende « pregos blog

  20. Ubuntu 13 change drm_kms_helper poll param | Ubuntu Info - James n Sheri.comUbuntu Info – James n Sheri.com

  21. worked great on thinkpad t400
    Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux

  22. Unfortunately not working for me on ThinkPad-T400 3.8.0-19-generic

    I tried putting “echo N> /sys/module/drm_kms_helper/parameters/poll” in /etc/rc.local (before exit 0)

    and “options drm_kms_helper poll=N” in /etc/modprobe.d/local.conf

    Whenever i check /sys/module/drm_kms_helper/parameters/poll has N in it…. so it does not seem to revert to Y….. but almost every time I resume from sleep kworkers rebel and completely lock up my machine with 5 minutes.

    ARRGH!

    This has been going on for months for me now.. since Ubuntu 12.04. I’ve been a fulltime linux user on my laptop for 8 years… this is the first time i’ve come across a bug which has shaken the faith.

    • This sounds bad. Unfortunately, I’m not using my Thinkpad anymore, that makes me unable to triage the bug at this point of time.

      However, I’ll ask you to try out the following:
      1) Try and report the kernel messages while the pc resumes from sleep, till the lockdown and check for any interesting messages.
      2) The worst case scenario – downgrade to a different kernel version and check, hope you wouldn’t lose out any significantly used functionality. Kernel 3.8 brings several power management fixes in the code, and perhaps chances are there that in your case the kworker panic is created by some other regression.

      In the meanwhile I’ll check what I can do, and let you know. Cheers!

      • Souri, how did you find out about the existance of this patch in patchworker? I can’t find a relevant bug in the kernel bugtracker and even if so, how can I tell which patch in patchworker corresponds to a certain bugzilla bug?

      • Well, patchwork.kernel.org doesn’t provide a search facility. So, I’ll use a search string “kworker site:patchwork.kernel.org” on google for this issue. Also, I could not find a similar bug in the kernel bugtracker. The intel-gfx project in patchworks is usually supposed to manage the i915 driver and they seem to work pretty actively on that.

        Regarding which patch in patchwork corresponds to a bug in bugzilla, you’ll not always be able to tell it if the submitter or the participants in the lists haven’t mentioned it, in most cases if a patch is being developed, you’ll find a reference. Again, these two work fairly independently, since patchworker is just supposed to track the progress of a patch delivery and not to track,identify or manage bugs.

  23. Is it safe to use 3.9 kernel from ppa because 3.8 is broken in 13.04 on my hardware | Ubuntu InfoUbuntu Info

  24. Some details on the fix in 3.10, quoting Intels Daniel Vetter:
    “Once we detect a storm we kill the hotplug interrupt. Note that since on many systems these storms only happen in certain conditions (e.g. specific battery charger state) we’ll re-enable the interrupts every 2 minutes to check whether the storm has passed”.

  25. I don’t know if this is a stupid question, but do you think it likely that Ubuntu’s forthcoming adoption of MIR will mean I can install Ubuntu 14.04 and not encounter this irritation?

  26. Is it safe to use 3.9 kernel from ppa because 3.8 is broken in 13.04 on my hardware | WyldePlayground.netWyldePlayground.net -

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s