From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by kanga.kvack.org (Postfix) with ESMTP id 043B0828DF for ; Fri, 15 Apr 2016 20:24:27 -0400 (EDT) Received: by mail-pa0-f69.google.com with SMTP id dx6so109284561pad.0 for ; Fri, 15 Apr 2016 17:24:26 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com. [192.55.52.115]) by mx.google.com with ESMTP id x64si5196980pfi.208.2016.04.15.17.24.17 for ; Fri, 15 Apr 2016 17:24:17 -0700 (PDT) From: "Kirill A. Shutemov" Subject: [PATCHv7 13/29] thp: run vma_adjust_trans_huge() outside i_mmap_rwsem Date: Sat, 16 Apr 2016 03:23:44 +0300 Message-Id: <1460766240-84565-14-git-send-email-kirill.shutemov@linux.intel.com> In-Reply-To: <1460766240-84565-1-git-send-email-kirill.shutemov@linux.intel.com> References: <1460766240-84565-1-git-send-email-kirill.shutemov@linux.intel.com> Sender: owner-linux-mm@kvack.org List-ID: To: Hugh Dickins , Andrea Arcangeli , Andrew Morton Cc: Dave Hansen , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Jerome Marchand , Yang Shi , Sasha Levin , Andres Lagar-Cavilla , Ning Qu , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, "Kirill A. Shutemov" 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 --- mm/mmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index bd2e1a533bc1..df3976af9302 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -678,6 +678,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; @@ -698,8 +700,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.8.0.rc3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org