From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx125.postini.com [74.125.245.125]) by kanga.kvack.org (Postfix) with SMTP id 41C0A6B0002 for ; Mon, 3 Jun 2013 12:09:52 -0400 (EDT) From: "Kirill A. Shutemov" In-Reply-To: <51ACBBEA.2040804@sr71.net> References: <1368321816-17719-1-git-send-email-kirill.shutemov@linux.intel.com> <1368321816-17719-24-git-send-email-kirill.shutemov@linux.intel.com> <519BEFAE.1080800@sr71.net> <20130603150214.54C34E0090@blue.fi.intel.com> <51ACBBEA.2040804@sr71.net> Subject: Re: [PATCHv4 23/39] thp: wait_split_huge_page(): serialize over i_mmap_mutex too Content-Transfer-Encoding: 7bit Message-Id: <20130603160920.737A1E0090@blue.fi.intel.com> Date: Mon, 3 Jun 2013 19:09:20 +0300 (EEST) Sender: owner-linux-mm@kvack.org List-ID: To: Dave Hansen Cc: "Kirill A. Shutemov" , Andrea Arcangeli , Andrew Morton , Al Viro , Hugh Dickins , Wu Fengguang , Jan Kara , Mel Gorman , linux-mm@kvack.org, Andi Kleen , Matthew Wilcox , "Kirill A. Shutemov" , Hillf Danton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Dave Hansen wrote: > > On 06/03/2013 08:02 AM, Kirill A. Shutemov wrote: > > Dave Hansen wrote: > >> On 05/11/2013 06:23 PM, Kirill A. Shutemov wrote: > >>> From: "Kirill A. Shutemov" >>> -#define wait_split_huge_page(__anon_vma, __pmd) \ > >>> +#define wait_split_huge_page(__vma, __pmd) \ > >>> do { \ > >>> pmd_t *____pmd = (__pmd); \ > >>> - anon_vma_lock_write(__anon_vma); \ > >>> - anon_vma_unlock_write(__anon_vma); \ > >>> + struct address_space *__mapping = \ > >>> + vma->vm_file->f_mapping; \ > >>> + struct anon_vma *__anon_vma = (__vma)->anon_vma; \ > >>> + if (__mapping) \ > >>> + mutex_lock(&__mapping->i_mmap_mutex); \ > >>> + if (__anon_vma) { \ > >>> + anon_vma_lock_write(__anon_vma); \ > >>> + anon_vma_unlock_write(__anon_vma); \ > >>> + } \ > >>> + if (__mapping) \ > >>> + mutex_unlock(&__mapping->i_mmap_mutex); \ > >>> BUG_ON(pmd_trans_splitting(*____pmd) || \ > >>> pmd_trans_huge(*____pmd)); \ > >>> } while (0) > ... > >> Could you also describe the lengths to which you've gone to try and keep > >> this macro from growing in to any larger of an abomination. Is it truly > >> _impossible_ to turn this in to a normal function? Or will it simply be > >> a larger amount of work that you can do right now? What would it take? > > > > Okay, I've tried once again. The patch is below. It looks too invasive for > > me. What do you think? > > That patch looks great to me, actually. It really looks to just be > superficially moving code around. The diffstat is even too: One of blocker I see is new dependency -> . It makes header files nightmare worse. -- 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