Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp896670imu; Wed, 9 Jan 2019 08:10:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN5CrpxmvtvAHsMgLp6gbMYa1CI8Amy4QI317vbqmx+onijqKsTgYGxtQKnlGzeInMofghpz X-Received: by 2002:a63:b4c:: with SMTP id a12mr5983856pgl.131.1547050252035; Wed, 09 Jan 2019 08:10:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547050252; cv=none; d=google.com; s=arc-20160816; b=kLnrw8KDTLolCpbRCeqRYsSJsL90jfK/Wr0tiatrZzZutE6gULuahmHLcJew+b/V/E KJ6IDnk5EKkNiOGz+7j9xKKUqmjpqB3bPl4Aj8WKNSlCVYJRhog1J375uIpENeVVBBf1 wJ5ChNJju200PbaMyY2dGl6tTI7sD6DjlPMESqIBAdocUDvuU7e13rCS0NQRRqABVZ70 hwIM0VeQwK6Z0NUoj/xDARcx26TeNBr64+eJWWEog97JZMKfaSa0Y8DWaN81z5jtLY1Z QmrQcPbfI8N7P2x5J3/uouoEsMPGLUwhxo1Sv1Z3s9IsEsB1w2rgmpmE5pKvqz8b+guj mkBA== 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=Zgdk5bEde0EjpHtkynh1BNNQ7Oh3uqejs+WMvtw6GXY=; b=nw8S5EXkumFL58/hvlpMJ/ktZgYFE0lrA46RktljKqalW5lsjiehd34ZS50CAttdBT Vz/3c5PFZQ4p9VXsbjFfLpaYNIN7J7PjQzBG4ISE+Km6U7wHePuQqSicJRfYxtsXJamG 73Zs492JVFEgLsUuKpSIi5El4x9lWzu9uAtRD0vvtMCx4LAp7lMWDZ3tPu/Ir3VUQ8Ek +/O5ZPb5bPw0bP/uNrN8fdmNG93ARTDqfyrykN3iMB9r54LkHBtvKiL7CU8iz1qfAWY4 VfJwCgOHFd2bewa2E9W8UZMFEpmod63onOl2WKruhYp9MAQQN42MJCTVHyW7JJinsBP6 LbJw== 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 14si68894330pgo.511.2019.01.09.08.10.35; Wed, 09 Jan 2019 08:10:51 -0800 (PST) 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 S1732118AbfAIOy3 (ORCPT + 99 others); Wed, 9 Jan 2019 09:54:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30136 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731733AbfAIOy2 (ORCPT ); Wed, 9 Jan 2019 09:54:28 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 99030C0C4275; Wed, 9 Jan 2019 14:54:27 +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 86DA4620D5; Wed, 9 Jan 2019 14:54:20 +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 F0F4F3F600; Wed, 9 Jan 2019 14:54:19 +0000 (UTC) Date: Wed, 9 Jan 2019 09:54:19 -0500 (EST) From: Pankaj Gupta To: Jan Kara Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, qemu-devel@nongnu.org, linux-nvdimm@ml01.01.org, linux-fsdevel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-acpi@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, stefanha@redhat.com, dan j williams , riel@surriel.com, nilal@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, zwisler@kernel.org, vishal l verma , dave jiang , david@redhat.com, jmoyer@redhat.com, xiaoguangrong eric , hch@infradead.org, mst@redhat.com, jasowang@redhat.com, lcapitulino@redhat.com, imammedo@redhat.com, eblake@redhat.com, willy@infradead.org, tytso@mit.edu, adilger kernel , darrick wong , rjw@rjwysocki.net Message-ID: <1413703615.61223613.1547045659656.JavaMail.zimbra@redhat.com> In-Reply-To: <20190109144215.GI15397@quack2.suse.cz> References: <20190109135606.15401-1-pagupta@redhat.com> <20190109144215.GI15397@quack2.suse.cz> Subject: Re: [PATCH v3 4/5] ext4: disable map_sync for virtio pmem MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.65.161.12, 10.4.195.15] Thread-Topic: ext4: disable map_sync for virtio pmem Thread-Index: 8LCqfLuGXGXi907GKJOrCBv1J6wJTA== X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 09 Jan 2019 14:54:28 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > On Wed 09-01-19 19:26:05, Pankaj Gupta wrote: > > Virtio pmem provides asynchronous host page cache flush > > mechanism. We don't support 'MAP_SYNC' with virtio pmem > > and ext4. > > > > Signed-off-by: Pankaj Gupta > ... > > @@ -371,6 +373,13 @@ static int ext4_file_mmap(struct file *file, struct > > vm_area_struct *vma) > > if (!IS_DAX(file_inode(file)) && (vma->vm_flags & VM_SYNC)) > > return -EOPNOTSUPP; > > > > + /* We don't support synchronous mappings with guest direct access > > + * and virtio based host page cache flush mechanism. > > + */ > > + if (IS_DAX(file_inode(file)) && virtio_pmem_host_cache_enabled(dax_dev) > > + && (vma->vm_flags & VM_SYNC)) > > + return -EOPNOTSUPP; > > + > > Shouldn't there rather be some generic way of doing this? Having > virtio_pmem_host_cache_enabled() check in filesystem code just looks like > filesystem sniffing into details is should not care about... Maybe just > naming this (or having a wrapper) dax_dev_map_sync_supported()? Thanks for the feedback. Just wanted to avoid 'dax' in function name just to differentiate this with real dax. But yes can add a wrapper: dax_dev_map_sync_supported() Thanks, Pankaj