From owner-freebsd-hackers@freebsd.org Tue Oct 11 16:18:49 2016 Return-Path: Delivered-To: freebsd-hackers@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 8AD39C0D7F0 for ; Tue, 11 Oct 2016 16:18:49 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3CE5FB for ; Tue, 11 Oct 2016 16:18:49 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id u9BGIavu096745; Tue, 11 Oct 2016 09:18:36 -0700 (PDT) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id u9BGIEXg096743; Tue, 11 Oct 2016 09:18:14 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201610111618.u9BGIEXg096743@pdx.rh.CN85.dnsmgr.net> Subject: Re: Why at least 4 cylinder groups? In-Reply-To: <20161011160646.GT68202@kib.kiev.ua> To: Konstantin Belousov Date: Tue, 11 Oct 2016 09:18:14 -0700 (PDT) CC: Peter Jeremy , Norbert Koch , freebsd-hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Mailman-Approved-At: Tue, 11 Oct 2016 16:26:48 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 16:18:49 -0000 > On Tue, Oct 11, 2016 at 06:14:09PM +1100, Peter Jeremy wrote: > > On 2016-Oct-11 08:50:44 +0200, Norbert Koch wrote: > > >Am 2016-10-10 um 17:26 schrieb Rodney W. Grimes: > > >>> In an embedded system I am having a rather > > >>> small (static) ram disk of about 1.5MB, > > >>> formatted as UFS(1). > > > > ufs2 is designed to work around some space limitations in ufs1 and so > > needs more space. If you're space-limited, ufs1 is probably a better choice. > > > > >>> Is there any technical reason not to have less > > >>> than 4 cylinder groups? > > >> Probably on a UFS2 file system yes, but as far as I can > > >> see not on a UFS1 file system. > > >> > > >>> For my application the wasted 188KB make a difference. > > ... > > >So, afaics technically one cylinder group would be ok for UFS1, right? > > > > The reasons for multiple CGs are: > > 1) Improve performance by limiting the seek distance to a CG. > > 2) Provide redundant superblocks to protect against bad blocks. > > Neither of these reasons apply to a ramdisk. > > > > If you're keen to maximise data space, you might like to also reduce > > ipg (increase '-i'). > > I am not aware of the reason why MINCYLGRPS exists at all. I tracked back in svn and this was infact added with the UFS2 support, I understand the goal in the code, which is good for larger file systems, but is probably a bad idea when the file system total size is so small that a CG would not contain at least something like 64 cylinders. This is a regersion, very old, but should probably be looked at by Kirk or another FS expert. Commit that added the relevant #define and code implementing MINCYLGRPS https://svnweb.freebsd.org/base?view=revision&revision=98542 And relative parts of that commit: https://svnweb.freebsd.org/base/head/sys/ufs/ffs/fs.h?r1=98542&r2=98541&pathrev=98542 https://svnweb.freebsd.org/base/head/sbin/newfs/mkfs.c?r1=98542&r2=98541&pathrev=98542 ... -- Rod Grimes rgrimes@freebsd.org