From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756752Ab3HLNvz (ORCPT ); Mon, 12 Aug 2013 09:51:55 -0400 Received: from mga14.intel.com ([143.182.124.37]:21071 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756629Ab3HLNvv (ORCPT ); Mon, 12 Aug 2013 09:51:51 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,862,1367996400"; d="scan'208";a="345124250" From: "Kirill A. Shutemov" To: Ning Qu 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 In-Reply-To: <93894D4C-57FA-46B5-9141-4EFADEB7009E@gmail.com> References: <93894D4C-57FA-46B5-9141-4EFADEB7009E@gmail.com> Subject: RE: [PATCH] thp: Fix deadlock situation in vma_adjust with huge page in page cache Content-Transfer-Encoding: 7bit Message-Id: <20130812135509.DDF5FE0090@blue.fi.intel.com> Date: Mon, 12 Aug 2013 16:55:09 +0300 (EEST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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