From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx175.postini.com [74.125.245.175]) by kanga.kvack.org (Postfix) with SMTP id 6CDDA6B0037 for ; Mon, 12 Aug 2013 12:43:24 -0400 (EDT) Received: by mail-la0-f45.google.com with SMTP id fj20so4954490lab.18 for ; Mon, 12 Aug 2013 09:43:22 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20130812135509.DDF5FE0090@blue.fi.intel.com> References: <93894D4C-57FA-46B5-9141-4EFADEB7009E@gmail.com> <20130812135509.DDF5FE0090@blue.fi.intel.com> From: Ning Qu Date: Mon, 12 Aug 2013 09:42:42 -0700 Message-ID: Subject: Re: [PATCH] thp: Fix deadlock situation in vma_adjust with huge page in page cache Content-Type: multipart/alternative; boundary=001a11336b3e8c0a9f04e3c2d2de Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" Cc: 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 --001a11336b3e8c0a9f04e3c2d2de Content-Type: text/plain; charset=UTF-8 That's great! Best wishes, -- Ning Qu On Mon, Aug 12, 2013 at 6:55 AM, Kirill A. Shutemov < kirill.shutemov@linux.intel.com> wrote: > 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 > --001a11336b3e8c0a9f04e3c2d2de Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
That's great!

Best wishes,
--=C2=A0
Ning Qu


On Mon, Aug 12, 2013 at 6:55 AM, Kirill = A. Shutemov <kirill.shutemov@linux.intel.com> = wrote:
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<= br> > 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 <quning= @google.com>

Thanks, applied.

--
=C2=A0Kirill A. Shutemov

--001a11336b3e8c0a9f04e3c2d2de-- -- 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