[Top] [All Lists]

Re: [PATCH] Re: Reduce XFS footprint (was Re: TAKE - remove a function x

To: Andi Kleen <ak@xxxxxxx>
Subject: Re: [PATCH] Re: Reduce XFS footprint (was Re: TAKE - remove a function xfs added to filemap.c
From: Eric Sandeen <sandeen@xxxxxxx>
Date: 29 Jan 2002 14:42:12 -0600
Cc: Nathan Scott <nathans@xxxxxxx>, linux-xfs@xxxxxxxxxxx
In-reply-to: <20020129211758.A8117@xxxxxxxxxxxxx>
References: <200201291751.g0THp897004750@xxxxxxxxxxxxxx> <20020129194001.A16401@xxxxxxxxxxxxx> <20020129202509.A31370@xxxxxxxxxxxxx> <1012334201.5905.25.camel@xxxxxxxxxxxxxxxxxxxxxx> <20020129211758.A8117@xxxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
On Tue, 2002-01-29 at 14:17, Andi Kleen wrote:
> On Tue, Jan 29, 2002 at 01:56:41PM -0600, Eric Sandeen wrote:
> > Yep, I just saw that.   And FWIW, the stated limit for the filesystem
> > size w/o XFS_BIG_FILESYSTEMS isn't quite right*.  I think these are
> > correct (these are internal XFS limitations):
> > 
> > File size:
> > o Without XFS_BIG_FILES, the max filesize is 1<<40, or 2TiB.
> I misread blockno in xfs_types.h as byteno. It should be 2^31 * blocksize,
> which would be 2^43 with 4K blocks or more with bigger block size.
> I don't see any other limit.
> How do you get to 2^40 ? 

in xfs_inode.h:

#define XFS_MAX_FILE_OFFSET     ((long long)((1ULL<<(32+PAGE_SHIFT))-1ULL))
#define XFS_MAX_FILE_OFFSET     ((1LL<<40)-1LL)

and XFS_MAX_FILE_OFFSET is used to set sb->s_maxbytes
(the latter case is stock XFS, the former is something I changed, might
be off by a factor of 2?  hm....)

The comment blurb says
 * if XFS_BIG_FILES [...]
 * else 2^40 - 1 (40=31+9) (might be an int holding a block #)

Not quite sure where this comes from, actually.

> Also Linux/32bit is VM limited to 2^31 * PAGE_SIZE, so assuming PAGE_SIZE==
> blocksize XFS_BIG_FILES should not be needed at all on 32bit linux.

Does the VM actually enforce this limit?  I thought I had a case where I
could create a too-large file if XFS allowed it.  Also I thought the
limit was 2^32 * PAGE_SIZE...  /me goes back to look.
> On 64bit it probably makes sense to hardcode them both to 1. 
> Where I am wrong ? 
> > o With XFS_BIG_FILES, the max filesize is 1<<63-1.
> >   However, Linux can only handle 1<<(32+PAGE_SHIFT), or
> 2^(31+PAGE_SHIFT)

Whoops...  so the page cache index is signed...?


Eric Sandeen      XFS for Linux     http://oss.sgi.com/projects/xfs
sandeen@xxxxxxx   SGI, Inc.

<Prev in Thread] Current Thread [Next in Thread>