• Hugh Dickins's avatar
    [PATCH] shmem: avoid the shmem_inodes list · 669d88ec
    Hugh Dickins authored
    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: default avatarHugh Dickins <hugh@veritas.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    669d88ec
shmem.c 53.5 KB