From owner-freebsd-arm@freebsd.org Sat Jun 23 14:50:06 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 A791C10239EA for ; Sat, 23 Jun 2018 14:50:06 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-9.consmr.mail.gq1.yahoo.com (sonic307-9.consmr.mail.gq1.yahoo.com [98.137.64.33]) (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 2C5D884D76 for ; Sat, 23 Jun 2018 14:50:06 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: OB7mX5QVM1mDViKZXwZs7eFxxajlt9y0zJP9n7Jrhd52rMj_rebGNc6CVXwDhEh ROXj_SeO6pP8TUrM.owjmCw7LG3qSY_P9UV1i0HOzSJbB1rB3bHPsu0joUFnVhJb2K7shwRGA2bc 0_RGdQGuVh0sjjzbwvkaIAQkcnMfqG06Jjl.vatP8rgCIGUAyB7vn6nF8eSdk3QpXPeLGD56yytw IRPNQYOZIz8l5MPMReVZT7wwvuTFAg9IEkZZ4BUSAp65kYIoG2QlHHbP0Y_ufOEPIAFd.FfHRzUz zSmhJD_J.gepv8l0pSpcRv6HXeouRn6oMfdYX4myIcMNAU.eakU0RG9NOAN1EVrRAreTMktL1vmC lcbGAObmp3XgyaZABbKNKcsQz6kPH3aDc227ePHOXW6ioA9ZgOI.MAqWLO36GccuTHo20cYn4Yjv 8be.RKAe3ek8SlxewRd7B0ew5E8yiiqKHuet1A3YbkFOTNSl4STbzzNsWJGrkKh9aDreXl4LdWgs m0MP4gHP_Eg1Y5GB_BSNWkXE9wL96kQ2vR64PAjmLLn8CV371O6VxJFsDIpM32ZLPHxwKDusYx1A YUfvAn6dIn9KlzVU3F0r1mncMJmnGA1Gtnhi.JmIWqkgEDtciSLqKpo3toUHMY4AUsjr175NbULp oo7ls21l.rA5mK9.W2Yc1OxsL.cLgD1gK6PvpIe6nyuKW0G4fgakLmvMjXfcsluACsVoEm8uVW_8 OavBaygKQUpJrBwIpzlhIQ3GT4ezzIUyO8O8oHgstClCGMIGc75u8ses2XRYhxyqhwZylHfUST6f x2qq4EDTlkJThM7PPcmzV9KAddALprV6wAjGWYKMFRQmZCUWeIKavBrciq1vcvXc0kStNl8iGgLC v49J8POZegWJhaOskG8oZjOTApb9aXixmFz6XJQMn6sc_Gmdwt8uHzbutfKohWtebD1rkq89u21L w4gpVCHLtypjfbVb1VsuNcQ7b5717_gGy0Owztj_.h2.llXNlObJVZGg- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.gq1.yahoo.com with HTTP; Sat, 23 Jun 2018 14:49:59 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.105]) ([70.189.131.151]) by smtp402.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 8e5f773237357dafdac6adc6524ae7e3; Sat, 23 Jun 2018 14:49:54 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: GPT vs MBR for swap devices From: Mark Millard In-Reply-To: <20180623143218.GA6905@www.zefox.net> Date: Sat, 23 Jun 2018 07:49:53 -0700 Cc: freebsd-arm , bob prohaska Content-Transfer-Encoding: quoted-printable Message-Id: <03C2D3C4-6E90-4054-AF79-BD7FE2B7958D@yahoo.com> References: <25F1A4BA-FBFC-4C32-85DD-5F5BA71A2B1A@yahoo.com> <20180620023253.GA89924@www.zefox.net> <1D86911D-20D1-494A-822B-1C07C5598CB1@yahoo.com> <10CAC122-399D-459E-9153-ABD7E753777E@yahoo.com> <20180623143218.GA6905@www.zefox.net> To: Trev X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2018 14:50:07 -0000 On 2018-Jun-23, at 7:32 AM, bob prohaska 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 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)