Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1352500imm; Wed, 17 Oct 2018 18:46:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV63mnGRT5Aw+UXk8zRgpOPX+vUgJDTFlGRRVE8UOtClY4Giu03S2IR1Dhkoov0ZUpNAf5Kj5 X-Received: by 2002:a62:8145:: with SMTP id t66-v6mr27903210pfd.192.1539827209158; Wed, 17 Oct 2018 18:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539827209; cv=none; d=google.com; s=arc-20160816; b=jEnVY+XmYYciJ/deGxnQkc/9I1g4IvjE6NHdEljXmfouF/nc5syWYGOWC26D+U0UhL 8fekR2DYlAMNYNdNGEb8WMxQqZg16aHKg+GkIRzb2XxxOcrSVUnm/lkNv4eDMEC8s8kr gqBCiIlK0SrclmCdrP18JNeftkZR1oAVrlH2JLOSboJBtjPvFXlJ5vncONdIJoCwAh2Y nuscoHi2y4178huRqskQjEs4zawqylbY6VKSxFTfiw1qQim86FIzzitjIRLVbvNEdFOa dMb4KccI69jDVa4Cl159KWuyFkDb67XkzmG2kYpsrZTuk1xtYPFCBgeHw8MJpPc2a9LR 7oyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=AjUI1uf+u0uUusGfPFuABm21JUrReFUSlHV6WMANED4=; b=HCKfEVRe5M2Ccp5BH+sZdTJ1RRmqKltTuIKZ6gXwUfaj8eIlscOeqjps3fE7C0Ao+6 S6m9wjDjeyMcCpwNXOAeUosWX/BhV64otoEk7Kq3Ihe0ST5IOF4Sm92qPtNvkZmDbjqj Dg39l8zHe4X0KVkIHrc4DjalWlHAMgpiPXhdJNpf9pehX7Ujj+bNlmQU9iy10P4bfqyi J1YIG8ia6ruEbirnyjX94qGb6zdunS+vffxWb4yy8Byqj6y/QrYXIV9foIxgFubA3OdF jdQ1L2s+YS3WnwmTBcVjkscG6krlIjyC7RWI2X3L0tP1DQqcyuSv0yMJcWQdTc2SFv94 x0ZQ== 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 v13-v6si19308710pgi.92.2018.10.17.18.46.33; Wed, 17 Oct 2018 18:46:49 -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 S1727331AbeJRJnU (ORCPT + 99 others); Thu, 18 Oct 2018 05:43:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34228 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727082AbeJRJnT (ORCPT ); Thu, 18 Oct 2018 05:43:19 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E195F34CB; Thu, 18 Oct 2018 01:44:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD5F97AB6D; Thu, 18 Oct 2018 01:44:49 +0000 (UTC) Received: from zmail21.collab.prod.int.phx2.redhat.com (zmail21.collab.prod.int.phx2.redhat.com [10.5.83.24]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 74C674BB74; Thu, 18 Oct 2018 01:44:49 +0000 (UTC) Date: Wed, 17 Oct 2018 21:44:49 -0400 (EDT) From: Pankaj Gupta To: Dan Williams Cc: Kevin Wolf , Nitesh Narayan Lal , Jan Kara , Xiao Guangrong , KVM list , Rik van Riel , linux-nvdimm , David Hildenbrand , Linux Kernel Mailing List , Qemu Developers , Christoph Hellwig , Igor Mammedov , Paolo Bonzini , "Michael S. Tsirkin" , Stefan Hajnoczi , Vishal L Verma , zwisler@kernel.org, Dave Jiang , lcapitulino@redhat.com Message-ID: <130749719.21742520.1539827089099.JavaMail.zimbra@redhat.com> In-Reply-To: References: <20181013050021.11962-1-pagupta@redhat.com> <20181013050021.11962-3-pagupta@redhat.com> <431127218.21694133.1539803509205.JavaMail.zimbra@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 2/2] virtio-pmem: Add virtio pmem driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.116.19, 10.4.195.12] Thread-Topic: virtio-pmem: Add virtio pmem driver Thread-Index: ZINno7w24VIktMciA68WO/yMY5QIDw== X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 18 Oct 2018 01:44:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > > > > On Fri, Oct 12, 2018 at 10:01 PM Pankaj Gupta wrote: > > > > > > > > This patch adds virtio-pmem driver for KVM guest. > > > > > > > > Guest reads the persistent memory range information from > > > > Qemu over VIRTIO and registers it on nvdimm_bus. It also > > > > creates a nd_region object with the persistent memory > > > > range information so that existing 'nvdimm/pmem' driver > > > > can reserve this into system memory map. This way > > > > 'virtio-pmem' driver uses existing functionality of pmem > > > > driver to register persistent memory compatible for DAX > > > > capable filesystems. > > > > > > > > This also provides function to perform guest flush over > > > > VIRTIO from 'pmem' driver when userspace performs flush > > > > on DAX memory range. > > > > > > Before we can move forward with this driver we need additional > > > filesystem enabling to detect when the backing device is fronting DAX > > > pmem or a paravirtualized page cache through virtio-pmem. Any > > > interface that requires fsync() and a round trip to the hypervisor to > > > flush host page cache is not DAX. > > > > I saw your proposal[1] for new mmap flag MAP_DIRECT. IIUIC mapping should > > fail for > > MAP_DIRECT if it requires explicit flush or buffer indirection. So, if we > > disable > > MAP_SYNC flag for virtio-pmem this should fail MAP_DIRECT as well? > > Otherwise > > without MAP_DIRECT, virtio-pmem should be defaulted to VIRTIO flush > > mechanism. > > Right, although I wouldn't worry about MAP_DIRECT in the short term > since we're still discussing what the upstream interface. Regardless > of whether MAP_DIRECT is specified or not the virtio-flush mechanism > would always be used for virtio-pmem. I.e. there is no possibility to > get full DAX operation with virtio-pmem, only the page-cache bypass > sub-set. Agree. I will also follow the thread. > > Taking a look at where we could inject this check for filesystems it's > a bit awkward to do it in xfs_file_mmap() for example because we do > not have the backing device for the extents of the inode. So at a > minimum you would need to investigate calling xfs_inode_supports_dax() > from that path and teaching it about a new dax_device flag. I'm > thinking the dax_device flag should be called DAXDEV_BUFFERED to > indicate the presence of software buffering on a device that otherwise > supports bypassing the local page cache. Sure. Will investigate XFS code as suggested. Thanks for the detail directions towards the solution. Will try to come up with a solution. Best regards, Pankaj