From owner-freebsd-arm@freebsd.org Sun Aug 5 17:39:37 2018 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E57CA1058ABC for ; Sun, 5 Aug 2018 17:39:36 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic301-4.consmr.mail.bf2.yahoo.com (sonic301-4.consmr.mail.bf2.yahoo.com [74.6.129.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72C8A96E32 for ; Sun, 5 Aug 2018 17:39:36 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 36haaoYVM1nr4uYulbk2fgBLlXm4bB6.vZEO0z9qMm_Eu5MQkmvSFhZRC53.H2Z EZrqBg3u9tcXmKL6R8Vh3N6cn6jEHgA.0We.FLGlRSb.2p8uWKkeq5evwpeYCeGnRQofafg1IZTa K91ghR4Ev7B_.Fy0_L9uLkdO6QsoKpz2r91UXMTSbb4TYB0qWaidK5ou5J2NOpAJzkIFNHaVINpy eVBj8IQL1pTa9W_Qkba3VIyduDT_2MKbZiAurVigQ.EIvOBDvyRZIoAHMqHbpiNTlzEfH9OVxTuz Dpvmq3gmjUUUkYyhDLoSpFiPU31nm0OdxopqezQ_jhdOMZZx7ogZ_5vcPDOcjorxTMeUilwLWIno nUIs8fDTcPnxHJ5lM3Z0eb0LaRfwrXXjhKzqLifVWTDjyXEWQOd6ehuUhQwnLsKj70XV_bSKrUoY UOKN2vgKg5iqqfPrrCcs6niXlbwUNYIj_540ZMkULeXLTfCHakZM53_qOLnwtlSxJNEqHml28nQD 1Mw2JjAghoqqGq1XwPreYI5PMGSLdxb5A1OdZDU568UqxxKITEiixGl16y5LpbndzwxBPWrTkV3y udtj3NF71lgk1RN0KziSHmhariGVoRWFTATLa7TSWsnhujS3.62fsgsT1PHV_ma2kfBBzIksZ3BA AgXzCkEA4gjtEMmqvCOENKPtH5I_Qj2wlQg9RR6KF3VQEg4aKsmLU.fwSus37B4bS8YNV93vQm60 m9BL7mFUX_T0r_9EelBgBcF.RZO1ue1svBcooM5ilnZk3.5PnITQX2Yx6HolVNJaEKf4IB9PacJn y0QqldQbso_L2RbI1mTxyX4oy0WhCaHNFoY8qUNu6D8vcFM_5xWW3X2GeGpKrefaLJMuVc84mp7q u7Oyb1bfKH7ptxW7y9ccAlFp1ewMMO6OqLogFbGLQDRtjCNCuE989ul2Yp2FLLK6tPbtq2aaT8ti TcDUUG_P8ugSqsAvBGYtVP7mtE.PmxV4LsjNmWtuZAS9Vy9kAAHCcSDZT_EyaD2e8YvXthW5zoKl ErSS8NiWgyBL6vJfMgA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Sun, 5 Aug 2018 17:39:30 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp413.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 7cc95922125d14cbe2caa21358a1b71b; Sun, 05 Aug 2018 17:39:29 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: RPI3 swap experiments ["was killed: out of swap space" with: "v_free_count: 5439, v_inactive_count: 1"] From: Mark Millard In-Reply-To: <20180805014545.GK2884@funkthat.com> Date: Sun, 5 Aug 2018 10:39:27 -0700 Cc: Jamie Landeg-Jones , bob prohaska , freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: <2C0383B0-3292-48BE-90BC-24FCF2A137D4@yahoo.com> References: <6BFE7B77-A0E2-4FAF-9C68-81951D2F6627@yahoo.com> <20180802002841.GB99523@www.zefox.net> <20180802015135.GC99523@www.zefox.net> <201808030034.w730YURL034270@donotpassgo.dyslexicfish.net> <201808040355.w743tPsF039729@donotpassgo.dyslexicfish.net> <8CC5DF53-F950-495C-9DC8-56FCA0087259@yahoo.com> <20180804140816.GJ2884@funkthat.com> <16ABD9F0-C908-479C-960D-0C1AEDE89053@yahoo.com> <20180805014545.GK2884@funkthat.com> To: John-Mark Gurney , markj@freebsd.org, Warner Losh X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 17:39:37 -0000 [I think the messages produced for OOM kills are misleading for the type of context in this message exchange. More bottom-posted.] On 2018-Aug-4, at 6:45 PM, John-Mark Gurney wrote: Mark Millard wrote this message on Sat, Aug 04, 2018 at 09:08 -0700: > On 2018-Aug-4, at 7:08 AM, John-Mark Gurney = wrote: >=20 >> Mark Millard via freebsd-arm wrote this message on Sat, Aug 04, 2018 = at 00:14 -0700: >>>> . . . >>>=20 >>> The book "The Design and Implementation of the FreeBSD Operating = System" >>> (2nd edition, 2014) states (page labeled 296): >>>=20 >>> QUOTE: >>> The FreeBSD swap-out daemon will not select a runnable processes to = swap >>> out. So, if the set of runnable processes do not fit in memory, the >>> machine will effectively deadlock. Current machines have enough = memory >>> that this condition usually does not arise. If it does, FreeBSD = avoids >>> deadlock by killing the largest process. If the condition begins to = arise >>> in normal operation, the 4.4BSD algorithm will need to be restored. >>> END QUOTE. >>>=20 >>> As near as I can tell, for the likes of rpi3's and rpi2's, the = condition >>> is occurring during buildworld "normal operation" that tries to use = the >>> available cores to advantage. (Your context does not have the I/O >>> problems that Bob P.'s have had in at least some of your OOM process >>> kill examples, if I understand right.) >>>=20 >>> (4.4BSD used to swap out the runnable process that had been resident >>> the longest, followed by the processes taking turns being swapped = out. >>> I'll not quote the exact text about such.) >>>=20 >>> So I guess the question becomes, is there a reasonable way to enable >>> the 4.4BSD style of "Swapping" for "small" memory machines in order = to >>> avoid having to figure out how to not end up with OOM process kills >>> while also not just wasting cores by using -j1 for buildworld? >>>=20 >>> In other words: enable swapping out active RAM when it eats nearly >>> all the non-wired RAM. >>>=20 >>> But it might be discovered that the performance is not better than >>> using fewer cores during buildworld. (Experiments needed and >>> possibly environment specific for the tradeoffs.) Avoiding having >>> to figure out the maximum -j? that avoids OOM process kills but >>> avoids just sticking to -j1 seems and advantage for some rpi3 and >>> rpi2 folks. The book's description makes the messages produced misleading: (copied from someone else's message) Aug 5 01:34:24 rpi3 kernel: pid 63223 (ld.lld), uid 0, was = killed: out of swap space Aug 5 01:34:26 rpi3 kernel: pid 63360 (c++), uid 0, was killed: = out of swap space Aug 5 01:34:26 rpi3 kernel: pid 846 (ntpd), uid 123, was = killed: out of swap space "out of swap space" would appear to apply to the 4.4BSD style of = swapping but not necessarily to more modern FreeBSD's context. "Total Active Working Set too large" (with lots of swap left) seems to = be what folks are running into in these rpi3/rpi2 examples. If the messages had indicated such, this message chain would likely have = been rather different: working out adjustments of the total active working = set size. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)