Files
linux/arch/arm/include/asm
Nadav Amit caa8b9ed84 hugetlbfs: flush TLBs correctly after huge_pmd_unshare
commit a4a118f2ee upstream.

When __unmap_hugepage_range() calls to huge_pmd_unshare() succeed, a TLB
flush is missing.  This TLB flush must be performed before releasing the
i_mmap_rwsem, in order to prevent an unshared PMDs page from being
released and reused before the TLB flush took place.

Arguably, a comprehensive solution would use mmu_gather interface to
batch the TLB flushes and the PMDs page release, however it is not an
easy solution: (1) try_to_unmap_one() and try_to_migrate_one() also call
huge_pmd_unshare() and they cannot use the mmu_gather interface; and (2)
deferring the release of the page reference for the PMDs page until
after i_mmap_rwsem is dropeed can confuse huge_pmd_unshare() into
thinking PMDs are shared when they are not.

Fix __unmap_hugepage_range() by adding the missing TLB flush, and
forcing a flush when unshare is successful.

Fixes: 24669e5847 ("hugetlb: use mmu_gather instead of a temporary linked list for accumulating pages)" # 3.6
Signed-off-by: Nadav Amit <namit@vmware.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-16 12:21:06 +09:00
..
2016-06-21 10:54:29 -05:00
2023-05-15 11:34:00 +09:00
2016-10-06 08:45:40 +01:00
2014-12-04 12:41:50 +00:00
2015-05-05 13:35:39 -06:00
2015-05-28 15:31:53 +02:00
2011-03-31 11:26:23 -03:00
2023-05-15 17:28:44 +09:00
2011-03-31 11:26:23 -03:00
2015-09-16 16:53:39 +02:00
2012-09-14 13:53:39 +00:00
2019-05-21 14:13:33 +08:00
2016-08-02 19:35:29 -04:00
2012-07-24 15:27:28 +08:00
2014-06-01 01:17:12 +01:00
2013-07-08 22:08:51 +01:00
2023-05-16 08:44:41 +09:00
2019-03-13 20:22:32 +08:00
2014-02-25 11:33:37 +00:00
2011-03-31 11:26:23 -03:00
2016-10-19 10:18:47 +01:00
2014-03-18 16:39:40 -04:00
2011-07-12 11:19:29 -05:00