From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kirill A. Shutemov" Subject: RE: [PATCH] thp: Fix deadlock situation in vma_adjust with huge page in page cache Date: Mon, 12 Aug 2013 16:55:09 +0300 (EEST) Message-ID: <20130812135509.DDF5FE0090@blue.fi.intel.com> References: <93894D4C-57FA-46B5-9141-4EFADEB7009E@gmail.com> Content-Transfer-Encoding: 7bit Cc: "Kirill A. Shutemov" , Matthew Wilcox , "Kirill A. Shutemov" , linux-fsdevel@vger.kernel.org, Hugh Dickins , Mel Gorman , Al Viro , Andrew Morton , Andrea Arcangeli , linux-kernel@vger.kernel.org, Andi Kleen , Wu Fengguang , Jan Kara , Dave Hansen , linux-mm@kvack.org, Hillf Danton , Ning Qu To: Ning Qu Return-path: In-Reply-To: <93894D4C-57FA-46B5-9141-4EFADEB7009E@gmail.com> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org Ning Qu wrote: > In vma_adjust, the current code grabs i_mmap_mutex before calling > vma_adjust_trans_huge. This used to be fine until huge page in page > cache comes in. The problem is the underlying function > split_file_huge_page will also grab the i_mmap_mutex before splitting > the huge page in page cache. Obviously this is causing deadlock > situation. > > This fix is to move the vma_adjust_trans_huge before grab the lock for > file, the same as what the function is currently doing for anonymous > memory. > > Tested, everything works fine so far. > > Signed-off-by: Ning Qu Thanks, applied. -- Kirill A. Shutemov -- 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