]> git.hungrycats.org Git - linux/commit
[PATCH] shmem: no sbinfo for shm mount
authorHugh Dickins <hugh@veritas.com>
Tue, 14 Sep 2004 00:45:49 +0000 (17:45 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 14 Sep 2004 00:45:49 +0000 (17:45 -0700)
commitf97cd2d945973e4064089ce5487bb2fe10472f88
treee783bf3db991b7b42db7e91b540e631cc5510d2b
parent77cdadab214c6d4cbc25ec5c675ebd34015d2323
[PATCH] shmem: no sbinfo for shm mount

SGI investigations have shown a dramatic contrast in scalability between
anonymous memory and shmem objects.  Processes building distinct shmem objects
in parallel hit heavy contention on shmem superblock stat_lock.  Across 256
cpus an intensive test runs 300 times slower than anonymous.

Jack Steiner has observed that all the shmem superblock free_blocks and
free_inodes accounting is redundant in the case of the internal mount used for
SysV shared memory and for shared writable /dev/zero objects (the cases which
most concern them): it specifically declines to limit.

Based upon Brent Casavant's SHMEM_NOSBINFO patch, this instead just removes
the shmem_sb_info structure from the internal kernel mount, testing where
necessary for null sbinfo pointer.  shmem_set_size moved within CONFIG_TMPFS,
its arg named "sbinfo" as elsewhere.

This brings shmem object scalability up to that of anonymous memory, in the
case where distinct processes are building (faulting to allocate) distinct
objects.  It significantly improves parallel building of a shared shmem object
(that test runs 14 times faster across 256 cpus), but other issues remain in
that case: to be addressed in later patches.

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