Files
linux/arch/s390/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
..
2014-03-04 10:41:04 +01:00
2016-06-13 15:58:23 +02:00
2016-06-13 15:58:19 +02:00
2016-03-07 16:54:32 +01:00
2015-10-14 14:32:15 +02:00
2015-11-27 09:24:17 +01:00
2016-08-29 11:05:09 +02:00
2015-03-25 11:49:33 +01:00
2016-03-02 17:01:56 +02:00
2013-01-08 10:57:09 +01:00
2023-05-15 12:36:37 +09:00
2012-03-28 18:30:02 +01:00
2023-05-15 13:59:12 +09:00
2016-06-13 15:58:17 +02:00
2013-11-13 20:21:46 +01:00
2015-03-25 11:49:33 +01:00
2016-06-13 15:58:26 +02:00
2016-06-13 15:58:24 +02:00
2016-01-19 12:14:01 +01:00
2016-08-07 23:47:20 -04:00
2011-12-27 11:27:12 +01:00
2016-06-28 09:33:00 +02:00
2010-06-09 11:12:36 +02:00
2015-03-25 11:49:33 +01:00
2015-08-03 18:40:25 +02:00
2015-10-27 09:33:55 +01:00
2016-01-26 12:45:49 +01:00
2016-06-20 09:54:04 +02:00
2023-05-12 17:16:36 +09:00
2016-06-10 12:07:30 +02:00
2012-09-26 15:44:57 +02:00
2015-11-27 09:24:14 +01:00
2015-03-25 11:49:33 +01:00
2016-06-13 15:58:21 +02:00
2015-02-12 18:54:14 -08:00
2015-03-25 11:49:33 +01:00
2016-10-17 11:25:25 +02:00
2016-01-11 13:01:24 +01:00
2012-11-30 17:47:28 +01:00