From owner-freebsd-arm@freebsd.org Tue Mar 6 17:37:39 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 AAFF9F45586 for ; Tue, 6 Mar 2018 17:37:39 +0000 (UTC) (envelope-from fbsd@www.zefox.net) Received: from www.zefox.net (www.zefox.net [69.239.235.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "www.zefox.org", Issuer "www.zefox.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 24322818B1; Tue, 6 Mar 2018 17:37:38 +0000 (UTC) (envelope-from fbsd@www.zefox.net) Received: from www.zefox.net (localhost [127.0.0.1]) by www.zefox.net (8.15.2/8.15.2) with ESMTPS id w26HbUBQ053847 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Mar 2018 09:37:31 -0800 (PST) (envelope-from fbsd@www.zefox.net) Received: (from fbsd@localhost) by www.zefox.net (8.15.2/8.15.2/Submit) id w26HbTkE053846; Tue, 6 Mar 2018 09:37:29 -0800 (PST) (envelope-from fbsd) Date: Tue, 6 Mar 2018 09:37:29 -0800 From: bob prohaska To: Warner Losh Cc: Ian Lepore , "freebsd-arm@freebsd.org" , bob prohaska Subject: Re: Is maximum swap usage tunable? Message-ID: <20180306173729.GA51223@www.zefox.net> References: <20180228214301.GA29481@www.zefox.net> <20180303162605.GA41874@www.zefox.net> <20180304182831.GA44154@www.zefox.net> <1520189171.38056.2.camel@freebsd.org> <20180304214003.GB44154@www.zefox.net> <20180305045723.GA47820@www.zefox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2018 17:37:40 -0000 On Sun, Mar 04, 2018 at 10:30:17PM -0700, Warner Losh wrote: > > I'd look at power. And add more swap. > Both have now been done. Voltage at the GPIO header is 5.01-5.04, idle all the way up to make -j4 buildworld. Swap was increased to 3 GB in two partitions on the microSD, with the usb-flash partition turned off for now. As make -j4 buildworld's logfile approached the 1.6 MB mark, I started gstat -a -d -B -I 1s > j4_3Gswap2_gstat.log and began watching the top display. Pretty soon, swap usage began to rise, peaking a little over 700 MB. Idle time remained low, no swread or pfault states were observed in top. Here's a snippet of gstat output from about this time: dT: 1.003s w: 1.000s L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps ms/d %busy Name 7 878 235 2213 9.9 643 3808 6.2 0 0 0.0 100.0 mmcsd0 7 878 235 2213 9.9 643 3808 6.2 0 0 0.0 100.0 mmcsd0s3 5 444 125 1228 9.6 319 1898 6.2 0 0 0.0 100.1 mmcsd0s3b 2 435 111 985 10.3 324 1910 6.1 0 0 0.0 99.8 mmcsd0s3d Perhaps an hour later the swap usage again rose, to somewhere around 500 MB, but swread and pfault began to appear in the top window's state column, and the idle time approached 50%, occasionally exceeding it. It's hard to locate the spot in the gstat output corresponding, but I think this is representative: dT: 1.006s w: 1.000s L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps ms/d %busy Name 6 240 22 219 11.5 218 2795 13.2 0 0 0.0 88.9 mmcsd0 6 240 22 219 11.5 218 2795 13.6 0 0 0.0 90.2 mmcsd0s3 3 123 15 179 10.3 108 1380 16.3 0 0 0.0 91.4 mmcsd0s3b 3 116 7 40 14.3 109 1416 11.9 0 0 0.0 68.7 mmcsd0s3d The machine got over this hump too, and is still running as I write. The log file is up to ~15MB, in the "building libraries" stage. It's curious that the initial burst of swap use seems to be handled more gracefully than the later, smaller, flurry of activity. Moreover, both are far below the 3GB swap limit of the partitions active. There is no warning from the kernel about too much swap space being allocated. Nor are there any "indefinite wait..." messages on the console. As an aside, the write speed of 2.8 MB/sec for the microSD card corresponds fairly well with the claimed 4k random write speed of 2.2 MB/sec for SanDisk Extreme flash memory. I'm not sure how this compares to a mechanical hard disk, but it _used_ to be ok. I note in passing that r330367 armv7 on a Pi2 also halts a make -j4 buildworld with 2GB of USB-hosted swap available. A previous revision, a couple of weeks older, ran to completion with the same configuration. Thanks for reading, if anybody can suggest more informative tests please do. Buildworld is a very clumsy stress test, Peter Holm's stress2 didn't compile the last time I tried it, many months ago. bob prohaska