]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:46:30 +0000 (09:46 +0200)
commit58092b9ffaf7f683e1a35ecbfd01b1ecc3b1d0bf
tree9b3129292d2f152d94af6c388bb14e1d611fce9f
parente28f2a8621e8ae91e65dd28f73755a4861408167
hugetlb: clear huge pte during flush function on mips platform

BugLink: https://bugs.launchpad.net/bugs/1938713
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/mips/include/asm/hugetlb.h