Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1356276

[PATCHv4 14/25] thp: run vma_adjust_trans_huge() outside i_mmap_rwsem

From "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCHv4 14/25] thp: run vma_adjust_trans_huge() outside i_mmap_rwsem
Date 2016-03-12 00:10 +0100
Message-ID <rbElZ-54U-49@gated-at.bofh.it> (permalink)
References <rbEch-4LU-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


vma_addjust_trans_huge() splits pmd if it's crossing VMA boundary.
During split we munlock the huge page which requires rmap walk.
rmap wants to take the lock on its own.

Let's move vma_adjust_trans_huge() outside i_mmap_rwsem to fix this.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
 mm/mmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 86c069e7d86a..94979671b42c 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -677,6 +677,8 @@ again:			remove_next = 1 + (end > next->vm_end);
 		}
 	}
 
+	vma_adjust_trans_huge(vma, start, end, adjust_next);
+
 	if (file) {
 		mapping = file->f_mapping;
 		root = &mapping->i_mmap;
@@ -697,8 +699,6 @@ again:			remove_next = 1 + (end > next->vm_end);
 		}
 	}
 
-	vma_adjust_trans_huge(vma, start, end, adjust_next);
-
 	anon_vma = vma->anon_vma;
 	if (!anon_vma && adjust_next)
 		anon_vma = next->anon_vma;
-- 
2.7.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv4 00/25] THP-enabled tmpfs/shmem "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 13/25] thp: prepare change_huge_pmd() for file thp "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 10/25] thp: handle file COW faults "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 08/25] thp: support file pages in zap_huge_pmd() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 12/25] thp: skip file huge pmd on copy_huge_pmd() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 20/25] filemap: prepare find and delete operations for huge pages "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 18/25] page-flags: relax policy for PG_mappedtodisk and PG_reclaim "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 04/25] rmap: support file thp "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 24/25] shmem: add huge pages support "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 05/25] mm: introduce do_set_pmd() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 19/25] radix-tree: implement radix_tree_maybe_preload_order() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 23/25] shmem: get_unmapped_area align huge page "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 22/25] shmem: prepare huge= mount option and sysfs knob "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 21/25] truncate: handle file thp "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 06/25] mm, rmap: account file thp pages "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
    [PATCHv5 06/25] mm, rmap: account file thp pages "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-15 16:40 +0100
  [PATCHv4 14/25] thp: run vma_adjust_trans_huge() outside i_mmap_rwsem "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 07/25] thp, vmstats: add counters for huge file pages "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv4 09/25] thp: handle file pages in split_huge_pmd() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-12 00:10 +0100
  [PATCHv5 26/25] thp: update Documentation/vm/transhuge.txt "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-03-15 17:00 +0100

csiph-web