• H
    mm: fix kernel BUG at huge_memory.c:1474! · a4f1de17
    Hugh Dickins 提交于
    Andrea's autonuma-benchmark numa01 hits kernel BUG at huge_memory.c:1474!
    in change_huge_pmd called from change_protection from change_prot_numa
    from task_numa_work.
    
    That BUG, introduced in the huge zero page commit cad7f613 ("thp:
    change_huge_pmd(): make sure we don't try to make a page writable")
    was trying to verify that newprot never adds write permission to an
    anonymous huge page; but Automatic NUMA Balancing's 4b10e7d5 ("mm:
    mempolicy: Implement change_prot_numa() in terms of change_protection()")
    adds a new prot_numa path into change_huge_pmd(), which makes no use of
    the newprot provided, and may retain the write bit in the pmd.
    
    Just move the BUG_ON(pmd_write(entry)) up into the !prot_numa block.
    Signed-off-by: NHugh Dickins <hughd@google.com>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    a4f1de17
huge_memory.c 73.2 KB