arm64: hugetlb: Fix handling of young ptes
authorSteve Capper <steve.capper@arm.com>
Fri, 21 Sep 2018 15:34:04 +0000 (16:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Nov 2018 13:52:38 +0000 (14:52 +0100)
commit1241679ce248b13db2193ef04b942098fa85e3ec
tree3bd1a831f6b04b584badcc304f46e2f2c7b163fe
parent1157713407a691eb48b2d6abfda1bc87b0c3848d
arm64: hugetlb: Fix handling of young ptes

[ Upstream commit 469ed9d823b7d240d6b9574f061ded7c3834c167 ]

In the contiguous bit hugetlb break-before-make code we assume that all
hugetlb pages are young.

In fact, remove_migration_pte is able to place an old hugetlb pte so
this assumption is not valid.

This patch fixes the contiguous hugetlb scanning code to preserve young
ptes.

Fixes: d8bdcff28764 ("arm64: hugetlb: Add break-before-make logic for contiguous entries")
Signed-off-by: Steve Capper <steve.capper@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/mm/hugetlbpage.c