From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 657F62125ADD3 for ; Fri, 10 May 2019 18:23:20 -0700 (PDT) Date: Fri, 10 May 2019 21:23:17 -0400 (EDT) From: Pankaj Gupta Message-ID: <2003480558.28042237.1557537797923.JavaMail.zimbra@redhat.com> In-Reply-To: References: <20190510155202.14737-1-pagupta@redhat.com> <20190510155202.14737-4-pagupta@redhat.com> <864186878.28040999.1557535549792.JavaMail.zimbra@redhat.com> Subject: Re: [Qemu-devel] [PATCH v8 3/6] libnvdimm: add dax_dev sync flag MIME-Version: 1.0 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Dan Williams Cc: Jan Kara , KVM list , "Michael S. Tsirkin" , Jason Wang , david , Qemu Developers , virtualization@lists.linux-foundation.org, Andreas Dilger , Ross Zwisler , Andrea Arcangeli , jstaron@google.com, linux-nvdimm , David Hildenbrand , Matthew Wilcox , Christoph Hellwig , Linux ACPI , linux-ext4 , Len Brown , Adam Borowski , Rik van Riel , yuval shaia , Stefan Hajnoczi , Igor Mammedov , lcapitulino@redhat.com, Kevin Wolf , Nitesh Narayan Lal , Theodore Ts'o , Xiao Guangrong , cohuck@redhat.com, "Rafael J. Wysocki" , Linux Kernel Mailing List , linux-xfs , linux-fsdevel , Paolo Bonzini , "Darrick J. Wong" List-ID: > > > > > > > > This patch adds 'DAXDEV_SYNC' flag which is set > > > > for nd_region doing synchronous flush. This later > > > > is used to disable MAP_SYNC functionality for > > > > ext4 & xfs filesystem for devices don't support > > > > synchronous flush. > > > > > > > > Signed-off-by: Pankaj Gupta > > > > --- > > > > drivers/dax/bus.c | 2 +- > > > > drivers/dax/super.c | 13 ++++++++++++- > > > > drivers/md/dm.c | 3 ++- > > > > drivers/nvdimm/pmem.c | 5 ++++- > > > > drivers/nvdimm/region_devs.c | 7 +++++++ > > > > include/linux/dax.h | 8 ++++++-- > > > > include/linux/libnvdimm.h | 1 + > > > > 7 files changed, 33 insertions(+), 6 deletions(-) > > > [..] > > > > diff --git a/drivers/md/dm.c b/drivers/md/dm.c > > > > index 043f0761e4a0..ee007b75d9fd 100644 > > > > --- a/drivers/md/dm.c > > > > +++ b/drivers/md/dm.c > > > > @@ -1969,7 +1969,8 @@ static struct mapped_device *alloc_dev(int minor) > > > > sprintf(md->disk->disk_name, "dm-%d", minor); > > > > > > > > if (IS_ENABLED(CONFIG_DAX_DRIVER)) { > > > > - dax_dev = alloc_dax(md, md->disk->disk_name, > > > > &dm_dax_ops); > > > > + dax_dev = alloc_dax(md, md->disk->disk_name, > > > > &dm_dax_ops, > > > > + > > > > DAXDEV_F_SYNC); > > > > > > Apologies for not realizing this until now, but this is broken. > > > Imaging a device-mapper configuration composed of both 'async' > > > virtio-pmem and 'sync' pmem. The 'sync' flag needs to be unified > > > across all members. I would change this argument to '0' and then > > > arrange for it to be set at dm_table_supports_dax() time after > > > validating that all components support synchronous dax. > > > > o.k. Need to set 'DAXDEV_F_SYNC' flag after verifying all the target > > components support synchronous DAX. > > > > Just a question, If device mapper configuration have composed of both > > virtio-pmem or pmem devices, we want to configure device mapper for async > > flush? > > If it's composed of both then, yes, it needs to be async flush at the > device-mapper level. Otherwise MAP_SYNC will succeed and fail to > trigger fsync on the host file when necessary for the virtio-pmem > backed portion of the device-mapper device. o.k. Agree. Thanks you, Pankaj > > _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm