Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Jun 2018 07:49:53 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Trev <freebsd-arm@sentry.org>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>, bob prohaska <fbsd@www.zefox.net>
Subject:   Re: GPT vs MBR for swap devices
Message-ID:  <03C2D3C4-6E90-4054-AF79-BD7FE2B7958D@yahoo.com>
In-Reply-To: <20180623143218.GA6905@www.zefox.net>
References:  <25F1A4BA-FBFC-4C32-85DD-5F5BA71A2B1A@yahoo.com> <20180620023253.GA89924@www.zefox.net> <a232ed45-a9a9-1017-72ed-720a6c7a8f03@sentry.org> <1D86911D-20D1-494A-822B-1C07C5598CB1@yahoo.com> <10CAC122-399D-459E-9153-ABD7E753777E@yahoo.com> <a2d7f4d3-0b6d-f82d-bae8-0988b0b54a8f@sentry.org> <20180623143218.GA6905@www.zefox.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2018-Jun-23, at 7:32 AM, bob prohaska <fbsd at www.zefox.net> wrote:

> On Fri, Jun 22, 2018 at 12:08:56PM +1000, Trev wrote:
>>=20
>>=20
>> Unfortunately my rpi3B+ is not a direct comparison with the rpi2B=20
>> because I only had the one USB2 memory device holding /usr, /usr/obj =
and=20
>> swap. I'll try moving swap to a dedicated USB2 memory device.
>=20
> Have you considered putting a swapfile on the microSD card? That's one
> of the things I have not tried. A swap partition on SD seems to work.=20=

> A swapfile is easier to try and may work.=20

See:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206048

for why I would not recommend using a swap file. In particular
comment 7 is a quote:

> On 2017-Feb-13, at 7:20 PM, Konstantin Belousov <kostikbel at =
gmail.com> wrote
> on the freebsd-arm list:
>=20

> . . .
>=20
> swapfile write requires the write request to come through the =
filesystem
> write path, which might require the filesystem to allocate more memory
> and read some data. E.g. it is known that any ZFS write request
> allocates memory, and that write request on large UFS file might =
require
> allocating and reading an indirect block buffer to find the block =
number
> of the written block, if the indirect block was not yet read.
>=20
> As result, swapfile swapping is more prone to the trivial and =
unavoidable
> deadlocks where the pagedaemon thread, which produces free memory, =
needs
> more free memory to make a progress.  Swap write on the raw partition =
over
> simple partitioning scheme directly over HBA are usually safe, while =
e.g.
> zfs over geli over umass is the worst construction.


Comment 3 from Tom Vijlbrief even reports a way to reproduce
such a problem with swap files:

> This is not related to ARM or USB, I can reproduce it in a VirtualBox =
amd64 client with the standard emulated hard disk.
>=20
> . . .
>=20
> stress -d 2 -m 3 --vm-keep
>=20
> will hang the system as well.


(This was on 2016-Jan-22.)

Another reproduction report is Comment 5 from Sevan Janiyan:

> In my case, to reproduce the behaviour, boot PI, add swap file as per =
handbook instructions[1], run cat /somefile > /someotherfile
>=20
> In this case /somefile is a 4GB file containing garbage from =
/dev/urandom






=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?03C2D3C4-6E90-4054-AF79-BD7FE2B7958D>