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