Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp794150pxa; Wed, 19 Aug 2020 15:22:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznnn9luKTuu9W3RlFwKyyLLzPrSZryk4v/uO6YdjGFKtpvPEmxf9fjCz1U2VI/X3u2kvrj X-Received: by 2002:a17:906:3c10:: with SMTP id h16mr441647ejg.233.1597875771140; Wed, 19 Aug 2020 15:22:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597875771; cv=none; d=google.com; s=arc-20160816; b=t1eLdzqcepVV5GL7b8YkBPSE09dJN0kmAXnn0w520qo/GRQnGVogfHPDnw07SjCF3b tUjlVyjEyhkywC8fNsQtM3LvfpKjclMwftzj++NB1FEK2r6AzdhCa7ZuL+LVcDQw3eaj V2Bcd92oJhBDQB3PybfOKcH79LNYTICoOrhrQfaNb002DBxkAziDspGuzSuYfEZ6u/7T PSF1kfMjXEnGKxYQbsXzTcHQL8sYUybb6pdnTUTc5+mz8SAOYvsDqufpEKZh/p1R+QUY GrJAMgQKVt/XS+AnsUHdFJ/hYJ6RDPPq4SFqwEAojd4Qs0zeqq4jexCQzIQ2KBdb2BK6 Z7sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RVpkWZgoV/McsG5/jmbAEgGEb94GIerA/7gyN/jgusE=; b=yxS9UprSXqgsKfsebMeOFKMqmTOA89iuz4/B1NVkbf+Qvtkzl+z0uU24fcu/9S5B6i YeZpr9viZ/nLdRnIvvPnWuNTUJQ2OWY4oTB9l+eThGGFLMtAfAZdsucDc2lpfHftwhaB uEy/oPzFPVKBEsGN0FKjozuTE9m74J4XRwPT2A8C6B+VnU3328Q805ihzHQnsqaS7oUN GuR7MPfuSRUZ66uxF9CP70Sj0rEtqsT21GgWi88gwIdWwhkBZlda/v+9wbL6JWgbTvWe HGUEg8yZbIa6U9TZ20THDIztzHpN7fcuNdh2rnPdxP69smRyMSPI/E8pJ3HXmCSRFlkn zD/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R5f9Bcpy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si215374edl.122.2020.08.19.15.22.27; Wed, 19 Aug 2020 15:22:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R5f9Bcpy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727959AbgHSWV0 (ORCPT + 99 others); Wed, 19 Aug 2020 18:21:26 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:57382 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727936AbgHSWVV (ORCPT ); Wed, 19 Aug 2020 18:21:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597875679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=RVpkWZgoV/McsG5/jmbAEgGEb94GIerA/7gyN/jgusE=; b=R5f9BcpyYzh0wLqULRDxukQxyr2hI7m0KR7SAy8pdiA90IHRQ47aAX86bYLg4VAZm8iSc/ 5MQoicXblMrcEmguUQFyJQKPh5xbbLh82LAWBmsHoLVXWoEW4d6jkuKlnjrJxs3H6xfL2g wpqVUtx+hWaiqQHhnSFkeJL27+x76g0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-208-Vhl7GqQLPZ6PGB3isPPanQ-1; Wed, 19 Aug 2020 18:21:02 -0400 X-MC-Unique: Vhl7GqQLPZ6PGB3isPPanQ-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id F3A88807332; Wed, 19 Aug 2020 22:21:00 +0000 (UTC) Received: from horse.redhat.com (ovpn-115-197.rdu2.redhat.com [10.10.115.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C85E5C893; Wed, 19 Aug 2020 22:20:54 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id BC4D3223C69; Wed, 19 Aug 2020 18:20:53 -0400 (EDT) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, virtio-fs@redhat.com Cc: vgoyal@redhat.com, miklos@szeredi.hu, stefanha@redhat.com, dgilbert@redhat.com, dan.j.williams@intel.com, Jan Kara , Dave Chinner , Christoph Hellwig , Ira Weiny , "Michael S. Tsirkin" , Vishal L Verma Subject: [PATCH v3 00/18] virtiofs: Add DAX support Date: Wed, 19 Aug 2020 18:19:38 -0400 Message-Id: <20200819221956.845195-1-vgoyal@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All, This is V3 of patches. I had posted version v2 version here. https://lore.kernel.org/linux-fsdevel/20200807195526.426056-1-vgoyal@redhat.com/ I have taken care of comments from V2. Changes from V2 are. - Rebased patches on top of 5.9-rc1 - Renamed couple of functions to get rid of iomap prefix. (Dave Chinner) - Modified truncate/punch_hole paths to serialize with dax fault path. For now did this only for dax paths. May be non-dax path can benefit from this too. But that is an option for a different day. (Dave Chinner). - Took care of comments by Jan Kara in dax_layout_busy_page_range() implementation patch. - Dropped one of the patches which forced sync release in fuse_file_put() path for DAX files. It was redundant now as virtiofs already sets fs_context->destroy which forces sync release. (Miklos) - Took care of some of the errors flagged by checkpatch.pl. Description from previous post ------------------------------ This patch series adds DAX support to virtiofs filesystem. This allows bypassing guest page cache and allows mapping host page cache directly in guest address space. When a page of file is needed, guest sends a request to map that page (in host page cache) in qemu address space. Inside guest this is a physical memory range controlled by virtiofs device. And guest directly maps this physical address range using DAX and hence gets access to file data on host. This can speed up things considerably in many situations. Also this can result in substantial memory savings as file data does not have to be copied in guest and it is directly accessed from host page cache. Most of the changes are limited to fuse/virtiofs. There are couple of changes needed in generic dax infrastructure and couple of changes in virtio to be able to access shared memory region. Thanks Vivek Sebastien Boeuf (3): virtio: Add get_shm_region method virtio: Implement get_shm_region for PCI transport virtio: Implement get_shm_region for MMIO transport Stefan Hajnoczi (2): virtio_fs, dax: Set up virtio_fs dax_device fuse,dax: add DAX mmap support Vivek Goyal (13): dax: Modify bdev_dax_pgoff() to handle NULL bdev dax: Create a range version of dax_layout_busy_page() virtiofs: Provide a helper function for virtqueue initialization fuse: Get rid of no_mount_options fuse,virtiofs: Add a mount option to enable dax fuse,virtiofs: Keep a list of free dax memory ranges fuse: implement FUSE_INIT map_alignment field fuse: Introduce setupmapping/removemapping commands fuse, dax: Implement dax read/write operations fuse,virtiofs: Define dax address space operations fuse, dax: Serialize truncate/punch_hole and dax fault path fuse,virtiofs: Maintain a list of busy elements fuse,virtiofs: Add logic to free up a memory range drivers/dax/super.c | 3 +- drivers/virtio/virtio_mmio.c | 31 + drivers/virtio/virtio_pci_modern.c | 95 +++ fs/dax.c | 29 +- fs/fuse/dir.c | 32 +- fs/fuse/file.c | 1198 +++++++++++++++++++++++++++- fs/fuse/fuse_i.h | 114 ++- fs/fuse/inode.c | 146 +++- fs/fuse/virtio_fs.c | 279 ++++++- include/linux/dax.h | 6 + include/linux/virtio_config.h | 17 + include/uapi/linux/fuse.h | 34 +- include/uapi/linux/virtio_fs.h | 3 + include/uapi/linux/virtio_mmio.h | 11 + include/uapi/linux/virtio_pci.h | 11 +- 15 files changed, 1933 insertions(+), 76 deletions(-) Cc: Jan Kara Cc: Dave Chinner Cc: Christoph Hellwig Cc: Ira Weiny Cc: "Michael S. Tsirkin" Cc: Vishal L Verma -- 2.25.4