From owner-freebsd-arm@freebsd.org Thu Sep 6 02:43:56 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 3EECEFE484D for ; Thu, 6 Sep 2018 02:43:56 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63293819BB for ; Thu, 6 Sep 2018 02:43:55 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w862hq0k058505; Wed, 5 Sep 2018 19:43:52 -0700 (PDT) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w862hq7o058504; Wed, 5 Sep 2018 19:43:52 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201809060243.w862hq7o058504@pdx.rh.CN85.dnsmgr.net> Subject: Re: RPI3 swap experiments (r338342 with vm.pageout_oom_seq="1024" and 6 GB swap) In-Reply-To: <20180906003829.GC818@www.zefox.net> To: bob prohaska Date: Wed, 5 Sep 2018 19:43:52 -0700 (PDT) CC: freebsd-arm@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII 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: Thu, 06 Sep 2018 02:43:56 -0000 > On Sat, Sep 01, 2018 at 04:02:33PM -0700, bob prohaska wrote: > > > > With r338342 and > > vm.pageout_oom_seq="1024" > > in /boot/loader.conf the RPI3 is a bit closer to a Mars Rover. > > No panics, crashes or USB errors, -j4 buildworld runs to completion. > > When swap usage goes over about 50% the system slows, but doesn't give up. > > There are six 1 GB swap partitions available, 3 on USB and 3 on microSD. > > > > Log files are at > > http://www.zefox.net/~fbsd/rpi3/swaptests/r338342/ > > for the combinations tried so far. > > > > It looks as if using all six GB of swap doesn't cause any immediate problem, > at least so long as swap usage stays relatively low, say 1.5 GB. In a final > test, TRIM was turned on without catastrophe, though it had little to do > given that all the busy filesystems were on USB. The penalty was about one > hour extra (25 vs 24 hours) to run -j4 buildworld from a clean start. > > One chance observation caught my attention, however. I'd always thought > the VM system would favor fast swap devices over slow, but the gstat log > recorded this, visible at > http://www.zefox.net/~fbsd/rpi3/swaptests/r338342/3gbsd_3gbusb/trim_on/swapscript.log What makes you believe that the VM system has any concept about the speed of swap devices? IIRC it simply uses them in a round robbin fashion with no knowlege of them being fast or slow, or shared with files systems or other stuff. > dT: 10.004s w: 10.000s > L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps ms/d %busy Name > 3 175 91 673 4.0 84 701 4.0 0 0 0.0 24.4 mmcsd0 > 4 173 88 693 106.6 86 723 176.5 0 0 0.0 103.4 da0 > 1 58 30 224 4.5 28 220 4.1 0 0 0.0 14.5 mmcsd0s2b > 3 175 91 673 4.0 84 701 4.0 0 0 0.0 24.7 mmcsd0s2 > 1 58 30 223 4.0 28 244 3.8 0 0 0.0 14.0 mmcsd0s2d > 1 59 31 227 3.7 28 237 4.3 0 0 0.0 14.9 mmcsd0s2e > 2 57 28 235 140.2 28 236 103.8 0 0 0.0 186.1 da0a > 0 56 28 224 178.4 28 222 35.9 0 0 0.0 131.5 da0b > 2 59 31 234 9.4 28 240 59.1 0 0 0.0 99.5 da0d > 0 0 0 0 0.0 0 3 15011 0 0 0.0 150.1 da0e > 0 1 0 0 0.0 1 22 13376 0 0 0.0 147.8 da0g > Tue Sep 4 15:07:39 PDT 2018 > Device 1K-blocks Used Avail Capacity > /dev/da0b 1048576 236872 811704 23% > /dev/mmcsd0s2b 1048576 221568 827008 21% > /dev/da0d 1048576 218636 829940 21% > /dev/da0a 1048576 222028 826548 21% > /dev/mmcsd0s2d 1048576 221660 826916 21% > /dev/mmcsd0s2e 1048576 221392 827184 21% > Total 6291456 1342156 4949300 21% > Sep 4 14:57:52 www sshd[41673]: error: Received disconnect from 103.207.39.197 port 64499:3: com.jcraft.jsch.JSchException: Auth cancel [preauth] > Sep 4 15:04:19 www kernel: swap_pager: indefinite wait buffer: bufobj: 0, blkno: 2217840, size: 12288 > > The system has lots of fast swap available on microSD, but is seemingly choking > trying to use the slow swap on da0 _and_ run traffic to /usr and /var. Buildworld > doesn't run any faster with less swap, so I don't think the oversupply is the problem. > > Is this expected behavior? I believe so, if da0 is a slow device to swap to it should probably not be used for swap. Unless things have drastically changed there are no priorites, speed, or load concerns about other stuff on the same device being considered by the VM system. > Thanks for reading, > bob prohaska -- Rod Grimes rgrimes@freebsd.org