• Yu Zhao's avatar
    mm/memory.c: replace is_zero_pfn with is_huge_zero_pmd for thp · 3cde287b
    Yu Zhao authored
    For hugely mapped thp, we use is_huge_zero_pmd() to check if it's zero
    page or not.
    
    We do fill ptes with my_zero_pfn() when we split zero thp pmd, but this
    is not what we have in vm_normal_page_pmd() -- pmd_trans_huge_lock()
    makes sure of it.
    
    This is a trivial fix for /proc/pid/numa_maps, and AFAIK nobody
    complains about it.
    
    Gerald Schaefer asked:
    : Maybe the description could also mention the symptom of this bug?
    : I would assume that it affects anon/dirty accounting in gather_pte_stats(),
    : for huge mappings, if zero page mappings are not correctly recognized.
    
    I came across this while I was looking at the code, so I'm not aware of
    any symptom.
    
    Link: http://lkml.kernel.org/r/20191108192629.201556-1-yuzhao@google.comSigned-off-by: default avatarYu Zhao <yuzhao@google.com>
    Acked-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Ralph Campbell <rcampbell@nvidia.com>
    Cc: Will Deacon <will@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: "Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>
    Cc: Dave Airlie <airlied@redhat.com>
    Cc: Thomas Hellstrom <thellstrom@vmware.com>
    Cc: Souptick Joarder <jrdr.linux@gmail.com>
    Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    3cde287b
memory.c 128 KB