Kworker resource hog

Hi everybody

I’m experiencing a strange problem with a kworker process that sucks most of my cpu power when I watch videos (HTML5 or Flash) with firefox or chrome. This kworker process starts using 75-80% of my cpu when I open a video and keeps working even after I close the web browsers and the temperature goes up to 90°C! The only way to stop it is rebooting my pc. I tried to stress the cpu to identify the cause of this issue: it seems to be linked to all the applications that deal with internet media streams, video or audio. Listening to radio streams with clementine gives the same result. These are the values *top *shows in the terminal:

*HTML5 in firefox

top - 00:49:18 up 41 min,  2 users,  load average: 2,75, 2,00, 1,63
Tasks: 235 total,   2 running, 233 sleeping,   0 stopped,   0 zombie
%Cpu(s): 12,5 us, 19,9 sy,  0,0 ni, 64,6 id,  3,1 wa,  0,0 hi,  0,0 si,  0,0 st
KiB Mem:   6029576 total,  3525532 used,  2504044 free,   127676 buffers
KiB Swap:  6288380 total,        0 used,  6288380 free.  2232508 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                            
 5144 root      20   0       0      0      0 R 76,33 0,000   1:42.85 kworker/0:0                                                                                        
 4897 geeko     20   0 1698724 664400 105012 S 44,67 11,02   3:52.20 firefox                                                                                            
 2456 geeko     20   0 1440084 113072  45620 S 4,000 1,875   1:41.80 /usr/bin/deluge                                                                                    
 1298 root      20   0  269104  65624  49324 S 3,000 1,088   1:08.57 X                                                                                                  
 1829 geeko      9 -11  512320  14900  11356 S 1,667 0,247   1:30.01 pulseaudio                                                                                         
  431 root      20   0   12036   5784   1508 S 1,000 0,096   0:03.35 haveged                                                                                            
 2424 geeko     20   0  693432  32984  25476 S 1,000 0,547   0:03.99 mate-terminal                                                                                      
 2081 geeko     20   0 1545940 108560  39988 S 0,667 1,800   0:36.66 Telegram                                                                                           
  582 root     -51   0       0      0      0 S 0,333 0,000   0:15.59 irq/51-iwlwifi                                                                                     
 1818 geeko     20   0  540832  32436  24244 S 0,333 0,538   0:13.19 marco                                                                                              
 1846 geeko     20   0  526240  28468  22268 S 0,333 0,472   0:04.40 mate-netspeed-a                                                                                    
 1852 geeko     20   0  402604  17256  14352 S 0,333 0,286   0:04.43 mate-multiload-                                                                                    
    1 root      20   0   35904   5624   3348 S 0,000 0,093   0:02.76 systemd                                                                                            
    2 root      20   0       0      0      0 S 0,000 0,000   0:00.00 kthreadd                                                                                           
    3 root      20   0       0      0      0 S 0,000 0,000   0:00.12 ksoftirqd/0                                                                                        
    5 root       0 -20       0      0      0 S 0,000 0,000   0:00.00 kworker/0:0H                                                                                       
    7 root      -2   0       0      0      0 S 0,000 0,000   0:00.00 rcuc/0                                                                                             
    8 root      -2   0       0      0      0 S 0,000 0,000   0:00.00 rcub/0                                                                                             
    9 root      20   0       0      0      0 S 0,000 0,000   0:02.74 rcu_preempt                                                                                        
   10 root      20   0       0      0      0 S 0,000 0,000   0:00.99 rcuop/0                                                                                            
   11 root      20   0       0      0      0 S 0,000 0,000   0:00.90 rcuop/1                                                                                            
   12 root      20   0       0      0      0 S 0,000 0,000   0:00.64 rcuop/2                                                                                            
   13 root      20   0       0      0      0 S 0,000 0,000   0:00.57 rcuop/3                                                                                            
   14 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuop/4                                                                                            
   15 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuop/5                                                                                            
   16 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuop/6                                                                                            
   17 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuop/7                                                                                            
   18 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuop/8                                                                                            
   19 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuop/9                                                                                            
   20 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuop/10                                                                                           
   21 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuop/11                                                                                           
   22 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuop/12                                                                                           
   23 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuop/13                                                                                           
   24 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuop/14                                                                                           
   25 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuop/15                                                                                           
   26 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcu_sched                                                                                          
   27 root      20   0       0      0      0 S 0,000 0,000   0:00.00 rcuos/0

After closing firefox

