]> git.baikalelectronics.ru Git - kernel.git/commit
mm: fix kernel BUG at huge_memory.c:1474!
authorHugh Dickins <hughd@google.com>
Mon, 17 Dec 2012 02:56:58 +0000 (18:56 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 17 Dec 2012 03:02:38 +0000 (19:02 -0800)
commit3f3d7c5d4be06238451803a61d4c537426dbfcef
tree9193f723c6f61442cf1fbc50e2db48d060f417d6
parent80ad8021e4a5fb3eb00a44bdc58f68b8a0396c1c
mm: fix kernel BUG at huge_memory.c:1474!

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 d1c12d382eb6 ("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 93fc1ad34f95 ("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: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/huge_memory.c