From owner-freebsd-hackers@freebsd.org Tue Oct 11 06:52:21 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 B35EFC0D062 for ; Tue, 11 Oct 2016 06:52:21 +0000 (UTC) (envelope-from nkoch@demig.de) Received: from demig.de (demig.de [81.169.228.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Parallels Panel", Issuer "Parallels Panel" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 21FC5DCC for ; Tue, 11 Oct 2016 06:52:20 +0000 (UTC) (envelope-from nkoch@demig.de) Received: (qmail 17394 invoked from network); 11 Oct 2016 08:51:15 +0200 Received: from b2b-130-180-89-86.unitymedia.biz (HELO firewall.demig.intra) (130.180.89.86) by demig.de with ESMTPSA (DHE-RSA-AES256-SHA encrypted, authenticated); 11 Oct 2016 08:51:15 +0200 Received: from SRV-FS-2.Demig.intra (nameserver.demig.intra [192.168.148.248]) by firewall.demig.intra (8.14.4/8.14.4) with ESMTP id u9B6ojKA083099 for ; Tue, 11 Oct 2016 08:50:45 +0200 (CEST) (envelope-from nkoch@demig.de) Received: from [192.168.148.215] (192.168.148.215) by SRV-FS-2 (192.168.148.248) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 11 Oct 2016 08:50:44 +0200 Subject: Re: Why at least 4 cylinder groups? References: <201610101526.u9AFQNuH091581@pdx.rh.CN85.dnsmgr.net> From: Norbert Koch To: Message-ID: <24c7ca75-d50d-a7d2-933b-15ce4cf04b94@demig.de> Date: Tue, 11 Oct 2016 08:50:44 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <201610101526.u9AFQNuH091581@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.73 on 192.168.148.235 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 06:52:21 -0000 Am 2016-10-10 um 17:26 schrieb Rodney W. Grimes: >> Hello. >> >> In an embedded system I am having a rather >> small (static) ram disk of about 1.5MB, >> formatted as UFS(1). >> >> Under FreeBSD 4 dumpfs shows me there is >> 1 cylinder group. >> >> Under FreeBSD 9 and 10 I see 4 cylinder groups. >> >> 4 is hard coded as the minimum value in ufs/ffs/fs.h. Why? > I beleive this constant only applies to UFS version 2, newfs -O 2, > which is default in FreeBSD 9 and 10. > >> 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. > Try: > newfs -O 1 I already use UFS1. I compiled newfs with MINCYLGRPS=1. This is what dumpfs gives me before and after: --- //Entw-pr2/nk/x/de95b Mon Oct 10 13:07:47 2016 +++ //Entw-pr2/nk/x/de95c Mon Oct 10 14:27:52 2016 @@ -1,19 +1,19 @@ -magic 11954 (UFS1) time Mon Oct 10 11:07:39 2016 -id [ 57fb7662 72cbad24 ] -ncg 4 size 3072 blocks 2143 +magic 11954 (UFS1) time Mon Oct 10 12:29:18 2016 +id [ 57fb8985 18e78a1d ] +ncg 1 size 3072 blocks 2247 bsize 4096 shift 12 mask 0xfffff000 fsize 512 shift 9 mask 0xfffffe00 frag 8 shift 3 fsbtodb 0 minfree 8% optim time symlinklen 60 maxbpg 512 maxcontig 32 contigsumsize 16 -nbfree 258 ndir 4 nifree 3189 nffree 30 -cpg 1 bpg 97 fpg 776 ipg 800 +nbfree 273 ndir 4 nifree 3061 nffree 13 +cpg 1 bpg 384 fpg 3072 ipg 3072 nindir 1024 inopb 32 nspf 1 maxfilesize 4402345721855 -sbsize 1536 cgsize 512 cgoffset 0 cgmask 0xffffffff -csaddr 256 cssize 512 +sbsize 1536 cgsize 1536 cgoffset 0 cgmask 0xffffffff +csaddr 824 cssize 512 rotdelay 0ms rps 60 trackskew 0 interleave 1 -nsect 776 npsect 776 spc 776 -sblkno 32 cblkno 48 iblkno 56 dblkno 256 +nsect 3072 npsect 3072 spc 3072 +sblkno 32 cblkno 48 iblkno 56 dblkno 824 cgrotor 0 fmod 0 ronly 0 clean 0 avgfpdir 64 avgfilesize 16384 ... So, afaics technically one cylinder group would be ok for UFS1, right?