]> git.hungrycats.org Git - linux/commit
[PATCH] shmem: inodes and links need lowmem
authorHugh Dickins <hugh@veritas.com>
Tue, 14 Sep 2004 00:45:36 +0000 (17:45 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 14 Sep 2004 00:45:36 +0000 (17:45 -0700)
commit77cdadab214c6d4cbc25ec5c675ebd34015d2323
treee191f991ce180b40a46076fb975bcfa16db99013
parentfe658b15e8afd06f70376ff5318515dc45c655a7
[PATCH] shmem: inodes and links need lowmem

Keith Mannthey's Bugzilla #3268 drew attention to how tmpfs inodes and
dentries and long names and radix-tree nodes pin lowmem.  Assuming about 1k of
lowmem per inode, we need to lower the default nr_inodes limit on machines
with significant highmem.

Be conservative, but more generous than in the original patch to Keith: limit
to number of lowmem pages, which works out around 200,000 on i386.  Easily
overridden by giving the nr_inodes= mount option: those who want to sail
closer to the rocks should be allowed to do so.

Notice how tmpfs dentries cannot be reclaimed in the way that disk-based
dentries can: so even hard links need to be costed.  They are cheaper than
inodes, but easier all round to charge the same.  This way, the limit for hard
links is equally visible through "df -i": but expect occasional bugreports
that tmpfs links are being treated like this.

Would have been simpler just to move the free_inodes accounting from
shmem_delete_inode to shmem_unlink; but that would lose the charge on unlinked
but open files.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Documentation/filesystems/tmpfs.txt
mm/shmem.c