You are not logged in.

#1 2014-07-29 02:57:20

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

kworker has 100% cpu usage. Why?

I thought that setting

options usbcore autosuspend=0

in /etc/modprobe.d/modprobe.conf fixed the problem for me of kworker using 100% CPU. I found the solution here. Using the setting prevented kworker from kworking right after boot, but it till starts kworking a some point into my sessions. EDIT: Nope, I guess it's random because it's happening at boot again.

Why might this be?

Last edited by trusktr (2014-07-29 20:46:54)


joe@trusktr.io - joe at true skater dot io.

Offline

#2 2014-07-29 20:31:10

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: kworker has 100% cpu usage. Why?

Here's some of the output of `perf`, after running `sudo perf record -g -a sleep 10`:

Samples: 40K of event 'cycles', Event count (approx.): 37835553150                  
-  45.58%      kworker/0:1  [kernel.kallsyms]            [k] native_read_tsc       ▒
   - native_read_tsc                                                               ▒
      - 59.68% delay_tsc                                                           ▒
           __delay                                                                 ◆
           __const_udelay                                                          ▒
         - 0xffffffffa0603076                                                      ▒
            - 59.95% 0xffffffffa0603159                                            ▒
               - 66.11% 0xffffffffa060357a                                         ▒
                  - 50.12% 0xffffffffa0603d53                                      ▒
                       acpi_ev_notify_dispatch                                     ▒
                       acpi_os_execute_deferred                                    ▒
                       process_one_work                                            ▒
                       worker_thread                                               ▒
                       kthread                                                     ▒
                       ret_from_fork                                               ▒
                  - 49.88% 0xffffffffa0603d30                                      ▒
                       acpi_ev_notify_dispatch                                     ▒
                       acpi_os_execute_deferred                                    ▒
                       process_one_work                                            ▒
                       worker_thread                                               ▒
                       kthread                                                     ▒
                       ret_from_fork                                               ▒
               - 33.89% 0xffffffffa0603d93                                         ▒
                    acpi_ev_notify_dispatch                                        ▒
                    acpi_os_execute_deferred                                       ▒
                    process_one_work                                               ▒
                    worker_thread                                                  ▒
                    kthread                                                        ▒
                    ret_from_fork                                                  ▒
            + 40.05% 0xffffffffa06032f8                                            ▒
      + 40.31% __delay                                                             ▒
+  45.00%      kworker/0:1  [kernel.kallsyms]            [k] delay_tsc             ▒
+   7.85%      kworker/0:1  [apple_gmux]                 [k] 0x0000000000000063    ▒
+   0.84%      kworker/0:1  [apple_gmux]                 [k] 0x000000000000006a    ▒
+   0.09%          swapper  [kernel.kallsyms]            [k] intel_idle            ▒
+   0.02%      kworker/0:1  [apple_gmux]                 [k] 0x0000000000000165    ▒
+   0.02%                X  nvidia_drv.so                [.] 0x0000000000067e7f    ▒
+   0.02%    irq/49-(null)  [libahci]                    [k] 0x0000000000001994    ▒

(alternatively, with syntax highlight:
http://hastebin.com/qekisivexe.erlang_repl)

I didn't expand everything because they basically all look the same. It seems like the problem has to do with ACPI. I tried the solutions in the linked thread, but they didn't work.


joe@trusktr.io - joe at true skater dot io.

Offline

#3 2014-08-04 12:16:16

gasparov
Member
Registered: 2006-02-10
Posts: 19

Re: kworker has 100% cpu usage. Why?

Is this use of the cpu because of wait state? you can check with top (% wa). Do you have acpi interrupts particularly high? (cat /sys/firmware/acpi/interrupts/* and check for big number).

With my laptop that was the problem

Offline

#4 2014-10-24 19:03:48

Sparrowhawk
Member
Registered: 2014-05-06
Posts: 3

Re: kworker has 100% cpu usage. Why?

Hi,
I am having the same problem, with processes kworker/0:0 or kworker/0:1 or kworker/0:2 constantly taking from 20 to 100% of a cpu. I can recognise no pattern between boots of witch one it is, and the power taken. acpi interrupts is indeed high :

cat /sys/firmware/acpi/interrupts/*
       0
       0   enabled
       0   invalid
       0   invalid
       0   disabled
       0   invalid
       0   invalid
       0   enabled
       0   enabled
       0   invalid
       0   invalid
       0   invalid
       3   enabled
       0   enabled
       0   invalid
       0   disabled
       0   invalid
       0   invalid
       0   invalid
       0   disabled
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
 3848923   enabled
       0   invalid
       0   invalid
       0   invalid
    6625   enabled
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
       0   invalid
 3855551
 3855549
       0

Any help on how to stop this please? Do not hesitate if you need more info!


Any sufficiently advanced technology is indistinguishable from magic -- A. C. Clarke

Offline

#5 2014-10-25 20:42:56

kaari
Member
Registered: 2011-08-12
Posts: 22

Re: kworker has 100% cpu usage. Why?

I still don't know what is causing the problem, but these instructions worked for me on a MacBookAir6,2:

Source: http://askubuntu.com/questions/176565/w … et-so-high

~ ~ ~ ~

The solution for me and for many others was, first of all, find out the "gpe" that is causing the bad stuff with something like:

grep . -r /sys/firmware/acpi/interrupts/

and check for an high value (mine was gpe13 - with a value like 200K - so, you have to change it accordingly, if differs). After that:

~ cp /sys/firmware/acpi/interrupts/gpe13 /pathtobackup
~ crontab -e

Add this line, so it will be executed every startup/reboot:

@reboot echo "disable" > /sys/firmware/acpi/interrupts/gpe13

Save/exit. Then, to make it work also after wakeup from suspend:

~ touch /etc/pm/sleep.d/30_disable_gpe13
~ chmod +x /etc/pm/sleep.d/30_disable_gpe13
~ vim /etc/pm/sleep.d/30_disable_gpe13

Add this stuff:

#!/bin/bash
case "$1" in
    thaw|resume)
        echo disable > /sys/firmware/acpi/interrupts/gpe13 2>/dev/null
        ;;
    *)
        ;;
esac
exit $?

Save/exit, done.

Offline

Board footer

Powered by FluxBB