NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: What is the "[system]" process representing ?



swiftgriggs%gmail.com@localhost (Swift Griggs) writes:

>Folks, I recently installed NetBSD on a Lenovo M83 Tiny machine and from 
>time to time, I notice the "[system]" (appears to be a kernel thread?) 
>getting up to 80% of the CPU while the box is doing .... nothing.

[system] is all the kernel threads. In top you can switch to thread
display and get more details. Kernel threads are also displayd with 'ps -s'
and you can augment the display with the thread name using '-o lname'.

80% CPU for doing nothing however is bad. The top display probably tells
you which thread is misbehaving.



>On another system, I have a question about a 1.8Ghz CoreDuo based 32-bit 
>i386 laptop with 2GB of RAM. I noticed that '[system]' accumulates the 
>most time on the host, but it's never "on the board" when I run top or 
>other tools.

The kernel threads are only active for very short time intervals
and therefore appear rarely as active. But since they run all the
time, their usage accumulates. E.g.

a system with 59 days uptime:

    0 ?      OKl   678:30.07 [system]

that's less than 1% overall. Here are the kernel threads reports by 'ps':

% ps asx -o uid,pid,ppid,cpu,pri,nice,vsz,rss,wchan,stat,tty,time,comm,lname | grep system
  0     0     0     0 123  0     0  7728 -        OKl  ?      678:30.22 [system (zombie)     
  0     0     0     0  96  0     0  7728 vndbp    OKl  ?      678:30.22 [system vnd0         
  0     0     0     0  96  0     0  7728 nfsiod   OKl  ?      678:30.22 [system nfsio        
  0     0     0     0  96  0     0  7728 nfsiod   OKl  ?      678:30.22 [system nfsio        
  0     0     0     0  96  0     0  7728 nfsiod   OKl  ?      678:30.22 [system nfsio        
  0     0     0     0  96  0     0  7728 nfsiod   OKl  ?      678:30.22 [system nfsio        
  0     0     0     0 123  0     0  7728 physiod  OKl  ?      678:30.22 [system physiod      
  0     0     0     0  96  0     0  7728 lnxcmplt OKl  ?      678:30.22 [system VCHIQka-0    
  0     0     0     0 125  0     0  7728 aiodoned OKl  ?      678:30.22 [system aiodoned     
  0     0     0     0 124  0     0  7728 syncer   OKl  ?      678:30.22 [system ioflush      
  0     0     0     0 126  0     0  7728 pgdaemon OKl  ?      678:30.22 [system pgdaemon     
  0     0     0     0 123  0     0  7728 data     OKl  ?      678:30.22 [system vcaudio      
  0     0     0     0  96  0     0  7728 semacv   OKl  ?      678:30.22 [system VCHIQs-0     
  0     0     0     0  96  0     0  7728 semacv   OKl  ?      678:30.22 [system VCHIQr-0     
  0     0     0     0  96  0     0  7728 semacv   OKl  ?      678:30.22 [system VCHIQ-0      
  0     0     0     0  96  0     0  7728 cleanup  OKl  ?      678:30.22 [system iscsi_cleanup
  0     0     0     0  96  0     0  7728 sccomp   OKl  ?      678:30.22 [system scsibus0     
  0     0     0     0  96  0     0  7728 usbevt   OKl  ?      678:30.22 [system usb0         
  0     0     0     0  96  0     0  7728 npfgccv  OKl  ?      678:30.22 [system npfgc        
  0     0     0     0  96  0     0  7728 unpgc    OKl  ?      678:30.22 [system unpgc        
  0     0     0     0 222  0     0  7728 nd6_time OKl  ?      678:30.22 [system nd6_timer    
  0     0     0     0 222  0     0  7728 rt_timer OKl  ?      678:30.22 [system rt_timer     
  0     0     0     0  43  0     0  7728 vcmbox0  OKl  ?      678:30.22 [system vcmbox0      
  0     0     0     0 125  0     0  7728 vmem_reh OKl  ?      678:30.22 [system vmem_rehash  
  0     0     0     0 123  0     0  7728 mmctaskq OKl  ?      678:30.22 [system sdmmc0       
  0     0     0     0  96  0     0  7728 usbtsk   OKl  ?      678:30.22 [system usbtask-dr   
  0     0     0     0  96  0     0  7728 usbtsk   OKl  ?      678:30.22 [system usbtask-hc   
  0     0     0     0  43  0     0  7728 dwc2     OKl  ?      678:30.22 [system dwc2         
  0     0     0     0  96  0     0  7728 iicintr  OKl  ?      678:30.22 [system iic0         
  0     0     0     0 127  0     0  7728 xcall    OKl  ?      678:30.22 [system xcall/3      
  0     0     0     0 223  0     0  7728 -        OKl  ?      678:30.22 [system softser/3    
  0     0     0     0 220  0     0  7728 -        OKl  ?      678:30.22 [system softclk/3    
  0     0     0     0 221  0     0  7728 -        OKl  ?      678:30.22 [system softbio/3    
  0     0     0     0 222  0     0  7728 -        OKl  ?      678:30.22 [system softnet/3    
  0     0     0     0   0  0     0  7728 -        OKl  ?      678:30.22 [system idle/3       
  0     0     0     0 127  0     0  7728 xcall    OKl  ?      678:30.22 [system xcall/2      
  0     0     0     0 223  0     0  7728 -        OKl  ?      678:30.22 [system softser/2    
  0     0     0     0 220  0     0  7728 -        OKl  ?      678:30.22 [system softclk/2    
  0     0     0     0 221  0     0  7728 -        OKl  ?      678:30.22 [system softbio/2    
  0     0     0     0 222  0     0  7728 -        OKl  ?      678:30.22 [system softnet/2    
  0     0     0     0   0  0     0  7728 -        OKl  ?      678:30.22 [system idle/2       
  0     0     0     0 127  0     0  7728 xcall    OKl  ?      678:30.22 [system xcall/1      
  0     0     0     0 223  0     0  7728 -        OKl  ?      678:30.22 [system softser/1    
  0     0     0     0 220  0     0  7728 -        OKl  ?      678:30.22 [system softclk/1    
  0     0     0     0 221  0     0  7728 -        OKl  ?      678:30.22 [system softbio/1    
  0     0     0     0 222  0     0  7728 -        OKl  ?      678:30.22 [system softnet/1    
  0     0     0     0   0  0     0  7728 -        OKl  ?      678:30.22 [system idle/1       
  0     0     0     0  96  0     0  7728 smtaskq  OKl  ?      678:30.22 [system sysmon       
  0     0     0     0  96  0     0  7728 crypto_w OKl  ?      678:30.22 [system cryptoret    
  0     0     0     0  43  0     0  7728 pmfsuspe OKl  ?      678:30.22 [system pmfsuspend   
  0     0     0     0  43  0     0  7728 pmfevent OKl  ?      678:30.22 [system pmfevent     
  0     0     0     0  96  0     0  7728 sopendfr OKl  ?      678:30.22 [system sopendfree   
  0     0     0     0  43  0     0  7728 nfssilly OKl  ?      678:30.22 [system nfssilly     
  0     0     0     0 125  0     0  7728 cachegc  OKl  ?      678:30.22 [system cachegc      
  0     0     0     0 125  0     0  7728 vrele    OKl  ?      678:30.22 [system vrele        
  0     0     0     0 125  0     0  7728 vdrain   OKl  ?      678:30.22 [system vdrain       
  0     0     0     0 125  0     0  7728 mod_unld OKl  ?      678:30.22 [system modunload    
  0     0     0     0 127  0     0  7728 xcall    OKl  ?      678:30.22 [system xcall/0      
  0     0     0     0 223  0     0  7728 -        OKl  ?      678:30.22 [system softser/0    
  0     0     0     0 220  0     0  7728 -        OKl  ?      678:30.22 [system softclk/0    
  0     0     0     0 221  0     0  7728 -        OKl  ?      678:30.22 [system softbio/0    
  0     0     0     0 222  0     0  7728 -        OKl  ?      678:30.22 [system softnet/0    
  0     0     0     0   0  0     0  7728 -        OKl  ?      678:30.22 [system idle/0       
  0     0     0     0 125  0     0  7728 uvm      OKl  ?      678:30.22 [system swapper      

CPU accounting is reported only per-process, so you can't see what thread accumulated
how much time. top in thread mode on the other hand can give you details:

  PID   LID USERNAME PRI STATE      TIME   WCPU    CPU NAME      COMMAND
    0    51 root     222 rt_tim/2   0:59  0.00%  0.00% rt_timer  [system]
    0    50 root      43 vcmbox/3   0:14  0.00%  0.00% vcmbox0   [system]
    0    49 root     125 vmem_r/2   0:08  0.00%  0.00% vmem_reha [system]
    0    48 root     123 mmctas/3   0:00  0.00%  0.00% sdmmc0    [system]
    0    39 root      96 usbtsk/1  47:10  0.00%  0.00% usbtask-d [system]
    0    38 root      96 usbtsk/0   0:00  0.00%  0.00% usbtask-h [system]
    0    37 root      43 dwc2/2     0:00  0.00%  0.00% dwc2      [system]
    0    36 root      96 iicint/3   0:55  0.00%  0.00% iic0      [system]
    0    35 root     127 xcall/3    0:00  0.00%  0.00% xcall/3   [system]
    0    34 root     223 IDLE/3     0:00  0.00%  0.00% softser/3 [system]
    0    33 root     220 IDLE/3     0:00  0.00%  0.00% softclk/3 [system]
    0    32 root     221 IDLE/3     0:00  0.00%  0.00% softbio/3 [system]
    0    31 root     222 IDLE/3     0:00  0.00%  0.00% softnet/3 [system]
    0    30 root       0 IDLE/3     0:00  0.00%  0.00% idle/3    [system]
    0    29 root     127 xcall/2    0:00  0.00%  0.00% xcall/2   [system]
    0    28 root     223 IDLE/2     0:00  0.00%  0.00% softser/2 [system]
    0    27 root     220 IDLE/2     0:00  0.00%  0.00% softclk/2 [system]
    0    26 root     221 IDLE/2     0:00  0.00%  0.00% softbio/2 [system]
    0    25 root     222 IDLE/2     0:00  0.00%  0.00% softnet/2 [system]
    0    24 root       0 CPU/2      0:00  0.00%  0.00% idle/2    [system]
    0    23 root     127 xcall/1    0:00  0.00%  0.00% xcall/1   [system]
    0    22 root     223 IDLE/1     0:00  0.00%  0.00% softser/1 [system]
    0    21 root     220 IDLE/1     0:00  0.00%  0.00% softclk/1 [system]
    0    20 root     221 IDLE/1     0:00  0.00%  0.00% softbio/1 [system]
    0    19 root     222 IDLE/1     0:00  0.00%  0.00% softnet/1 [system]
    0    18 root       0 CPU/1      0:00  0.00%  0.00% idle/1    [system]
    0    17 root      96 smtask/0   0:00  0.00%  0.00% sysmon    [system]
    0    16 root      96 crypto/0   0:00  0.00%  0.00% cryptoret [system]
    0    15 root      43 pmfsus/3   0:00  0.00%  0.00% pmfsuspen [system]
    0    14 root      43 pmfeve/1   0:00  0.00%  0.00% pmfevent  [system]
    0    13 root      96 sopend/0   0:00  0.00%  0.00% sopendfre [system]
    0    12 root      43 nfssil/1   0:00  0.00%  0.00% nfssilly  [system]
    0    11 root     125 cacheg/0   2:12  0.00%  0.00% cachegc   [system]
    0    10 root     125 vrele/0    0:54  0.00%  0.00% vrele     [system]
    0     9 root     125 vdrain/2  47:43  0.00%  0.00% vdrain    [system]
    0     8 root     125 mod_un/3   0:00  0.00%  0.00% modunload [system]
    0     7 root     127 xcall/0    0:00  0.00%  0.00% xcall/0   [system]
    0     6 root     223 IDLE/0     0:00  0.00%  0.00% softser/0 [system]
    0     5 root     220 IDLE/0     0:00  0.00%  0.00% softclk/0 [system]
    0     4 root     221 IDLE/0     0:00  0.00%  0.00% softbio/0 [system]
    0     3 root     222 IDLE/0     3:34  0.00%  0.00% softnet/0 [system]
    0     2 root       0 CPU/0      0:00  0.00%  0.00% idle/0    [system]
    0     1 root     125 uvm/0     17:52  0.00%  0.00% swapper   [system]
    0   106 root      96 vndbp/3    0:03  0.00%  0.00% vnd0      [system]
    0    74 root      96 nfsiod/1   0:00  0.00%  0.00% nfsio     [system]
    0    73 root      96 nfsiod/1   0:00  0.00%  0.00% nfsio     [system]
    0    72 root      96 nfsiod/0   0:00  0.00%  0.00% nfsio     [system]
    0    71 root      96 nfsiod/2   0:00  0.00%  0.00% nfsio     [system]
    0    70 root     123 physio/2   0:48  0.00%  0.00% physiod   [system]
    0    69 root      96 lnxcmp/0   0:00  0.00%  0.00% VCHIQka-0 [system]
    0    68 root     125 aiodon/0   5:16  0.00%  0.00% aiodoned  [system]
    0    67 root     124 syncer/0 535:09  0.00%  0.00% ioflush   [system]
    0    66 root     126 pgdaem/1   8:28  0.00%  0.00% pgdaemon  [system]
    0    65 root     123 data/3     0:00  0.00%  0.00% vcaudio   [system]
    0    64 root      96 semacv/3   0:00  0.00%  0.00% VCHIQs-0  [system]
    0    63 root      96 semacv/0   0:00  0.00%  0.00% VCHIQr-0  [system]
    0    62 root      96 semacv/1   0:00  0.00%  0.00% VCHIQ-0   [system]
    0    59 root      96 cleanu/3   0:00  0.00%  0.00% iscsi_cle [system]
    0    57 root      96 sccomp/3   0:00  0.00%  0.00% scsibus0  [system]
    0    56 root      96 usbevt/2   0:01  0.00%  0.00% usb0      [system]
    0    54 root      96 npfgcc/3   0:16  0.00%  0.00% npfgc     [system]
    0    53 root      96 unpgc/3    0:00  0.00%  0.00% unpgc     [system]

Most time is spent in ioflush (searching dirty pages to write them to disk),
vdrain (VFS garbage collection), and the USB driver (this is dwctwo, others
are more efficient).

Saying this, if you run a kernel with LOCKDEBUG on a system with lots
of memory, this adds a ton of overhead to the ioflush function and then
it's not impossible to see a continous 80% CPU usage for '[system]'.
But that doesn't happen with normal kernels.


>The corollary is, does NetBSD do the same work but just mask the CPU 
>usage?

top just can't display CPU usage correctly for processes that are active
for very short intervals, wether kernel threads or not.



Greetings,
-- 
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index