public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] kswapd0 100% CPU with swapoff and no memory demands on system
@ 2014-05-03  7:16 Chris Stankevitz
  2014-05-03 10:30 ` Mick
  2018-06-10 18:18 ` chin chong
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Stankevitz @ 2014-05-03  7:16 UTC (permalink / raw
  To: gentoo-user@lists.gentoo.org

Hello,

I have a small system:

- 6GB drive

- ext4 partition mounted readonly

- swap partition that is not listed in fstab and not enabled.  (I will
swapon it every few weeks or so if I need it for a large compile job)

- 2 GB RAM

When the system boots it processing video from a USB camera.  The
program dynamically allocates and releases memory while it runs, but
stores no data in memory or on disk (read-only).  The memory usage
does not grow over time.

When things are going well, top looks like so:

===

Tasks:  68 total,   1 running,  67 sleeping,   0 stopped,   0 zombie
%Cpu0  : 88.3 us, 11.7 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu1  : 25.5 us,  2.3 sy,  0.0 ni, 72.1 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu2  :  6.0 us,  0.7 sy,  0.0 ni, 93.3 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu3  : 25.7 us,  2.3 sy,  0.0 ni, 72.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:   1861644 total,   161648 used,  1699996 free,     6948 buffers
KiB Swap:        0 total,        0 used,        0 free,    57728 cached

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 2129 root      20   0 1774440  81712  25388 S 160.0  4.4  25:55.46 obt
  705 root      20   0       0      0      0 S   1.0  0.0   0:07.87 kswapd0
 2049 ueyed     20   0  620472  14092  13652 S   1.0  0.8   0:09.34 ueyeusbd


====


Q1: Why does the kswapd0 process from time to time take up 100% CPU?

Q2: Why does top show "cached swap" eventhough I do not have swap mounted?

Q3: Is there anything I can do to prevent kswapd0 from using CPU on my
system?  e.g. disable SWAP in the kernel config

I suspect the answer to Q1 is:

a) kernel is not configured properly for my hardware
 or
b) there is some bad side effect to my readonly root fs

Thank you,

Chris


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] kswapd0 100% CPU with swapoff and no memory demands on system
  2014-05-03  7:16 [gentoo-user] kswapd0 100% CPU with swapoff and no memory demands on system Chris Stankevitz
@ 2014-05-03 10:30 ` Mick
  2018-06-10 18:18 ` chin chong
  1 sibling, 0 replies; 4+ messages in thread
From: Mick @ 2014-05-03 10:30 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 3425 bytes --]

I can't answer all your questions, but here is what I can answer:

On Saturday 03 May 2014 08:16:24 Chris Stankevitz wrote:
> Hello,
> 
> I have a small system:
> 
> - 6GB drive
> 
> - ext4 partition mounted readonly
> 
> - swap partition that is not listed in fstab and not enabled.  (I will
> swapon it every few weeks or so if I need it for a large compile job)
> 
> - 2 GB RAM
> 
> When the system boots it processing video from a USB camera.  The
> program dynamically allocates and releases memory while it runs, but
> stores no data in memory or on disk (read-only).  The memory usage
> does not grow over time.
> 
> When things are going well, top looks like so:
> 
> ===
> 
> Tasks:  68 total,   1 running,  67 sleeping,   0 stopped,   0 zombie
> %Cpu0  : 88.3 us, 11.7 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si, 
> 0.0 st %Cpu1  : 25.5 us,  2.3 sy,  0.0 ni, 72.1 id,  0.0 wa,  0.0 hi,  0.0
> si,  0.0 st %Cpu2  :  6.0 us,  0.7 sy,  0.0 ni, 93.3 id,  0.0 wa,  0.0 hi,
>  0.0 si,  0.0 st %Cpu3  : 25.7 us,  2.3 sy,  0.0 ni, 72.0 id,  0.0 wa, 
> 0.0 hi,  0.0 si,  0.0 st KiB Mem:   1861644 total,   161648 used,  1699996
> free,     6948 buffers KiB Swap:        0 total,        0 used,        0
> free,    57728 cached
> 
>   PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
>  2129 root      20   0 1774440  81712  25388 S 160.0  4.4  25:55.46 obt
>   705 root      20   0       0      0      0 S   1.0  0.0   0:07.87 kswapd0
>  2049 ueyed     20   0  620472  14092  13652 S   1.0  0.8   0:09.34
> ueyeusbd
> 
> 
> ====
> 
> 
> Q1: Why does the kswapd0 process from time to time take up 100% CPU?

I can't answer this, other than say that something is using up your memory and 
the kernel is processing heavily (assessing) the number of free pages in the 
system to see if they are getting too low and therefore it should start 
swapping pages out into your swap partition.  It runs on a timer, so it will 
check this every now and then and therefore you will find it fluctuates over 
time.


