Kswapd0 CPU spikes

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Huecuva
Level 3
Level 3
Posts: 129
Joined: Sun May 08, 2016 2:14 pm

Kswapd0 CPU spikes

Post by Huecuva » Sat Oct 19, 2019 2:20 pm

Hey all.

I'm not sure if this is a n00b question or not so I'm putting it here.

Occasionally my HTPC will freeze up and I have to wait for it to finish doing its thing. Sometimes it will freeze up to the point where I need to manually press the reset button and reboot it in order to get it moving again. The top command indicates that the kswapd0 process is spiking CPU usage. I'm using an SSD for my OS drive and I did not configure a swap partition because I figured I had plenty of RAM (HTPC has 8GB DDR3) and a swap partition would put unnecessary strain my SSD. I have a suspicion that these CPU spikes are a result of using too much RAM and not having room for swapping (I tend to have a LOT of browser tabs open and often also Kodi and Steam). Does my suspicion make sense? I remember reading somewhere that a swap partition is not necessary on modern rigs with lots of RAM, but I guess that doesn't really count when I'm still using it all, right? I know a swap partition would cause a lot more write cycles to my SSD but would it really make that much of a difference in the lifespan of the drive?

Thoughts?

Huecuva
Level 3
Level 3
Posts: 129
Joined: Sun May 08, 2016 2:14 pm

Re: Kswapd0 CPU spikes

Post by Huecuva » Sun Oct 20, 2019 2:25 am

Just because, here is the output of my inxi -Fxz command. I'm pretty sure the problem is swapping, maybe someone else has other ideas?

Code: Select all

System:
  Host: htpc-pc Kernel: 4.15.0-65-generic x86_64 bits: 64 compiler: gcc 
  v: 7.4.0 Desktop: Cinnamon 4.2.4 Distro: Linux Mint 19.2 Tina 
  base: Ubuntu 18.04 bionic 
Machine:
  Type: Desktop Mobo: MSI model: H61M-P21 (MS-7680) v: 3.0 serial: <filter> 
  BIOS: American Megatrends v: 19.2 date: 01/09/2013 
CPU:
  Topology: Quad Core model: Intel Core i5-3470S bits: 64 type: MCP 
  arch: Ivy Bridge rev: 9 L2 cache: 6144 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 23147 
  Speed: 1597 MHz min/max: 1600/2900 MHz Core speeds (MHz): 1: 1596 2: 1596 
  3: 1597 4: 1596 
Graphics:
  Device-1: AMD Cedar [Radeon HD 5000/6000/7350/8350 Series] 
  vendor: XFX Pine driver: radeon v: kernel bus ID: 01:00.0 
  Display: x11 server: X.Org 1.19.6 driver: ati,radeon 
  unloaded: fbdev,modesetting,vesa 
  resolution: 1920x1080~60Hz, 1280x1024~60Hz 
  OpenGL: renderer: AMD CEDAR (DRM 2.50.0 / 4.15.0-65-generic LLVM 8.0.0) 
  v: 3.3 Mesa 19.0.8 direct render: Yes 
Audio:
  Device-1: Intel 6 Series/C200 Series Family High Definition Audio 
  vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus ID: 00:1b.0 
  Device-2: AMD Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series] 
  vendor: XFX Pine driver: snd_hda_intel v: kernel bus ID: 01:00.1 
  Sound Server: ALSA v: k4.15.0-65-generic 
Network:
  Device-1: Qualcomm Atheros AR8152 v2.0 Fast Ethernet 
  vendor: Micro-Star MSI driver: atl1c v: 1.0.1.1-NAPI port: d000 
  bus ID: 03:00.0 
  IF: enp3s0 state: up speed: 100 Mbps duplex: full mac: <filter> 
Drives:
  Local Storage: total: 1.48 TiB used: 882.63 GiB (58.2%) 
  ID-1: /dev/sda vendor: Transcend model: TS128GSSD25S-M size: 119.24 GiB 
  ID-2: /dev/sdb vendor: Seagate model: ST31500341AS size: 1.36 TiB 
Partition:
  ID-1: / size: 116.87 GiB used: 47.75 GiB (40.9%) fs: ext4 dev: /dev/sda1 
Sensors:
  System Temperatures: cpu: 29.8 C mobo: 27.8 C gpu: radeon temp: 50 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 276 Uptime: 1d 3h 27m Memory: 7.76 GiB used: 6.35 GiB (81.9%) 
  Init: systemd runlevel: 5 Compilers: gcc: 7.4.0 Shell: bash v: 4.4.20 
  inxi: 3.0.32 

Post Reply

Return to “Newbie Questions”