From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kirill A. Shutemov" Subject: Re: [PATCHv2, RFC 18/30] thp, mm: truncate support for transparent huge page cache Date: Thu, 28 Mar 2013 17:31:52 +0200 (EET) Message-ID: <20130328153152.54DDAE0085@blue.fi.intel.com> References: <1363283435-7666-1-git-send-email-kirill.shutemov@linux.intel.com> <1363283435-7666-19-git-send-email-kirill.shutemov@linux.intel.com> <514CA325.3010104@sr71.net> Content-Transfer-Encoding: 7bit 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 To: Dave Return-path: Received: from mga11.intel.com ([192.55.52.93]:17228 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753761Ab3C1PaF (ORCPT ); Thu, 28 Mar 2013 11:30:05 -0400 In-Reply-To: <514CA325.3010104@sr71.net> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Dave wrote: > On 03/14/2013 10:50 AM, Kirill A. Shutemov wrote: > > @@ -280,6 +291,7 @@ void truncate_inode_pages_range(struct address_space *mapping, > > if (index > end) > > break; > > > > + VM_BUG_ON(PageTransHuge(page)); > > lock_page(page); > > WARN_ON(page->index != index); > > wait_on_page_writeback(page); > > This looks to be during the second truncate pass where things are > allowed to block. What's the logic behind it not being possible to > encounter TransHugePage()s here? Good question. The only way how the page can be created from under us is collapsing, but it's not implemented for file pages and I'm not sure yet how to implement it... Probably, I'll replace the BUG with if (PageTransHuge(page)) split_huge_page(page); It should be good enough. -- Kirill A. Shutemov