> Q2: Why does top show "cached swap" eventhough I do not have swap mounted?

It doesn't, although if you read that row from left to right you would assume 
that the cached number shown there is swapped cache.

It is actually referring to data in your memory cache.  If someone was to pull 
the plug then all this data in RAM would be lost.  If you run:

  cat /proc/meminfo

you will see that there are two entries there, 'Cached' which corresponds to 
your cached value in Top and also 'SwapCached' which refers to the amount of 
data that was swapped out and has now been swapped back in memory, but it is 
still kept in the swapfile in case it needs to be swapped out again soon (it 
tries to save I/O operations from the filesystem).


> Q3: Is there anything I can do to prevent kswapd0 from using CPU on my
> system?  e.g. disable SWAP in the kernel config

Well, I guess that if you have disabled swap in the kernel the kernel daemon 
will not be available whenever you run that kernel.


> I suspect the answer to Q1 is:
> 
> a) kernel is not configured properly for my hardware
>  or
> b) there is some bad side effect to my readonly root fs

I have found reports and allegations of a kernel bug with kswapd in Google, 
but I don't know if this is related to your problem.

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] kswapd0 100% CPU with swapoff and no memory demands on system
  2014-05-03  7:16 [gentoo-user] kswapd0 100% CPU with swapoff and no memory demands on system Chris Stankevitz
  2014-05-03 10:30 ` Mick
@ 2018-06-10 18:18 ` chin chong
  2018-06-10 18:29   ` Dale
  1 sibling, 1 reply; 4+ messages in thread
From: chin chong @ 2018-06-10 18:18 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1990 bytes --]

unsubscribe

On Sat, May 3, 2014 at 10:16 AM, Chris Stankevitz <chrisstankevitz@gmail.com
> wrote:

> Hello,
>
> I have a small system:
>
> - 6GB drive
>
> - ext4 partition mounted readonly
>
> - swap partition that is not listed in fstab and not enabled.  (I will
> swapon it every few weeks or so if I need it for a large compile job)
>
> - 2 GB RAM
>
> When the system boots it processing video from a USB camera.  The
> program dynamically allocates and releases memory while it runs, but
> stores no data in memory or on disk (read-only).  The memory usage
> does not grow over time.
>
> When things are going well, top looks like so:
>
> ===
>
> Tasks:  68 total,   1 running,  67 sleeping,   0 stopped,   0 zombie
> %Cpu0  : 88.3 us, 11.7 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,
> 0.0 st
> %Cpu1  : 25.5 us,  2.3 sy,  0.0 ni, 72.1 id,  0.0 wa,  0.0 hi,  0.0 si,
> 0.0 st
> %Cpu2  :  6.0 us,  0.7 sy,  0.0 ni, 93.3 id,  0.0 wa,  0.0 hi,  0.0 si,
> 0.0 st
> %Cpu3  : 25.7 us,  2.3 sy,  0.0 ni, 72.0 id,  0.0 wa,  0.0 hi,  0.0 si,
> 0.0 st
> KiB Mem:   1861644 total,   161648 used,  1699996 free,     6948 buffers
> KiB Swap:        0 total,        0 used,        0 free,    57728 cached
>
>   PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
>  2129 root      20   0 1774440  81712  25388 S 160.0  4.4  25:55.46 obt
>   705 root      20   0       0      0      0 S   1.0  0.0   0:07.87 kswapd0
>  2049 ueyed     20   0  620472  14092  13652 S   1.0  0.8   0:09.34
> ueyeusbd
>
>
> ====
>
>
> Q1: Why does the kswapd0 process from time to time take up 100% CPU?
>
> Q2: Why does top show "cached swap" eventhough I do not have swap mounted?
>
> Q3: Is there anything I can do to prevent kswapd0 from using CPU on my
> system?  e.g. disable SWAP in the kernel config
>
> I suspect the answer to Q1 is:
>
> a) kernel is not configured properly for my hardware
>  or
> b) there is some bad side effect to my readonly root fs
>
> Thank you,
>
> Chris
>
>

[-- Attachment #2: Type: text/html, Size: 2604 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] kswapd0 100% CPU with swapoff and no memory demands on system
  2018-06-10 18:18 ` chin chong
@ 2018-06-10 18:29   ` Dale
  0 siblings, 0 replies; 4+ messages in thread
From: Dale @ 2018-06-10 18:29 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

chin chong wrote:
> unsubscribe
>

It doesn't work that way for this mailing list.  Try this:

List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org> 

Hope that helps.

Dale

:-)  :-)  


[-- Attachment #2: Type: text/html, Size: 742 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-06-10 18:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-03  7:16 [gentoo-user] kswapd0 100% CPU with swapoff and no memory demands on system Chris Stankevitz
2014-05-03 10:30 ` Mick
2018-06-10 18:18 ` chin chong
2018-06-10 18:29   ` Dale

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox