Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Sep 2018 01:08:22 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        bob prohaska <fbsd@www.zefox.net>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: RPI3 swap experiments (r338342 with vm.pageout_oom_seq="1024" and 6 GB swap)
Message-ID:  <DA13F010-A14E-4C5D-BE3F-1F972A50A6CB@yahoo.com>
In-Reply-To: <20180915050842.GA65045@www.zefox.net>
References:  <20180815013612.GB51051@www.zefox.net> <CANCZdfoB_AcidFpKT_ZmZWUFnmC4Bw55krK%2BMqEmmj=f9KMQ2Q@mail.gmail.com> <20180815225504.GB59074@www.zefox.net> <20180901230233.GA42895@www.zefox.net> <20180906003829.GC818@www.zefox.net> <FB333A71-47D8-4038-9983-116DA80FC952@yahoo.com> <20180906051520.GB3482@www.zefox.net> <059D2FED-6E7C-4FEF-8807-8D4A0D0B3E26@yahoo.com> <20180906155858.GA5980@www.zefox.net> <075BD4BB-CAFB-4C9B-809A-10901522D1ED@yahoo.com> <20180915050842.GA65045@www.zefox.net>

next in thread | previous in thread | raw e-mail | index | archive | help


On 2018-Sep-14, at 10:08 PM, bob prohaska <fbsd at www.zefox.net> wrote:

> On Thu, Sep 06, 2018 at 10:32:50AM -0700, Mark Millard wrote:
>>=20
>> It appears to me that for the devices that you are currently using,
>> you are better off for elapsed time having the swap only on the
>> sdcard.
>>=20
> In practical terms this seems true. I set up a 16 GB Sandisk Ultra
> Plus microSD card with a single partition for / and 1.8 GB of swap=20
> at the end, running r338572 with vm.pageout_oom_seq=3D"1024". It =
finished=20
> -j4 buildworld successfully but ran out of space in buildkernel. 32=20
> GB would have been far more than sufficient.

I build with debug symbols but with optimizations still enabled.
The last time I built on 32 GByte media the buildworld/buildkernel
tree was:

# du -sm /mnt/usr/obj/*
11024	/mnt/usr/obj/cortexA53_clang

With ports builds and installs and the like to do I found
32 GByte not being big enough:

# du -sm /mnt/usr/*
518	/mnt/usr/bin
1	/mnt/usr/home
25	/mnt/usr/include
2241	/mnt/usr/lib
1	/mnt/usr/libdata
13	/mnt/usr/libexec
2949	/mnt/usr/local
11024	/mnt/usr/obj
2423	/mnt/usr/ports
58	/mnt/usr/sbin
106	/mnt/usr/share
3968	/mnt/usr/src
145	/mnt/usr/tests
19	/mnt/usr/typescripts

So just /usr totaled to:

# du -sm /mnt/usr
23484	/mnt/usr

# df -m /dev/da4s2a=20
Filesystem  1M-blocks  Used Avail Capacity  Mounted on
/dev/da4s2a     29400 23966  3082    89%    /mnt

I had the swap on another device.

I also do not expect nearly full flash media
to perform well, instead preferring to have
lots of free space of some form, for example
instead using 128 MByte media (that does have
swap on it):

# df -m
Filesystem               1M-blocks  Used Avail Capacity  Mounted on
/dev/label/PINE64P2Groot    109101 38396 61976    38%    /



> There were many spurious
> "indefinite wait"

It looks like the distinct swap_pager messages for the ultra plus
only example were (for those recorded in swapscript.log anyway):

$ grep swap_pager: ~/Downloads/swapscript_rpi3_ultra_plus.log | sort | =
uniq
Sep 11 07:12:52 www kernel: swap_pager: indefinite wait buffer: bufobj: =
0, blkno: 88445, size: 4096
Sep 11 07:13:01 www kernel: swap_pager: indefinite wait buffer: bufobj: =
0, blkno: 464452, size: 12288
Sep 11 07:13:56 www kernel: swap_pager: indefinite wait buffer: bufobj: =
0, blkno: 11922, size: 4096
Sep 11 11:34:08 www kernel: swap_pager: indefinite wait buffer: bufobj: =
0, blkno: 295286, size: 8192
Sep 11 11:34:08 www kernel: swap_pager: indefinite wait buffer: bufobj: =
0, blkno: 371269, size: 4096
Sep 11 12:48:23 www kernel: swap_pager: indefinite wait buffer: bufobj: =
0, blkno: 408974, size: 4096
Sep 11 13:09:07 www kernel: swap_pager: indefinite wait buffer: bufobj: =
0, blkno: 293166, size: 8192
Sep 11 13:10:19 www kernel: swap_pager: indefinite wait buffer: bufobj: =
0, blkno: 226334, size: 8192


> and a few "out of swap" warnings on the console,

I do see one swap_pager_getswapspace  in the swapscript.log
(original name):

$ grep "swap" ~/Downloads/swapscript_rpi3_ultra_plus.log | sort | uniq
Sep 11 04:34:35 www kernel: swap_pager_getswapspace(32): failed
. . .

But I do not find "out of swap".

I do not see examples of I/O error reports.

> but nothing came of them. A faster microSD card might have avoided
> the warnings entirely, the Ultra Plus isn't the fastest horse in the
> stable.=20

I do not know what mode of use the microsd card was used in. That
likely would be reported in "boot -v" output.

A point that might contribute is if the microsd cards have
application class A1 (or A2) or not. Paging is not sequential
I/O of just one type.

> I neglected to salvage the buildworld timing, but it was under 24 =
hours.

The log file shows:

World build started on Mon Sep 10 14:55:38 PDT 2018
. . .
World build completed on Tue Sep 11 13:14:12 PDT 2018

So somewhat under 22 hours and 20 minutes.

> Aftr moving /usr/src to a separate USB3.0 flash drive I repeated that
> test, adding experiments with swap on the same USB flash drive and
> swap on a second USB flash drive. All the tests succeeded, none=20
> sufficiently faster to justify the expense and complication of =20
> a second storage device.
>=20
> The log files are at
> http://www.zefox.net/~fbsd/rpi3/swaptests/r338572/
> if anybody's interested.
>=20
> It might make sense to divide storage to protect valuable data=20
> from wearout, but I've not seen any evidence (knock on wood!)
> that wearout of flash media is a serious problem with the Pi.
>=20
> Setting up a physical swap partition by hand at the end of the
> microSD card is fairly difficult. If it could be automated through
> the machinery invoked by /firstboot that would be a useful feature.



=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DA13F010-A14E-4C5D-BE3F-1F972A50A6CB>