From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: Re: DAX can not work on virtual nvdimm device Date: Sun, 21 Aug 2016 12:55:30 +0300 Message-ID: <57B97A92.6010302@plexistor.com> References: <436d7526-bf06-633d-afce-4333552d9e31@linux.intel.com> <20160819183047.GA7216@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20160819183047.GA7216-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" To: Ross Zwisler , Dan Williams Cc: Yumei Huang , Xiao Guangrong , KVM , "linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org" , "qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org" , LKML , Linux ACPI , Stefan Hajnoczi List-Id: linux-acpi@vger.kernel.org On 08/19/2016 09:30 PM, Ross Zwisler wrote: > On Fri, Aug 19, 2016 at 07:59:29AM -0700, Dan Williams wrote: >> On Fri, Aug 19, 2016 at 4:19 AM, Xiao Guangrong >> wrote: >>> >>> Hi Dan, >>> >>> Recently, Redhat reported that nvml test suite failed on QEMU/KVM, >>> more detailed info please refer to: >>> https://bugzilla.redhat.com/show_bug.cgi?id=1365721 >>> >>> The reason for this bug is that the memory region created by mmap() >>> on the dax-based file was gone so that the region can not be found >>> in /proc/self/smaps during the runtime. >>> >>> This is a simple way to trigger this issue: >>> mount -o dax /dev/pmem0 /mnt/pmem/ >>> vim /mnt/pmem/xxx >>> then 'vim' is crashed due to segment fault. >>> >>> This bug can be reproduced on your tree, the top commit is >>> 10d7902fa0e82b (dax: unmap/truncate on device shutdown), the kernel >>> configure file is attached. >>> >>> Your thought or comment is highly appreciated. >> >> I'm going to be offline until Tuesday, but I will investigate when I'm >> back. In the meantime if Ross or Vishal had an opportunity to take a >> look I wouldn't say "no" :). > > I haven't been able to reproduce this vim segfault. I'm using QEMU v2.6.0, > and the kernel commit you mentioned, and your kernel config. > > Here's my QEMU command line: > > sudo ~/qemu/bin/qemu-system-x86_64 /var/lib/libvirt/images/alara.qcow2 \ > -machine pc,nvdimm -m 8G,maxmem=100G,slots=100 -object \ > memory-backend-file,id=mem1,share,mem-path=/dev/pmem0,size=8G -device \ > nvdimm,memdev=mem1,id=nv1 -smp 6 -machine pc,accel=kvm > > With this I'm able to mkfs the guest's /dev/pmem0, mount it with -o dax, and > write a file with vim. > > Can you reproduce your results with a pmem device created via a memmap kernel > command line parameter in the guest? You'll need to update your kernel > config to enable CONFIG_X86_PMEM_LEGACY and CONFIG_X86_PMEM_LEGACY_DEVICE. Last time I had crashes like this was when the memmap= or the KVM command line memory size and settings did not match the KVM defined memory settings. Nothing fails but the pmemX device is configured over a none existent memory. All writes just succeed but all reads return ZEROs. Please check that the sizes of your pmem matches the memory size of the VM as defined in virsh edit Boaz From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CB2A01A1DF8 for ; Sun, 21 Aug 2016 02:55:35 -0700 (PDT) Received: by mail-wm0-x22b.google.com with SMTP id q128so15802074wma.1 for ; Sun, 21 Aug 2016 02:55:35 -0700 (PDT) Message-ID: <57B97A92.6010302@plexistor.com> Date: Sun, 21 Aug 2016 12:55:30 +0300 From: Boaz Harrosh MIME-Version: 1.0 Subject: Re: DAX can not work on virtual nvdimm device References: <436d7526-bf06-633d-afce-4333552d9e31@linux.intel.com> <20160819183047.GA7216@linux.intel.com> In-Reply-To: <20160819183047.GA7216@linux.intel.com> 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: Ross Zwisler , Dan Williams Cc: Yumei Huang , Xiao Guangrong , KVM , "linux-nvdimm@lists.01.org" , "qemu-devel@nongnu.org" , LKML , Linux ACPI , Stefan Hajnoczi List-ID: On 08/19/2016 09:30 PM, Ross Zwisler wrote: > On Fri, Aug 19, 2016 at 07:59:29AM -0700, Dan Williams wrote: >> On Fri, Aug 19, 2016 at 4:19 AM, Xiao Guangrong >> wrote: >>> >>> Hi Dan, >>> >>> Recently, Redhat reported that nvml test suite failed on QEMU/KVM, >>> more detailed info please refer to: >>> https://bugzilla.redhat.com/show_bug.cgi?id=1365721 >>> >>> The reason for this bug is that the memory region created by mmap() >>> on the dax-based file was gone so that the region can not be found >>> in /proc/self/smaps during the runtime. >>> >>> This is a simple way to trigger this issue: >>> mount -o dax /dev/pmem0 /mnt/pmem/ >>> vim /mnt/pmem/xxx >>> then 'vim' is crashed due to segment fault. >>> >>> This bug can be reproduced on your tree, the top commit is >>> 10d7902fa0e82b (dax: unmap/truncate on device shutdown), the kernel >>> configure file is attached. >>> >>> Your thought or comment is highly appreciated. >> >> I'm going to be offline until Tuesday, but I will investigate when I'm >> back. In the meantime if Ross or Vishal had an opportunity to take a >> look I wouldn't say "no" :). > > I haven't been able to reproduce this vim segfault. I'm using QEMU v2.6.0, > and the kernel commit you mentioned, and your kernel config. > > Here's my QEMU command line: > > sudo ~/qemu/bin/qemu-system-x86_64 /var/lib/libvirt/images/alara.qcow2 \ > -machine pc,nvdimm -m 8G,maxmem=100G,slots=100 -object \ > memory-backend-file,id=mem1,share,mem-path=/dev/pmem0,size=8G -device \ > nvdimm,memdev=mem1,id=nv1 -smp 6 -machine pc,accel=kvm > > With this I'm able to mkfs the guest's /dev/pmem0, mount it with -o dax, and > write a file with vim. > > Can you reproduce your results with a pmem device created via a memmap kernel > command line parameter in the guest? You'll need to update your kernel > config to enable CONFIG_X86_PMEM_LEGACY and CONFIG_X86_PMEM_LEGACY_DEVICE. Last time I had crashes like this was when the memmap= or the KVM command line memory size and settings did not match the KVM defined memory settings. Nothing fails but the pmemX device is configured over a none existent memory. All writes just succeed but all reads return ZEROs. Please check that the sizes of your pmem matches the memory size of the VM as defined in virsh edit Boaz _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752931AbcHUJ4n (ORCPT ); Sun, 21 Aug 2016 05:56:43 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38788 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752376AbcHUJ4k (ORCPT ); Sun, 21 Aug 2016 05:56:40 -0400 Message-ID: <57B97A92.6010302@plexistor.com> Date: Sun, 21 Aug 2016 12:55:30 +0300 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ross Zwisler , Dan Williams CC: Yumei Huang , Xiao Guangrong , KVM , "linux-nvdimm@lists.01.org" , LKML , "qemu-devel@nongnu.org" , Linux ACPI , Stefan Hajnoczi Subject: Re: DAX can not work on virtual nvdimm device References: <436d7526-bf06-633d-afce-4333552d9e31@linux.intel.com> <20160819183047.GA7216@linux.intel.com> In-Reply-To: <20160819183047.GA7216@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/19/2016 09:30 PM, Ross Zwisler wrote: > On Fri, Aug 19, 2016 at 07:59:29AM -0700, Dan Williams wrote: >> On Fri, Aug 19, 2016 at 4:19 AM, Xiao Guangrong >> wrote: >>> >>> Hi Dan, >>> >>> Recently, Redhat reported that nvml test suite failed on QEMU/KVM, >>> more detailed info please refer to: >>> https://bugzilla.redhat.com/show_bug.cgi?id=1365721 >>> >>> The reason for this bug is that the memory region created by mmap() >>> on the dax-based file was gone so that the region can not be found >>> in /proc/self/smaps during the runtime. >>> >>> This is a simple way to trigger this issue: >>> mount -o dax /dev/pmem0 /mnt/pmem/ >>> vim /mnt/pmem/xxx >>> then 'vim' is crashed due to segment fault. >>> >>> This bug can be reproduced on your tree, the top commit is >>> 10d7902fa0e82b (dax: unmap/truncate on device shutdown), the kernel >>> configure file is attached. >>> >>> Your thought or comment is highly appreciated. >> >> I'm going to be offline until Tuesday, but I will investigate when I'm >> back. In the meantime if Ross or Vishal had an opportunity to take a >> look I wouldn't say "no" :). > > I haven't been able to reproduce this vim segfault. I'm using QEMU v2.6.0, > and the kernel commit you mentioned, and your kernel config. > > Here's my QEMU command line: > > sudo ~/qemu/bin/qemu-system-x86_64 /var/lib/libvirt/images/alara.qcow2 \ > -machine pc,nvdimm -m 8G,maxmem=100G,slots=100 -object \ > memory-backend-file,id=mem1,share,mem-path=/dev/pmem0,size=8G -device \ > nvdimm,memdev=mem1,id=nv1 -smp 6 -machine pc,accel=kvm > > With this I'm able to mkfs the guest's /dev/pmem0, mount it with -o dax, and > write a file with vim. > > Can you reproduce your results with a pmem device created via a memmap kernel > command line parameter in the guest? You'll need to update your kernel > config to enable CONFIG_X86_PMEM_LEGACY and CONFIG_X86_PMEM_LEGACY_DEVICE. Last time I had crashes like this was when the memmap= or the KVM command line memory size and settings did not match the KVM defined memory settings. Nothing fails but the pmemX device is configured over a none existent memory. All writes just succeed but all reads return ZEROs. Please check that the sizes of your pmem matches the memory size of the VM as defined in virsh edit Boaz From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbPTf-0002n8-Et for qemu-devel@nongnu.org; Sun, 21 Aug 2016 05:55:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bbPTc-0005Cy-BB for qemu-devel@nongnu.org; Sun, 21 Aug 2016 05:55:39 -0400 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:33568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbPTc-0005Ck-1D for qemu-devel@nongnu.org; Sun, 21 Aug 2016 05:55:36 -0400 Received: by mail-wm0-x230.google.com with SMTP id d196so15820461wmd.0 for ; Sun, 21 Aug 2016 02:55:34 -0700 (PDT) Message-ID: <57B97A92.6010302@plexistor.com> Date: Sun, 21 Aug 2016 12:55:30 +0300 From: Boaz Harrosh MIME-Version: 1.0 References: <436d7526-bf06-633d-afce-4333552d9e31@linux.intel.com> <20160819183047.GA7216@linux.intel.com> In-Reply-To: <20160819183047.GA7216@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] DAX can not work on virtual nvdimm device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ross Zwisler , Dan Williams Cc: Yumei Huang , Xiao Guangrong , KVM , "linux-nvdimm@lists.01.org" , LKML , "qemu-devel@nongnu.org" , Linux ACPI , Stefan Hajnoczi On 08/19/2016 09:30 PM, Ross Zwisler wrote: > On Fri, Aug 19, 2016 at 07:59:29AM -0700, Dan Williams wrote: >> On Fri, Aug 19, 2016 at 4:19 AM, Xiao Guangrong >> wrote: >>> >>> Hi Dan, >>> >>> Recently, Redhat reported that nvml test suite failed on QEMU/KVM, >>> more detailed info please refer to: >>> https://bugzilla.redhat.com/show_bug.cgi?id=1365721 >>> >>> The reason for this bug is that the memory region created by mmap() >>> on the dax-based file was gone so that the region can not be found >>> in /proc/self/smaps during the runtime. >>> >>> This is a simple way to trigger this issue: >>> mount -o dax /dev/pmem0 /mnt/pmem/ >>> vim /mnt/pmem/xxx >>> then 'vim' is crashed due to segment fault. >>> >>> This bug can be reproduced on your tree, the top commit is >>> 10d7902fa0e82b (dax: unmap/truncate on device shutdown), the kernel >>> configure file is attached. >>> >>> Your thought or comment is highly appreciated. >> >> I'm going to be offline until Tuesday, but I will investigate when I'm >> back. In the meantime if Ross or Vishal had an opportunity to take a >> look I wouldn't say "no" :). > > I haven't been able to reproduce this vim segfault. I'm using QEMU v2.6.0, > and the kernel commit you mentioned, and your kernel config. > > Here's my QEMU command line: > > sudo ~/qemu/bin/qemu-system-x86_64 /var/lib/libvirt/images/alara.qcow2 \ > -machine pc,nvdimm -m 8G,maxmem=100G,slots=100 -object \ > memory-backend-file,id=mem1,share,mem-path=/dev/pmem0,size=8G -device \ > nvdimm,memdev=mem1,id=nv1 -smp 6 -machine pc,accel=kvm > > With this I'm able to mkfs the guest's /dev/pmem0, mount it with -o dax, and > write a file with vim. > > Can you reproduce your results with a pmem device created via a memmap kernel > command line parameter in the guest? You'll need to update your kernel > config to enable CONFIG_X86_PMEM_LEGACY and CONFIG_X86_PMEM_LEGACY_DEVICE. Last time I had crashes like this was when the memmap= or the KVM command line memory size and settings did not match the KVM defined memory settings. Nothing fails but the pmemX device is configured over a none existent memory. All writes just succeed but all reads return ZEROs. Please check that the sizes of your pmem matches the memory size of the VM as defined in virsh edit Boaz