Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1170481imu; Wed, 9 Jan 2019 12:59:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN6TxgX4aGizYtuemmMuNAK8la9d4gb/rQZxqcu08Lf7l22F0bKjsYXWKbL/qFcyLBw7USWE X-Received: by 2002:a63:a401:: with SMTP id c1mr4660944pgf.403.1547067592962; Wed, 09 Jan 2019 12:59:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547067592; cv=none; d=google.com; s=arc-20160816; b=Vcij496Axpd+fAS0HNvSTE2xsl1HmOb6Tkj7vR0M8I98L628Z/aFNF1vZ42cY6Tcpd z/EHnZOEywH47TT2iDB8MW2bAQqLfA7bGAs8g0qypz8aNh0b18yQNbCJoSsPshY04U15 S+xSYg1NnLdMCjXAQksSNOZnfMR1rMd5S89tGqKkEwwt+AbdZWYfMEbAGn01HQI6KUME I5GLKq2U9qJSVvn6gFuLfxxjoI9OTEGJBp3vRlYWOzSPZ0yX8UqToKpdBFZ3fBnFsTV7 Gr+zSUgbi9avc124339FOK7OVxiRs+5Hhww/SmWZ18ciFdnz1HeaRWJKnuGwTwTK+X47 yorQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZODaZcJHEihwM2lM5+LCehIzLXVvDrvodH3oT3bqgeI=; b=0YdjdwE2d1N0c02VCxFZ6hH5KfwqykfX9Tl6DkXgevw2mK4WuYor7QpAl0YYjhnaEE ABJ1YGjNrP9zPKtvF+lwy41qkQxnBQ0Xn16mcVzSonn8bd0dn9lrhL5R2A69lCl+Lv/4 iG1q+heEq52RMuVakGMFY/GY+4NyPgeBObgqsoJeeUYfSMHPniT/TtuFjzI6g03+du0q npRJtB6c6VQvHaJBUd7qdw4W9chDRfiKdttcrCGdc3NAaP8Wudh6nu1LaenAZojQTiMK JB7OhfBBbjjcrRdVexSCrdbUD1MhkBhSgSgSSoAGlAAgacnyR+rr/rYesXL/njbf+hAa lpMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=NZAtybWC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si5815152pgz.180.2019.01.09.12.59.38; Wed, 09 Jan 2019 12:59:52 -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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=NZAtybWC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728141AbfAITPb (ORCPT + 99 others); Wed, 9 Jan 2019 14:15:31 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:41030 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727826AbfAITPa (ORCPT ); Wed, 9 Jan 2019 14:15:30 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x09GOJcC021815; Wed, 9 Jan 2019 16:27:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=ZODaZcJHEihwM2lM5+LCehIzLXVvDrvodH3oT3bqgeI=; b=NZAtybWCH3l0grJGKaxK4PESOGhDvLOybyr+k/48PFeWTJI3uyzZsVrXUMqGu5wQ1yhX 1yqo25wM7bfcXo34Wr8Nh0ZuhWoP7r8sJPT/A4sHzBoCU2Ulc0S0if9DNoH3e+0dwsQW IMuLbZ3DE/KUFgBHGZ6kR+xTNj8SxPpBgkyn3tZBuZ/Lx8d+vsPu0l1ANaL/kJlQS2zo 4NxRJQHfANgVbXnZNV+MRn9ayd+M+L2GQocfV8ginqNjb8gFiaP7/QKAsEgwUR7eflGU +JlB0y1xPMpWdtaDbJxUYLjjWlo0tRBoWPalanT2Iz44YRiZrZ05VF5dj3iCSZsiPAKt +A== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2ptj3e2jvq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Jan 2019 16:27:01 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x09GQxgU015883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 9 Jan 2019 16:26:59 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x09GQvdw017959; Wed, 9 Jan 2019 16:26:57 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 09 Jan 2019 08:26:57 -0800 Date: Wed, 9 Jan 2019 08:26:54 -0800 From: "Darrick J. Wong" To: Pankaj Gupta 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, jack@suse.cz, stefanha@redhat.com, dan.j.williams@intel.com, riel@surriel.com, nilal@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, zwisler@kernel.org, vishal.l.verma@intel.com, dave.jiang@intel.com, david@redhat.com, jmoyer@redhat.com, xiaoguangrong.eric@gmail.com, 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@dilger.ca, rjw@rjwysocki.net Subject: Re: [PATCH v3 5/5] xfs: disable map_sync for virtio pmem Message-ID: <20190109162654.GW12689@magnolia> References: <20190109144736.17452-1-pagupta@redhat.com> <20190109144736.17452-6-pagupta@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190109144736.17452-6-pagupta@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9130 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=639 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901090136 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 09, 2019 at 08:17:36PM +0530, Pankaj Gupta wrote: > Virtio pmem provides asynchronous host page cache flush > mechanism. we don't support 'MAP_SYNC' with virtio pmem > and xfs. > > Signed-off-by: Pankaj Gupta > --- > fs/xfs/xfs_file.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c > index e474250..eae4aa4 100644 > --- a/fs/xfs/xfs_file.c > +++ b/fs/xfs/xfs_file.c > @@ -1190,6 +1190,14 @@ xfs_file_mmap( > if (!IS_DAX(file_inode(filp)) && (vma->vm_flags & VM_SYNC)) > return -EOPNOTSUPP; > > + /* We don't support synchronous mappings with guest direct access > + * and virtio based host page cache mechanism. > + */ > + if (IS_DAX(file_inode(filp)) && virtio_pmem_host_cache_enabled( Echoing what Jan said, this ought to be some sort of generic function that tells us whether or not memory mapped from the dax device will always still be accessible even after a crash (i.e. supports MAP_SYNC). What if the underlying file on the host is itself on pmem and can be MAP_SYNC'd? Shouldn't the guest be able to use MAP_SYNC as well? --D > + xfs_find_daxdev_for_inode(file_inode(filp))) && > + (vma->vm_flags & VM_SYNC)) > + return -EOPNOTSUPP; > + > file_accessed(filp); > vma->vm_ops = &xfs_file_vm_ops; > if (IS_DAX(file_inode(filp))) > -- > 2.9.3 >