]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hugetlb: clear huge pte during flush function on mips platform
authorBibo Mao <maobibo@loongson.cn>
Mon, 29 Jun 2020 13:15:32 +0000 (21:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 08:00:44 +0000 (10:00 +0200)
commit4531ba202d2139a45ec1998ea1a8e19d8f78a9a4
treeeb07d9626e95f75b5ba6ef36aaf5a76842890b34
parente5d1c22b4aeb6d538b24773e55e8fc88c276008f
hugetlb: clear huge pte during flush function on mips platform

[ Upstream commit 33ae8f801ad8bec48e886d368739feb2816478f2 ]

If multiple threads are accessing the same huge page at the same
time, hugetlb_cow will be called if one thread write the COW huge
page. And function huge_ptep_clear_flush is called to notify other
threads to clear the huge pte tlb entry. The other threads clear
the huge pte tlb entry and reload it from page table, the reload
huge pte entry may be old.

This patch fixes this issue on mips platform, and it clears huge
pte entry before notifying other threads to flush current huge
page entry, it is similar with other architectures.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/include/asm/hugetlb.h