Received: by 10.213.65.68 with SMTP id h4csp1783294imn; Thu, 5 Apr 2018 03:50:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/OY0duH/tv8lNmJI02sVNIYh01k2vGyIVKYQ1rQWboZjE/WeuS/c1C5VTFUHK+lcusZBor X-Received: by 10.98.206.77 with SMTP id y74mr16834100pfg.205.1522925442534; Thu, 05 Apr 2018 03:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522925442; cv=none; d=google.com; s=arc-20160816; b=aSuwK541XwQRvKZ+q+SGRhDbRCYonfIyl6PE009ZpIx9sl+qrtQ4Mo42zqNu4vdMoT 6/Xawg6hZXtDsxSc/Fol+YVnAhgqVl06zVUC8O4oVnoJ1cQ95xWcpjTp6JE8yOlQkR/r jKwTn1qcvgTwuV9SuQbTpv7EhdUYgzwlWAlS/LTiVuwZWkY57eL9Sjqqhs8S6WhsQbbi WuaL6yf9aarsvfjoz9zyMA2YNFCNr64tN81oj2Xb4JO+eAypmr7SeRcvysgi9fqw6lSc S1VvKdxl4L+4XliqevVbsNTOTfORPkKuKD4QerObW525FjbuMlw6663ARCkeP4xNzyLJ d9gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=M1JHfbrLJjJlJw/Q1EH0/Iro/V8LP20wfrAwZMIKn5Q=; b=pwIRkVe0wP5pw35nWh8rgTx9wdkNA0zwKmn7v+DyCN/l3NiVdsRvVNn7rfg062nAXr JMpfWOpXXNeWtXUgtlk1ZCTaIXUiQe93KuBTWtdKRs8KPV6dOaKu+gerEC0oRsqGIDRo aEj3eBYvtHhQxek8jHmNAUa08VK5tYjJGEOHeDqubVdNqVXt2uW/7s15q3aszm6rME9a dLxYR8OLlukBWBsOOekzx1bJXuaJfck/LNe8G6A555KbGqI0e6zzF46V/WKGTOJ54bMG okM8FnYMOOcooxVvPHWqOrb33OOG7+J5ho6DLBmKcZWc3iUG6fN2j+qkGYJbBD7Gh9y6 gGWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2si3945780pff.214.2018.04.05.03.50.28; Thu, 05 Apr 2018 03:50:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751376AbeDEKtD (ORCPT + 99 others); Thu, 5 Apr 2018 06:49:03 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48278 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751038AbeDEKtB (ORCPT ); Thu, 5 Apr 2018 06:49:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5E39404084A; Thu, 5 Apr 2018 10:49:00 +0000 (UTC) Received: from dhcp201-121.englab.pnq.redhat.com (dhcp193-127.pnq.redhat.com [10.65.193.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DCEF63537; Thu, 5 Apr 2018 10:48:37 +0000 (UTC) From: Pankaj Gupta To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, qemu-devel@nongnu.org, linux-nvdimm@ml01.01.org Cc: jack@suse.cz, stefanha@redhat.com, dan.j.williams@intel.com, riel@surriel.com, haozhong.zhang@intel.com, nilal@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, ross.zwisler@intel.com, david@redhat.com, xiaoguangrong.eric@gmail.com, hch@infradead.org, marcel@redhat.com, mst@redhat.com, niteshnarayanlal@hotmail.com, imammedo@redhat.com, pagupta@redhat.com Subject: [RFC 0/2] kvm "fake DAX" device flushing Date: Thu, 5 Apr 2018 16:18:31 +0530 Message-Id: <20180405104834.10457-1-pagupta@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 05 Apr 2018 10:49:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 05 Apr 2018 10:49:00 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pagupta@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We are sharing RFC version of 'fake DAX' flushing interface for feedback. This is still work in progress and not yet ready for merging. Prototype implements two major parts: - Qemu virtio-pmem device It exposes a persistent memory range to KVM guest which at host side is file backed memory and works as persistent memory device. In addition to this it provides a virtio flushing interface for KVM guest to do a Qemu side sync for guest DAX persistent memory range. - Guest virtio-pmem driver Reads persistent memory range from paravirt device and registers with 'nvdimm_bus'. 'nvdimm/pmem' driver uses this information to allocate persistent memory range. Also, we have implemented guest side of VIRTIO flushing interface. Changes from previous RFC: - Reuse existing 'pmem' code instead of creating an entirely new block driver. - Use VIRTIO driver to register memory information with nvdimm_bus and create region_type accordingly. - Use VIRTIO flushing interface from existing pmem driver code based on registered flushign mechanism. We have done the implementation based on suggestions here [1]. Previous RFC is shared here [2]. Details of project idea for 'fake DAX' flushing is shared here [3] & [4]. [1] https://marc.info/?l=linux-mm&m=150782346802290&w=2 [2] https://marc.info/?l=kvm&m=151630416506527&w=2 [3] https://www.spinics.net/lists/kvm/msg149761.html [4] https://www.spinics.net/lists/kvm/msg153095.html Work yet to be done: - Qemu RAM address handling independent of PC-DIMM so that memory operations(get_free_address) can be used for VIRTIO device type as well. (David Hildenbrand CCed has a prototype for this). - Qemu device flush functionality trigger with guest fsync on file. - Qemu live migration work when host page cache is used. - Multiple virtio-pmem disks support. - Prepare virtio spec after we get feedback on current approach. drivers/nvdimm/region_devs.c | 7 ++ drivers/virtio/Kconfig | 12 +++ drivers/virtio/Makefile | 1 drivers/virtio/virtio_pmem.c | 122 +++++++++++++++++++++++++++++++++++++++ include/linux/libnvdimm.h | 2 include/uapi/linux/virtio_ids.h | 1 include/uapi/linux/virtio_pmem.h | 61 +++++++++++++++++++ 7 files changed, 206 insertions(+)