From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 92BF22110782F for ; Thu, 30 Aug 2018 13:28:20 -0700 (PDT) From: "Verma, Vishal L" Subject: Re: [PATCH] mm: fix BUG_ON() in vmf_insert_pfn_pud() from VM_MIXEDMAP removal Date: Thu, 30 Aug 2018 20:28:02 +0000 Message-ID: <1535660881.5995.74.camel@intel.com> References: <153565957352.35524.1005746906902065126.stgit@djiang5-desk3.ch.intel.com> In-Reply-To: <153565957352.35524.1005746906902065126.stgit@djiang5-desk3.ch.intel.com> Content-Language: en-US Content-ID: <3623506BAFE2C247AD5BDA047AAF347C@intel.com> MIME-Version: 1.0 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: "Jiang, Dave" , "akpm@linux-foundation.org" Cc: "linux-mm@kvack.org" , "jack@suse.com" , "linux-nvdimm@lists.01.org" List-ID: On Thu, 2018-08-30 at 13:06 -0700, Dave Jiang wrote: > It looks like I missed the PUD path when doing VM_MIXEDMAP removal. > This can be triggered by: > 1. Boot with memmap=4G!8G > 2. build ndctl with destructive flag on > 3. make TESTS=device-dax check > > [ +0.000675] kernel BUG at mm/huge_memory.c:824! > > Applying the same change that was applied to vmf_insert_pfn_pmd() in > the > original patch. > > Fixes: e1fb4a08649 ("dax: remove VM_MIXEDMAP for fsdax and device > dax") > > Reported-by: Vishal Verma > Signed-off-by: Dave Jiang > --- > mm/huge_memory.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) This fixes the unit test failure, feel free to add: Tested-by: Vishal Verma > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index c3bc7e9c9a2a..533f9b00147d 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -821,11 +821,11 @@ vm_fault_t vmf_insert_pfn_pud(struct > vm_area_struct *vma, unsigned long addr, > * but we need to be consistent with PTEs and architectures > that > * can't support a 'special' bit. > */ > - BUG_ON(!(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP))); > + BUG_ON(!(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) && > + !pfn_t_devmap(pfn)); > BUG_ON((vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) == > (VM_PFNMAP|VM_MIXEDM > AP)); > BUG_ON((vma->vm_flags & VM_PFNMAP) && is_cow_mapping(vma- > >vm_flags)); > - BUG_ON(!pfn_t_devmap(pfn)); > > if (addr < vma->vm_start || addr >= vma->vm_end) > return VM_FAULT_SIGBUS; > _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm