Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2747133yba; Fri, 10 May 2019 18:27:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOQL5RaqH1KyvgSFN4km0P/Hv5M8N1QvnVf5qPLSCwQ/b3DlYRVFdbOiG0PwnzkrOaZKdt X-Received: by 2002:a62:1897:: with SMTP id 145mr18498746pfy.122.1557538048826; Fri, 10 May 2019 18:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557538048; cv=none; d=google.com; s=arc-20160816; b=bvk8Y+n8fQIeBfJZn80rSXm0KEVd0zIMZ8N6WB8rm0ARZKcdFoS2J/BEjdTie/YHQW E+4D2rfdKQgeoERkB2JWJLBCZd7lHYkROrD9nsE+cL4P+t7Sv+h/XrV9CzHMQIwJF94t X0It7l0OfRwPYaokhVywbhYDLQXXiY9fHXyLNo0usZojkvUoK6sUTO0TE6XPBi7gfW3u PLAEsP83v5sOFCSSgm0TsdlWPiVvB3Psd1poZQelvgPZlXYGbgk+1OVbeMQbtOWSa6X0 D6TBqzPCkBAqsitqhq9dG/33p7kOy7aXtuV3dHGfvlNpGC0h6bJFnE9sGiOBUaQeJ77O A3og== 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=8BtVKLhdENhTsf8cNQDBj/dYBRFtr1nE4dEuLnrHRWk=; b=rPdBjM5XbXzrXvZ3AFn7GYKZk7rP/obMscuo8UYR4fZSPZVsnHe4d0Ms5zhUp7iUl5 67R23HsN0v+O8ZcYTETYcdhom5HJHIQy2+8uX1JAGw3iKpEVaTmnpROsOtMtO3l9sW2C h1BrsDLEs6nq603rM7MQsguI37nHIzsFVWzICfwNlqR7u9EGzqnJ9LGZHupDzwB1jjR8 VDw9agRiIgUFSinqZpKodpm4yPTdmygmI1HAlkrBcR5oMehJJalX8pDg/jP0c9Lsmas2 MLiDvKWdNNcnXgLErr11XdaKXIEXrZ5nXRTKA+9WR1J5EX3ioLCKJ+tIZmUG2a3Qi1Gu Amhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 k5si8622889pls.393.2019.05.10.18.27.04; Fri, 10 May 2019 18:27:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 S1728274AbfEKBXU (ORCPT + 99 others); Fri, 10 May 2019 21:23:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55252 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728064AbfEKBXU (ORCPT ); Fri, 10 May 2019 21:23:20 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 217C2308FC4E; Sat, 11 May 2019 01:23:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E0D66100E9FF; Sat, 11 May 2019 01:23:18 +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 676DA18089CA; Sat, 11 May 2019 01:23:18 +0000 (UTC) Date: Fri, 10 May 2019 21:23:17 -0400 (EDT) From: Pankaj Gupta To: Dan Williams Cc: cohuck@redhat.com, Jan Kara , KVM list , "Michael S. Tsirkin" , Jason Wang , david , Qemu Developers , virtualization@lists.linux-foundation.org, Andreas Dilger , Ross Zwisler , Andrea Arcangeli , Dave Jiang , jstaron@google.com, linux-nvdimm , Vishal L Verma , David Hildenbrand , Matthew Wilcox , Christoph Hellwig , Linux ACPI , jmoyer , linux-ext4 , Len Brown , Adam Borowski , Rik van Riel , yuval shaia , Stefan Hajnoczi , Paolo Bonzini , lcapitulino@redhat.com, Kevin Wolf , Nitesh Narayan Lal , Theodore Ts'o , Xiao Guangrong , "Darrick J. Wong" , "Rafael J. Wysocki" , Linux Kernel Mailing List , linux-xfs , linux-fsdevel , Igor Mammedov 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.116.28, 10.4.195.22] Thread-Topic: libnvdimm: add dax_dev sync flag Thread-Index: ptJfczfofLn7Sapjrtn0VT/vVA1TgQ== X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sat, 11 May 2019 01:23:19 +0000 (UTC) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org > > > > > > > > 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 > >