From owner-freebsd-arm@freebsd.org Tue Jul 14 01:45:47 2015 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 679D3998C81 for ; Tue, 14 Jul 2015 01:45:47 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery4.ore.mailhop.org (pmta2.delivery4.ore.mailhop.org [54.200.247.200]) by mx1.freebsd.org (Postfix) with SMTP id 4A0261E23 for ; Tue, 14 Jul 2015 01:45:46 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 14 Jul 2015 01:45:33 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t6E1jiJS048278; Mon, 13 Jul 2015 19:45:44 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1436838344.1334.259.camel@freebsd.org> Subject: Re: Swap on SD or on usb flash drive for rpi2? From: Ian Lepore To: bob prohaska Cc: freebsd-arm@freebsd.org Date: Mon, 13 Jul 2015 19:45:44 -0600 In-Reply-To: <20150714012444.GA24345@www.zefox.net> References: <20150714012444.GA24345@www.zefox.net> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2015 01:45:47 -0000 On Mon, 2015-07-13 at 18:24 -0700, bob prohaska wrote: > Hi all, > > For some reason my rpi2 insists on having a token amount of swap. > It's running FreeBSD rpi2 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r285428: Sun Jun 14 02:20:56 UTC 2015 bob@rpi2:/usr/obj/usr/src/sys/RPI2 arm > (please disregard the date, the system built itself today, July 13 2015) > > When running a buildworld cycle it uses about 68 MB of swap. It > happens that the md filesystems use close to the same amount of > space. By any chance could the need for swap be eliminated if the > memory filesystems were replaced by physical partitions on the > SD card or a usb flash device? > > If physical swap _is_ mandatory is there significant advantage to > placing it on a device separate from /, as with mechanical disks? > > Thanks for reading and any guidance, > > bob prohaska It's probably better for performance to keep /tmp as a memory filesystem. Also, such filesystems only use as much memory as they have files stored in them. When you delete files the md driver releases the memory. There's no reason for /var/tmp and /var/log to be memory filesystems. It doesn't matter where a swapfile goes on a flash device, since there's no overhead for seeking. It's likely you only need the swap for a few seconds during buildworld, as it builds bits of clang (especially the tblgen app which takes a ton of memory to build). -- Ian