What kswapd is doing when there is no swap

6,796

Many processes have memory that is backed by a file. This data can be swapped to the file even if you don't have swap space.

See: AskUbuntu » Why is kswapd0 running on a computer with no swap?

Share:
6,796

Related videos on Youtube

Nikita Kipriyanov
Author by

Nikita Kipriyanov

I'm against any war! I never voted for Putin. I never supported the annexation of Crimea.

Updated on September 18, 2022

Comments

  • Nikita Kipriyanov
    Nikita Kipriyanov almost 2 years

    The top look like this:

    KiB Mem :  3989652 total,    30976 free,  1480440 used,  2478236 buff/cache
    KiB Swap:        0 total,        0 free,        0 used.  2276236 avail Mem 
    
      PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND      
     3989 root      20   0   51680   3160   1288 D  19.8  0.1  13:13.86 mc           
     5949 root      20   0       0      0      0 D   3.6  0.0  41:33.92 [usb-storage]
      667 root      20   0       0      0      0 S   1.0  0.0   8:37.38 [kswapd0]    
    

    I turned off swap intentionally. The output like above was captured several minutes after the "KiB Swap total" turned 0. There is a running process which copies from NFS share to USB hard drive (that is mc)

    kswapd keep using around 1% of CPU time. Why?

  • Nikita Kipriyanov
    Nikita Kipriyanov almost 8 years
    In other words, kswapd serves not only RAM extension aka "the swap", but also mmap and other memory paging related features in linux.
  • Zaz
    Zaz almost 8 years
    @NikitaKipriyanov: That's right.