Files
linux/arch/ia64/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
..
2015-06-10 14:26:32 -07:00
2016-04-18 12:45:54 +02:00
2014-08-26 13:45:52 -04:00
2016-01-12 20:46:55 +02:00
2014-04-18 14:20:35 +02:00
2023-05-15 13:57:01 +09:00
2013-02-26 02:46:08 -05:00
2016-08-07 23:55:50 -04:00
2015-06-10 14:26:32 -07:00
2015-06-10 14:26:32 -07:00
2016-03-17 15:09:34 -07:00
2016-03-31 13:35:08 +02:00
2015-06-10 14:26:32 -07:00
2012-03-28 18:30:02 +01:00
2010-06-09 11:12:36 +02:00
2012-03-28 18:30:02 +01:00
2010-05-18 14:45:52 -07:00
2015-06-10 14:26:32 -07:00
2011-03-31 11:26:23 -03:00
2012-03-28 18:30:02 +01:00
2013-01-03 15:57:13 -08:00
2014-08-26 13:45:52 -04:00