• Nick Piggin's avatar
    [PATCH] smaps: shared fix · ad820c5d
    Nick Piggin authored
    The point of the smaps "shared" is to count the number of pages that are
    mapped by more than one process, according to Mauricio Lin.  However, smaps
    uses page_count for this, so it will return a false positive for every page
    that is mapped by just that one process, which is also in pagecache or
    swapcache.  There are false positive situations for anonymous pages not in
    swapcache as well: - page reclaim, migration - get_user_pages (eg.
    direct-io, ptrace)
    
    Use page_mapcount instead, to count the number of mappings to the page.
    
    Use vm_normal_page so that weird things like /dev/mem aren't counted either.
    Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    ad820c5d
task_mmu.c 9.34 KB