From: Mike Snitzer <snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: "Kani, Toshimitsu" <toshi.kani-ZPxbGqLxI0U@public.gmane.org>
Cc: "axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org"
<axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>,
"linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org"
<linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
<dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
"viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org"
<viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
Subject: Re: [PATCH v3 3/4] dm: add infrastructure for DAX support
Date: Thu, 23 Jun 2016 21:49:30 -0400 [thread overview]
Message-ID: <20160624014930.GA10540@redhat.com> (raw)
In-Reply-To: <1466724984.3504.380.camel-ZPxbGqLxI0U@public.gmane.org>
On Thu, Jun 23 2016 at 7:36pm -0400,
Kani, Toshimitsu <toshi.kani-ZPxbGqLxI0U@public.gmane.org> wrote:
> On Thu, 2016-06-23 at 17:05 -0400, Mike Snitzer wrote:
> :
> > +static int device_supports_dax(struct dm_target *ti, struct dm_dev *dev,
> > + sector_t start, sector_t len, void *data)
> > +{
> > + struct request_queue *q = bdev_get_queue(dev->bdev);
> > +
> > + return q && blk_queue_dax(q);
> > +}
> > +
> > +static bool dm_table_supports_dax(struct dm_table *t)
> > +{
> > + struct dm_target *ti;
> > + unsigned i = 0;
> > +
> > + /* Ensure that all targets support DAX. */
> > + while (i < dm_table_get_num_targets(t)) {
> > + ti = dm_table_get_target(t, i++);
> > +
> > + if (!ti->type->direct_access)
> > + return false;
> > +
> > + if (!ti->type->iterate_devices ||
> > + !ti->type->iterate_devices(ti, device_supports_dax,
> > NULL))
> > + return false;
> > + }
> > +
> > + return true;
> > +}
> > +
>
> Hi Mike,
>
> Thanks for the update. I have a question about the above change. Targets may
> have their own parameters. For instance, dm-stripe has 'chunk_size', which is
> checked in stripe_ctr(). DAX adds additional restriction that chunk_size
> needs to be aligned by page size. So, I think we need to keep target
> responsible to verify if DAX can be supported. What do you think?
We've never had to concern the dm-stripe target with hardware
specific chunk_size validation. The user is able to specify the
chunk_size via lvm2's lvcreate -I argument. Yes this gives users enough
rope to hang themselves but it is very easy to configure a dm-stripe
device with the appropriate chunk size (PAGE_SIZE) from userspace.
But lvm2 could even be trained to make sure the chunk_size is a factor
of physical_block_size (PAGE_SIZE in the case of pmem) if the underlying
devices export queue/dax=1
next prev parent reply other threads:[~2016-06-24 1:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-23 21:05 [PATCH v3 0/4] Support DAX for device-mapper linear devices Mike Snitzer
[not found] ` <1466715953-40692-1-git-send-email-snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-06-23 21:05 ` [PATCH v3 1/4] block: add QUEUE_FLAG_DAX for devices to advertise their DAX support Mike Snitzer
2016-06-23 21:05 ` [PATCH v3 2/4] block: expose QUEUE_FLAG_DAX in sysfs Mike Snitzer
2016-06-23 21:05 ` [PATCH v3 3/4] dm: add infrastructure for DAX support Mike Snitzer
[not found] ` <1466715953-40692-4-git-send-email-snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-06-23 23:36 ` Kani, Toshimitsu
[not found] ` <1466724984.3504.380.camel-ZPxbGqLxI0U@public.gmane.org>
2016-06-24 1:49 ` Mike Snitzer [this message]
[not found] ` <20160624014930.GA10540-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-06-24 15:40 ` Kani, Toshimitsu
[not found] ` <1466782822.3504.391.camel-ZPxbGqLxI0U@public.gmane.org>
2016-06-24 15:44 ` Mike Snitzer
[not found] ` <20160624154446.GB13898-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-06-24 15:56 ` Kani, Toshimitsu
2016-06-23 21:05 ` [PATCH v3 4/4] dm linear: add " Mike Snitzer
2016-06-30 17:00 ` [PATCH v3 0/4] Support DAX for device-mapper linear devices Mike Snitzer
[not found] ` <20160630170053.GA20750-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-07-08 19:30 ` Mike Snitzer
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=20160624014930.GA10540@redhat.com \
--to=snitzer-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
--cc=dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org \
--cc=toshi.kani-ZPxbGqLxI0U@public.gmane.org \
--cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.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).