Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jan 1996 13:08:42 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        gpalmer@westhill.cdrom.com
Cc:        wosch@cs.tu-berlin.de, hackers@FreeBSD.org
Subject:   Re: large files
Message-ID:  <199601082008.NAA10273@phaeton.artisoft.com>
In-Reply-To: <4727.821108353@westhill.cdrom.com> from "gpalmer@westhill.cdrom.com" at Jan 8, 96 05:39:13 am

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601082008.NAA10273>