• Hugh Dickins's avatar
    [PATCH] statm: __vm_stat_accounting · da63671a
    Hugh Dickins authored
    The procfs shared_vm accounting in do_mmap_pgoff didn't balance with munmap
    in the case of shared anonymous: because file comes in NULL, whereas
    vm_file gets set at the end by shmem_zero_setup.
    
    Update file; and update vm_flags (a driver is likely to add VM_IO or
    VM_RESERVED, modifying reserved_vm); and update pgoff (doesn't affect
    procfs accounting, but could affect vma_merge - though at present all
    drivers which modify vm_pgoff set a VM_SPECIAL which prevents merging). 
    And do that __vm_stat_account before advancing to make_pages_present.
    Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
    Acked-by: default avatarWilliam Irwin <wli@holomorphy.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    da63671a
mmap.c 50.8 KB