top - 00:51:36 up 44 min,  2 users,  load average: 2,09, 2,03, 1,69
Tasks: 233 total,   2 running, 231 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0,9 us, 17,8 sy,  0,0 ni, 80,8 id,  0,5 wa,  0,0 hi,  0,0 si,  0,0 st
KiB Mem:   6029576 total,  2941916 used,  3087660 free,   127892 buffers
KiB Swap:  6288380 total,        0 used,  6288380 free.  2211572 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                         
 5144 root      20   0       0      0      0 R 76,74 0,000   3:27.82 kworker/0:0                     
 2456 geeko     20   0 1440084 114388  45620 S 2,658 1,897   1:45.75 /usr/bin/deluge                 
  431 root      20   0   12036   5784   1508 S 1,329 0,096   0:04.70 haveged                         
 2106 geeko     20   0  792520  55748  34440 S 0,664 0,925   0:07.52 claws-mail                      
 1298 root      20   0  257008  56060  39500 S 0,332 0,930   1:11.21 X                               
 2081 geeko     20   0 1545940 108560  39988 S 0,332 1,800   0:37.19 Telegram                        
 2424 geeko     20   0  693432  33092  25584 S 0,332 0,549   0:04.66 mate-terminal                   
 5093 root      20   0       0      0      0 S 0,332 0,000   0:00.12 kworker/u32:0                   
 5193 geeko     20   0   15336   2740   2196 R 0,332 0,045   0:00.12 top                             
    1 root      20   0   35904   5624   3348 S 0,000 0,093   0:02.76 systemd                         
    2 root      20   0       0      0      0 S 0,000 0,000   0:00.00 kthreadd                        
    3 root      20   0       0      0      0 S 0,000 0,000   0:00.13 ksoftirqd/0                     
    5 root       0 -20       0      0      0 S 0,000 0,000   0:00.00 kworker/0:0H                    
    7 root      -2   0       0      0      0 S 0,000 0,000   0:00.00 rcuc/0                          
    8 root      -2   0       0      0      0 S 0,000 0,000   0:00.00 rcub/0                          
    9 root      20   0       0      0      0 S 0,000 0,000   0:02.76 rcu_preempt                     
   10 root      20   0       0      0      0 S 0,000 0,000   0:01.00 rcuop/0                         
   11 root      20   0       0      0      0 S 0,000 0,000   0:00.91 rcuop/1                         
   12 root      20   0       0      0      0 S 0,000 0,000   0:00.64 rcuop/2 

Clementine playing radio stream

top - 12:47:26 up 13 min,  2 users,  load average: 1,44, 1,35, 0,92
Tasks: 231 total,   2 running, 229 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1,0 us, 17,6 sy,  0,0 ni, 81,4 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
KiB Mem:   6029576 total,  1264724 used,  4764852 free,    78164 buffers
KiB Swap:  6288380 total,        0 used,  6288380 free.   708692 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND    
   93 root      20   0       0      0      0 R 76,41 0,000   0:09.89 kworker/0+ 
 2360 geeko     20   0 2697448 126620  74984 S 2,658 2,100   0:24.33 clementine 
  563 root      20   0   12036   7372   1564 S 1,329 0,122   0:00.94 haveged    
 1364 root      20   0  240252  40672  28884 S 0,997 0,675   0:07.95 X          
 2327 geeko     20   0  691360  30508  24792 S 0,664 0,506   0:01.00 mate-term+ 
  597 root     -51   0       0      0      0 S 0,332 0,000   0:06.02 irq/50-iw+ 
 2063 geeko     20   0  521020  28716  21824 S 0,332 0,476   0:02.25 marco      
 2168 geeko     20   0  412488  22392  18852 S 0,332 0,371   0:01.58 mate-nets+ 
 2358 geeko     20   0   15336   2752   2208 R 0,332 0,046   0:02.11 top        
    1 root      20   0   35796   5488   3308 S 0,000 0,091   0:02.10 systemd    
    2 root      20   0       0      0      0 S 0,000 0,000   0:00.00 kthreadd   
    3 root      20   0       0      0      0 S 0,000 0,000   0:00.01 ksoftirqd+ 
    5 root       0 -20       0      0      0 S 0,000 0,000   0:00.00 kworker/0+ 
    7 root      -2   0       0      0      0 S 0,000 0,000   0:00.00 rcuc/0     
    8 root      -2   0       0      0      0 S 0,000 0,000   0:00.00 rcub/0     
    9 root      20   0       0      0      0 S 0,000 0,000   0:00.78 rcu_preem+ 
   10 root      20   0       0      0      0 S 0,000 0,000   0:00.38 rcuop/0

What can be the cause?

when I watch videos (HTML5 or Flash)

Flash is very well known for sucking up all the resources in your machine when it’s used.
HTML5 video players shouldn’t be as resource hungry, but if you have very minimal video hardware, ie. older or lower cost GPU, shared memory instead of video memory, etc… Then viewing at full screen in particular could tax the limits of your GPU especially since nowadays HD video is often available for streaming.

As for audio streams, they don’t typically use a Flash player and HTML5 video players should also be less resource hungry. But, of course it can matter if you have minimal hardware or the stream is extremely high bandwidth(ie > 200kb/sec). The streaming throughput itself isn’t likely approaching your networking limits but your system has to decode in real time.

TSU