From owner-freebsd-hackers Sat Jul 6 18:22:48 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A8AD37B400 for ; Sat, 6 Jul 2002 18:22:43 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 22A4043E31 for ; Sat, 6 Jul 2002 18:22:42 -0700 (PDT) (envelope-from ticso@cicely5.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.3/8.12.3) with ESMTP id g671LtMa021382 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sun, 7 Jul 2002 03:22:26 +0200 (CEST) (envelope-from ticso@cicely5.cicely.de) Received: from cicely5.cicely.de (localhost [IPv6:::1]) by cicely5.cicely.de (8.12.1/8.12.1) with ESMTP id g671LiFJ046511 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 7 Jul 2002 03:21:44 +0200 (CEST)?g (envelope-from ticso@cicely5.cicely.de) Received: (from ticso@localhost) by cicely5.cicely.de (8.12.1/8.12.1/Submit) id g671LV2j046510; Sun, 7 Jul 2002 03:21:31 +0200 (CEST)?g (envelope-from ticso) Date: Sun, 7 Jul 2002 03:21:30 +0200 From: Bernd Walter To: Matthew Dillon Cc: Bernd Walter , Terry Lambert , Darren Pilgrim , ticso@cicely.de, freebsd-hackers@FreeBSD.ORG Subject: Re: How does swap work address spacewise? Message-ID: <20020707012130.GM23704@cicely5.cicely.de> Reply-To: ticso@cicely.de References: <3D2640A7.3EA2236B@pantherdragon.org> <20020706020656.GL48977@cicely5.cicely.de> <3D2762FE.9D9E0378@pantherdragon.org> <20020706220720.GG23704@cicely5.cicely.de> <3D277274.B5F3CE58@pantherdragon.org> <3D2776BE.A39A1110@mindspring.com> <20020706231346.GJ23704@cicely5.cicely.de> <200207062342.g66NgMri063859@apollo.backplane.com> <20020707001019.GK23704@cicely5.cicely.de> <200207070033.g670XoMJ064092@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200207070033.g670XoMJ064092@apollo.backplane.com> X-Operating-System: FreeBSD cicely5.cicely.de 5.0-CURRENT i386 User-Agent: Mutt/1.5.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Jul 06, 2002 at 05:33:50PM -0700, Matthew Dillon wrote: > > : > :On Sat, Jul 06, 2002 at 04:42:22PM -0700, Matthew Dillon wrote: > :> Negative block numbers are used by UFS to represent the indirect blocks > :> associated with a file, while positive block numbers represent the > :> contents of the file. > : > :I never saw any negative block numbers in on-disc structures. > :Now I wonder if it was just hidden behind macros. > :What is the reason to handle it that way? > :Do you have some code reference for homework? > > LOGICAL block numbers, not physical block numbers. ufs on disc structures are using logical block numbers. But well I've already found what you mean. > :> These are logical block numbers, which are fragment-sized (1K typically). > :> So, 2^31 x 1K = 2TB. > :> > :> Physical block numbers are 512-byte sized, with a range of 2^32 > :> in -stable. This also winds up being 2TB. So increasing the fragment > :> size does not help in -stable. > : > :It's a proven fact that there is a 1T limit somewhere which was > :explained with physical block numbers beeing signed. > > test1# vnconfig -e -s labels -r reserve -S 2t vn0 > test1# disklabel -r -w vn0 auto > test1# disklabel vn0 > ... > bytes/sector: 4096 > ... > 8 partitions: > # size offset fstype [fsize bsize bps/cpg] > c: 536870912 0 unused 0 0 # (Cyl. 0 - 2097151) > > Theoretically VN can create up to an 8TB virtual disk because the > sector size for a swap-backed VN device is 4K, but I'm not sure I > would want to test the theory. > > > With a regular file: > > test1# vnconfig -e -s labels -T -S 2047g vn0 test.dat > test1# disklabel -r -w vn0 auto > test1# disklabel vn0 > ... > bytes/sector: 512 > ... > c: 4292870144 0 unused 0 0 # (Cyl. 0 - 2 > > test1# ls -la test.dat > -rw---xr-- 1 root wheel 2199023255552 Jul 7 00:31 test.dat > test1# > > (of course, god help you if you tried to 'newfs' the above!) But that's the important point. You can happily create vinum 2T volumes but you can never newfs them, because daddr_t, which is used in struct buf, is signed. This case was tested using real disks. OK you can format a disk using 1k sectors. But I was told that vm internaly always adapts to 512 byte blocks using signed 32bit varables so it wouldn't help. -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message