From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 3661D1381FA for ; Sat, 3 May 2014 10:30:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1FCA0E0A8A; Sat, 3 May 2014 10:30:39 +0000 (UTC) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D19B2E084A for ; Sat, 3 May 2014 10:30:37 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u57so5659314wes.27 for ; Sat, 03 May 2014 03:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:reply-to:to:subject:date:user-agent:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=D0JBKL0IK9/j7ZHgs3hyKIx/D3P8RVzLWWdwuiYrSV0=; b=yCS3uIANy4NeH+k9tW0btC0qoFvrsGrEr0k7Gwq59+0ms1JoMmgQoEDt/2xkUoxuSH mdqRmu/JNrH7L5GcyBckDmrZ7vYvoSPftsuaWeYj57+o5buaMm+3uSkxvOZl/XNoXcDs 9RKL0PywSc/PkuCKg3Ec0/ACDELnkmR252bj7qXlf6GEJhVzKi4qcy0fmDNO77tg4vZj HJsjX0NPWKCaH1TtezRFiYirfKoNjYZrM84VRhRi4utcUzDSeXQG3aq908JTPzmCvS4m +feZzZ4cOvO/2TKo62OGV3IiCCsgYctVINt3M9EgkT9nVhAs8MUCkuDLHvTmNsuQ5fqz dReQ== X-Received: by 10.180.221.8 with SMTP id qa8mr7015784wic.39.1399113036500; Sat, 03 May 2014 03:30:36 -0700 (PDT) Received: from dell_xps.localnet (230.3.169.217.in-addr.arpa. [217.169.3.230]) by mx.google.com with ESMTPSA id pn9sm3313009wic.17.2014.05.03.03.30.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 03 May 2014 03:30:35 -0700 (PDT) From: Mick To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] kswapd0 100% CPU with swapoff and no memory demands on system Date: Sat, 3 May 2014 11:30:02 +0100 User-Agent: KMail/1.13.7 (Linux/3.12.13-gentoo; KDE/4.11.5; x86_64; ; ) References: In-Reply-To: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart11107621.sABc6kBgnC"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201405031130.12724.michaelkintzios@gmail.com> X-Archives-Salt: bf04e1fd-c59b-40f1-a5d6-910b59c15a56 X-Archives-Hash: e310f4a20239b18d58f61ef43c87898f --nextPart11107621.sABc6kBgnC Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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, >=20 > I have a small system: >=20 > - 6GB drive >=20 > - ext4 partition mounted readonly >=20 > - 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) >=20 > - 2 GB RAM >=20 > 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. >=20 > When things are going well, top looks like so: >=20 > =3D=3D=3D >=20 > 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,=20 > 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,=20 > 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 >=20 > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMA= ND > 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 kswap= d0 > 2049 ueyed 20 0 620472 14092 13652 S 1.0 0.8 0:09.34 > ueyeusbd >=20 >=20 > =3D=3D=3D=3D >=20 >=20 > 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=20 the kernel is processing heavily (assessing) the number of free pages in th= e=20 system to see if they are getting too low and therefore it should start=20 swapping pages out into your swap partition. It runs on a timer, so it wil= l=20 check this every now and then and therefore you will find it fluctuates ove= r=20 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 assu= me=20 that the cached number shown there is swapped cache. It is actually referring to data in your memory cache. If someone was to p= ull=20 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 t= o=20 your cached value in Top and also 'SwapCached' which refers to the amount o= f=20 data that was swapped out and has now been swapped back in memory, but it i= s=20 still kept in the swapfile in case it needs to be swapped out again soon (i= t=20 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 daemo= n=20 will not be available whenever you run that kernel. > I suspect the answer to Q1 is: >=20 > 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,= =20 but I don't know if this is related to your problem. =2D-=20 Regards, Mick --nextPart11107621.sABc6kBgnC Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAABCAAGBQJTZMU0AAoJELAdA+zwE4YeLEYH+wV+SduoYge0H5doJXOyyHGQ UMxCltiVAF3uAxujroj3lRx9yB4ygRBTNnUYIGjbBeg+DNxzEEQFRZxtMU7dNniR ecwXm5Mnt0yhdPM+bMkcW24M87LxEbJQTH4sLh7nXBMAiQ5HqqN7NbkgxznE7/63 EYAlSspaQP6zglviXH29f21fcbP+EVoCCLjqtiDDTMVwcfw3YtE30EgZOo0a9Yrh IUSec3OfPs+DUXLzhmJ44vfmJD7i0Eyb6mPH4IVd9YSx1Biw97M2sTI+U5OBfViH yIsgqFPT7FST8LnTfpv7Pv3mzb3Io5iJY2oz61ErGFTdX5DlcPaTVHTSGP00DpY= =6iBh -----END PGP SIGNATURE----- --nextPart11107621.sABc6kBgnC--