Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1538823ybi; Fri, 31 May 2019 23:32:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqySn1bCZKsdLfsJwN1djUjONdZTGlbRrcthNtG3Cd5olAogG6pONpU4jWUKMLuDacciiFeW X-Received: by 2002:a17:90b:913:: with SMTP id bo19mr13941141pjb.52.1559370721385; Fri, 31 May 2019 23:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559370721; cv=none; d=google.com; s=arc-20160816; b=SSS1vabBlBs9XwPq4kNe6pHTCUEgxinR/ecliJz7eYo4FSvKBFQ2ekBRkZtDXf3kZM rfWfa80kRGC6NFb3ym0Bkvk9669AK48G8gxpTgw08SUljUPNuKAUTxuIj9Xab4ox7fNH 0YJZ6HFHLiwC2ud5QApW3R/DrA/rjcSSZ35nghlYZxC3cxumL152CIJclsbPc494X9FT dgEdkb84OTL8smtYVJ8vfwgmXsVc0J8v88YVVc2zCCoumiBN+S+0vYehYTudHJIfZ7mH CT+d5wPlN+IZ3y+TRSvAlfUg7ceuvG4lHdI8M1otAVykVpcDkYbEdCA+xnHVuf0WpbM2 Qy/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=pvQK6WJG0mGv3pVSu5OSYb8LqyE3fhcFrJhciECSYJY=; b=ok5vBldshoDghA4b+zPSzjQ4SD7wvEvBJoVGWGZN5p08rSNqd+LelB6mQKfs6C4ait W9hSqJAi8L7cmaPqeulQUoqJLcylKBJjutoPg95gYexg+RcVNCfJ7YVf1w6GYI4O1zKo BgTOis2H1Y6b61EazE8Qh3yIhbtiaGnedBccbjGMlVgK5gbMflNTfHRqBVtgaTLjclS7 Z9orXeXVE9N3c19AodAA3f4zU6oJtLeHRV9A2O/EfPXt5eQQQuZXh43Hk6GAtN4XGNnx B2stKSPKGODJKA3rvT01UYxrROlnHRyWPHSQyJj2hukEHhp+k48gQdwW7aZHAgu90KmA L7Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=zAq3dmDc; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si8964292plg.336.2019.05.31.23.31.33; Fri, 31 May 2019 23:32:01 -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; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=zAq3dmDc; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726210AbfFAG3I (ORCPT + 99 others); Sat, 1 Jun 2019 02:29:08 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:39474 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbfFAG3I (ORCPT ); Sat, 1 Jun 2019 02:29:08 -0400 Received: by mail-ot1-f67.google.com with SMTP id k24so6292198otn.6 for ; Fri, 31 May 2019 23:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pvQK6WJG0mGv3pVSu5OSYb8LqyE3fhcFrJhciECSYJY=; b=zAq3dmDcYmDOFRGWPRho3n9VwHtS/ms4RxAtlrWfGP6kzMscluGhAO/pUa4TA+4EUS O0/4V2wR9qZcVx3qMS3QoB+HAQeLd2d2CDwsDN1N3DBbRKcGdR7bB+bQJPhBtO5qBBD8 qYtkmlkUSEKMjZ50q7KpWOF2nJop+rQTGA+KOkHdzHd+G7A7NpsAwm9za6+lD17Xpadt bBwCs0HFc6tNdDL6uOqSRQ+UbMp0iEmi4VLXhjbg/8iQ6ZYHFac4FNgAxARif9GzMuH6 t9gOCBA01URioVkiQ14oCPcK7W+RxbSIJNNYh1f11vuThMbN9aOLBPGBjStFZqhbk42U MHXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pvQK6WJG0mGv3pVSu5OSYb8LqyE3fhcFrJhciECSYJY=; b=HGF7OhTqCJ/re+h0MkSZaS6daoGfgy0iX1SBHBEs5gfOCdvR6hiYY8ogDMoVlRq5GX biFas4Xf1SgdSP4gsU54v/JpclEI8EuUDAcv1OA5QQXpVl9NniYmMW7nAG/sP72Co1lc xmph/Rjmljg13BiUD5kkZwzks97K1rwn1W+DxVKLgVDiGsoS7LmbspCxDUxO/3gkZcCu nh5NPQB/bX3E8TkhyYQV/FhvFslnoxErJJEDfsQpx632DjS8dccP0ClTQnjvDyYm7X2Q sdhI802xC6pyqQGFXYialpC5/KZ8s5/VKmVp8nmyH+IEbIZF73jpqsRVQB1+9yLGX0mc 9XGQ== X-Gm-Message-State: APjAAAV7xZ6nmGf8LaV0b/OkZ2+R4/C/PghAyVb/gwtS6p46aHxYsVnS EVu1mTNMrS7HddKOV2Res1R6HS9Of1bIc1XpMdK02w== X-Received: by 2002:a9d:7a8b:: with SMTP id l11mr4259219otn.247.1559370547538; Fri, 31 May 2019 23:29:07 -0700 (PDT) MIME-Version: 1.0 References: <20190521133713.31653-1-pagupta@redhat.com> <20190521133713.31653-5-pagupta@redhat.com> In-Reply-To: <20190521133713.31653-5-pagupta@redhat.com> From: Dan Williams Date: Fri, 31 May 2019 23:28:56 -0700 Message-ID: Subject: Re: [PATCH v10 4/7] dm: enable synchronous dax To: Pankaj Gupta Cc: linux-nvdimm , Linux Kernel Mailing List , virtualization@lists.linux-foundation.org, KVM list , linux-fsdevel , Linux ACPI , Qemu Developers , linux-ext4 , linux-xfs , device-mapper development , Ross Zwisler , Vishal L Verma , Dave Jiang , "Michael S. Tsirkin" , Jason Wang , Matthew Wilcox , "Rafael J. Wysocki" , Christoph Hellwig , Len Brown , Jan Kara , "Theodore Ts'o" , Andreas Dilger , "Darrick J. Wong" , lcapitulino@redhat.com, Kevin Wolf , Igor Mammedov , jmoyer , Nitesh Narayan Lal , Rik van Riel , Stefan Hajnoczi , Andrea Arcangeli , David Hildenbrand , david , cohuck@redhat.com, Xiao Guangrong , Paolo Bonzini , yuval shaia , Adam Borowski , jstaron@google.com, Randy Dunlap , Mike Snitzer Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, May 21, 2019 at 6:43 AM Pankaj Gupta wrote: > > This patch sets dax device 'DAXDEV_SYNC' flag if all the target > devices of device mapper support synchrononous DAX. If device > mapper consists of both synchronous and asynchronous dax devices, > we don't set 'DAXDEV_SYNC' flag. > > Signed-off-by: Pankaj Gupta > --- > drivers/md/dm-table.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c > index cde3b49b2a91..1cce626ff576 100644 > --- a/drivers/md/dm-table.c > +++ b/drivers/md/dm-table.c > @@ -886,10 +886,17 @@ static int device_supports_dax(struct dm_target *ti, struct dm_dev *dev, > return bdev_dax_supported(dev->bdev, PAGE_SIZE); > } > > +static int device_synchronous(struct dm_target *ti, struct dm_dev *dev, > + sector_t start, sector_t len, void *data) > +{ > + return dax_synchronous(dev->dax_dev); > +} > + > static bool dm_table_supports_dax(struct dm_table *t) > { > struct dm_target *ti; > unsigned i; > + bool dax_sync = true; > > /* Ensure that all targets support DAX. */ > for (i = 0; i < dm_table_get_num_targets(t); i++) { > @@ -901,7 +908,14 @@ static bool dm_table_supports_dax(struct dm_table *t) > if (!ti->type->iterate_devices || > !ti->type->iterate_devices(ti, device_supports_dax, NULL)) > return false; > + > + /* Check devices support synchronous DAX */ > + if (dax_sync && > + !ti->type->iterate_devices(ti, device_synchronous, NULL)) > + dax_sync = false; Looks like this needs to be rebased on the current state of v5.2-rc, and then we can nudge Mike for an ack.