Files
linux/arch/sh/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
..
2008-07-29 08:09:44 +09:00
2010-11-04 12:32:24 +09:00
2012-03-28 18:30:03 +01:00
2012-03-28 18:30:03 +01:00
2012-03-12 22:19:10 +01:00
2016-01-12 20:47:01 +02:00
2016-01-12 20:47:01 +02:00
2012-01-13 16:27:38 +09:00
2012-05-19 18:50:09 +09:00
2008-07-29 08:09:44 +09:00
2013-01-11 21:02:57 +09:00
2008-07-29 08:09:44 +09:00
2014-01-23 16:36:54 -08:00
2009-05-29 08:40:02 -07:00
2008-07-29 08:09:44 +09:00
2009-10-14 16:42:28 +09:00
2011-07-26 16:49:47 -07:00
2012-05-18 14:52:31 +09:00
2010-11-01 09:49:04 -04:00
2023-05-15 14:08:10 +09:00
2012-05-21 17:54:01 +09:00
2010-10-07 14:08:55 +01:00
2012-05-24 15:03:46 +09:00
2010-06-14 15:16:53 +09:00
2008-07-29 08:09:44 +09:00
2010-03-10 16:29:48 +09:00
2008-07-29 08:09:44 +09:00
2010-01-20 16:42:52 +09:00
2009-09-11 13:19:16 +09:00
2016-06-04 00:22:46 +02:00
2008-08-02 04:39:32 +09:00
2015-01-13 15:24:08 +02:00
2008-07-29 08:09:44 +09:00
2008-07-29 08:09:44 +09:00
2008-07-29 08:09:44 +09:00
2010-04-26 19:08:55 +09:00
2008-07-29 08:09:44 +09:00
2008-07-29 08:09:44 +09:00
2008-07-29 08:09:44 +09:00
2008-08-04 12:51:06 +09:00
2012-05-14 13:04:08 +09:00
2016-09-27 21:15:14 -04:00
2011-03-31 11:26:23 -03:00
2008-07-29 08:09:44 +09:00
2008-07-29 08:09:44 +09:00