Gentoo Archives: gentoo-user

From: chin chong <fortalkingwith@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] kswapd0 100% CPU with swapoff and no memory demands on system
Date: Sun, 10 Jun 2018 18:19:00
Message-Id: CAMy9pEz6HMP9M39+zAmZg=9pAzX9__VtQ1uZV2qY+-K7reW3=Q@mail.gmail.com
In Reply to: [gentoo-user] kswapd0 100% CPU with swapoff and no memory demands on system by Chris Stankevitz
1 unsubscribe
2
3 On Sat, May 3, 2014 at 10:16 AM, Chris Stankevitz <chrisstankevitz@×××××.com
4 > wrote:
5
6 > Hello,
7 >
8 > I have a small system:
9 >
10 > - 6GB drive
11 >
12 > - ext4 partition mounted readonly
13 >
14 > - swap partition that is not listed in fstab and not enabled. (I will
15 > swapon it every few weeks or so if I need it for a large compile job)
16 >
17 > - 2 GB RAM
18 >
19 > When the system boots it processing video from a USB camera. The
20 > program dynamically allocates and releases memory while it runs, but
21 > stores no data in memory or on disk (read-only). The memory usage
22 > does not grow over time.
23 >
24 > When things are going well, top looks like so:
25 >
26 > ===
27 >
28 > Tasks: 68 total, 1 running, 67 sleeping, 0 stopped, 0 zombie
29 > %Cpu0 : 88.3 us, 11.7 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.0 si,
30 > 0.0 st
31 > %Cpu1 : 25.5 us, 2.3 sy, 0.0 ni, 72.1 id, 0.0 wa, 0.0 hi, 0.0 si,
32 > 0.0 st
33 > %Cpu2 : 6.0 us, 0.7 sy, 0.0 ni, 93.3 id, 0.0 wa, 0.0 hi, 0.0 si,
34 > 0.0 st
35 > %Cpu3 : 25.7 us, 2.3 sy, 0.0 ni, 72.0 id, 0.0 wa, 0.0 hi, 0.0 si,
36 > 0.0 st
37 > KiB Mem: 1861644 total, 161648 used, 1699996 free, 6948 buffers
38 > KiB Swap: 0 total, 0 used, 0 free, 57728 cached
39 >
40 > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
41 > 2129 root 20 0 1774440 81712 25388 S 160.0 4.4 25:55.46 obt
42 > 705 root 20 0 0 0 0 S 1.0 0.0 0:07.87 kswapd0
43 > 2049 ueyed 20 0 620472 14092 13652 S 1.0 0.8 0:09.34
44 > ueyeusbd
45 >
46 >
47 > ====
48 >
49 >
50 > Q1: Why does the kswapd0 process from time to time take up 100% CPU?
51 >
52 > Q2: Why does top show "cached swap" eventhough I do not have swap mounted?
53 >
54 > Q3: Is there anything I can do to prevent kswapd0 from using CPU on my
55 > system? e.g. disable SWAP in the kernel config
56 >
57 > I suspect the answer to Q1 is:
58 >
59 > a) kernel is not configured properly for my hardware
60 > or
61 > b) there is some bad side effect to my readonly root fs
62 >
63 > Thank you,
64 >
65 > Chris
66 >
67 >

Replies