From owner-freebsd-hackers Mon Jan 8 12:12:20 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA02680 for hackers-outgoing; Mon, 8 Jan 1996 12:12:20 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA02670 for ; Mon, 8 Jan 1996 12:12:17 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id NAA10273; Mon, 8 Jan 1996 13:08:42 -0700 From: Terry Lambert Message-Id: <199601082008.NAA10273@phaeton.artisoft.com> Subject: Re: large files To: gpalmer@westhill.cdrom.com Date: Mon, 8 Jan 1996 13:08:42 -0700 (MST) Cc: wosch@cs.tu-berlin.de, hackers@FreeBSD.org In-Reply-To: <4727.821108353@westhill.cdrom.com> from "gpalmer@westhill.cdrom.com" at Jan 8, 96 05:39:13 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org Precedence: bulk > > On FreeBSD 2.0 I can mmap only file less than 2GB (SSIZE_MAX alias > > INT_MAX). On FreeBSD 2.1 I can't write(2) to files larger than 2GB > > (and don't test if mmap works with 2GB files). > > > > Why? > > Because of various restrictions in the kernel, files >>2Gb aren't > supported anyhow. I believe John Dyson has commited fixes to -current > to increase this limit. (AFAIR, the file offset is kept as a signed > int in the kernel, and the negative offsets are used to keep file > metadata. If you look through the mail list archives, you may find > discussions on this - I know that when we first fixed the code to > support 1Tb FS's there was a discussion about file sizes). I believe the restriction is based on mmap'ed files taking a portion of the kernel address space equal to their size. This is arguably a design flaw in the mmap implementation. Really, mmap wants to operate on a demand paged window and arrange the vnode as the mappable entity so that it can be shared between various processes without taking kernel address space to do it. You need to talk to the VM guys about fixing this. > Writing to a file past the 2Gb point would have rather unpredictable > results as you could probably understand, which is why the mmap() > restriction is there also. I see no real basis for this statement. The 2G limit is imposed as a result of VM restrictions (see the code in /sys/ufs/ffs/ffs_vfsops.c in the routine ffs_vmlimits() for details). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.