]> git.hungrycats.org Git - linux/commit
[PATCH] shmem: avoid the shmem_inodes list
authorHugh Dickins <hugh@veritas.com>
Tue, 14 Sep 2004 00:46:13 +0000 (17:46 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 14 Sep 2004 00:46:13 +0000 (17:46 -0700)
commit669d88ec23e11b44f6f039533c8b4a5b3adae812
treedcbc0edc33944fb5dfbe33ec9c539e16bba88820
parent35049977eaf4829c0d3cb3c911d07110ca95c0c4
[PATCH] shmem: avoid the shmem_inodes list

If we're thinking about shmem scalability...  isn't it silly that each shmem
object is added to the shmem_inodes list on creation, and removed on deletion,
yet the only use for that list is in swapoff (shmem_unuse)?

Call it shmem_swaplist; shmem_writepage add inode to swaplist when first swap
allocated (usually never); shmem_delete_inode remove inode from the list after
truncating (if called before, inode could be re-added to it).

Inode can remain on the swaplist after all its pages are swapped back in, just
be lazy about it; but if shmem_unuse finds swapped count now 0, save itself
time by then removing that inode from the swaplist.

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