Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754639AbcC1SmW (ORCPT ); Mon, 28 Mar 2016 14:42:22 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:36804 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751984AbcC1SmQ (ORCPT ); Mon, 28 Mar 2016 14:42:16 -0400 Date: Mon, 28 Mar 2016 11:42:05 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: "Kirill A. Shutemov" cc: Hugh Dickins , "Kirill A. Shutemov" , Andrea Arcangeli , Andrew Morton , Dave Hansen , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Jerome Marchand , Yang Shi , Sasha Levin , Ning Qu , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCHv4 00/25] THP-enabled tmpfs/shmem In-Reply-To: <20160328180029.GB25200@node.shutemov.name> Message-ID: References: <1457737157-38573-1-git-send-email-kirill.shutemov@linux.intel.com> <20160324091727.GA26796@node.shutemov.name> <20160325150417.GA1851@node.shutemov.name> <20160328180029.GB25200@node.shutemov.name> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1015 Lines: 42 On Mon, 28 Mar 2016, Kirill A. Shutemov wrote: > > I think I found it. I have refcounting screwed up in faultaround. > > This should fix the problem: Yes, this fixes it for me - thanks. Hugh > > diff --git a/mm/filemap.c b/mm/filemap.c > index 94c097ec08e7..1325bb4568d1 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -2292,19 +2292,18 @@ repeat: > if (fe->pte) > fe->pte += iter.index - last_pgoff; > last_pgoff = iter.index; > - alloc_set_pte(fe, NULL, page); > + if (alloc_set_pte(fe, NULL, page)) > + goto unlock; > unlock_page(page); > - /* Huge page is mapped? No need to proceed. */ > - if (pmd_trans_huge(*fe->pmd)) > - break; > - /* Failed to setup page table? */ > - VM_BUG_ON(!fe->pte); > goto next; > unlock: > unlock_page(page); > skip: > page_cache_release(page); > next: > + /* Huge page is mapped? No need to proceed. */ > + if (pmd_trans_huge(*fe->pmd)) > + break; > if (iter.index == end_pgoff) > break; > } > -- > Kirill A. Shutemov