linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Mike Snitzer <snitzer@redhat.com>
Cc: linux-nvdimm <linux-nvdimm@lists.01.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	virtualization@lists.linux-foundation.org,
	KVM list <kvm@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>,
	Qemu Developers <qemu-devel@nongnu.org>,
	linux-ext4 <linux-ext4@vger.kernel.org>,
	linux-xfs <linux-xfs@vger.kernel.org>,
	Ross Zwisler <zwisler@kernel.org>,
	Vishal L Verma <vishal.l.verma@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Matthew Wilcox <willy@infradead.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Christoph Hellwig <hch@infradead.org>,
	Len Brown <lenb@kernel.org>, Jan Kara <jack@suse.cz>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	lcapitulino@redhat.com, Kevin Wolf <kwolf@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>, jmoyer <jmoyer@redhat.com>,
	Nitesh Narayan Lal <nilal@redhat.com>,
	Rik van Riel <riel@surriel.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	David Hildenbrand <david@redhat.com>, david <david@fromorbit.com>,
	cohuck@redhat.com, Xiao Guangrong <xiaoguangrong.eric@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Adam Borowski <kilobyte@angband.pl>,
	yuval shaia <yuval.shaia@oracle.com>,
	jstaron@google.com, Pankaj Gupta <pagupta@redhat.com>,
	device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH v9 4/7] dm: enable synchronous dax
Date: Wed, 15 May 2019 13:48:57 -0700	[thread overview]
Message-ID: <CAPcyv4jp+9eBQMX+KXhT1oZRkxLeCp9r9g9hFUCRw=OcuQ9wmQ@mail.gmail.com> (raw)
In-Reply-To: <20190514145422.16923-5-pagupta@redhat.com>

[ add Mike and dm-devel ]

Mike, any concerns with the below addition to the device-mapper-dax
implementation?

On Tue, May 14, 2019 at 7:58 AM Pankaj Gupta <pagupta@redhat.com> 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 <pagupta@redhat.com>
> ---
>  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;
>         }
> +       if (dax_sync)
> +               set_dax_synchronous(t->md->dax_dev);
>
>         return true;
>  }
> --
> 2.20.1
>

  reply	other threads:[~2019-05-15 20:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14 14:54 [PATCH v9 0/7] virtio pmem driver Pankaj Gupta
2019-05-14 14:54 ` [PATCH v9 1/7] libnvdimm: nd_region flush callback support Pankaj Gupta
2019-05-15 21:07   ` Dan Williams
2019-05-16  6:28     ` Pankaj Gupta
2019-05-14 14:54 ` [PATCH v9 2/7] virtio-pmem: Add virtio pmem driver Pankaj Gupta
2019-05-14 15:09   ` Randy Dunlap
2019-05-14 15:25     ` [Qemu-devel] " Pankaj Gupta
2019-05-15 20:46       ` Dan Williams
2019-05-15 20:46   ` David Hildenbrand
2019-05-15 20:52     ` David Hildenbrand
2019-05-16  7:54       ` Pankaj Gupta
2019-05-16  7:49     ` Pankaj Gupta
2019-05-16 13:59     ` Michael S. Tsirkin
2019-05-17  5:31       ` [Qemu-devel] " Pankaj Gupta
2019-05-17  0:12   ` Jakub Staroń
2019-05-17  5:35     ` [Qemu-devel] " Pankaj Gupta
2019-05-18  1:10       ` Jakub Staroń
2019-05-20  3:46         ` Pankaj Gupta
2019-05-20  3:47           ` Pankaj Gupta
2019-05-14 14:54 ` [PATCH v9 3/7] libnvdimm: add dax_dev sync flag Pankaj Gupta
2019-05-14 14:54 ` [PATCH v9 4/7] dm: enable synchronous dax Pankaj Gupta
2019-05-15 20:48   ` Dan Williams [this message]
2019-05-14 14:54 ` [PATCH v9 5/7] dax: check synchronous mapping is supported Pankaj Gupta
2019-05-14 14:54 ` [PATCH v9 6/7] ext4: disable map_sync for async flush Pankaj Gupta
2019-05-14 14:54 ` [PATCH v9 7/7] xfs: " Pankaj Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPcyv4jp+9eBQMX+KXhT1oZRkxLeCp9r9g9hFUCRw=OcuQ9wmQ@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=aarcange@redhat.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=cohuck@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=dave.jiang@intel.com \
    --cc=david@fromorbit.com \
    --cc=david@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=hch@infradead.org \
    --cc=imammedo@redhat.com \
    --cc=jack@suse.cz \
    --cc=jasowang@redhat.com \
    --cc=jmoyer@redhat.com \
    --cc=jstaron@google.com \
    --cc=kilobyte@angband.pl \
    --cc=kvm@vger.kernel.org \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=nilal@redhat.com \
    --cc=pagupta@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riel@surriel.com \
    --cc=rjw@rjwysocki.net \
    --cc=snitzer@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=tytso@mit.edu \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=vishal.l.verma@intel.com \
    --cc=willy@infradead.org \
    --cc=xiaoguangrong.eric@gmail.com \
    --cc=yuval.shaia@oracle.com \
    --cc=zwisler@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).