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