Re: [PATCH v3 3/4] dm: add infrastructure for DAX support

From: Kani, Toshimitsu
Date: Fri Jun 24 2016 - 11:54:48 EST


On Thu, 2016-06-23 at 21:49 -0400, Mike Snitzer wrote:
> On Thu, Jun 23 2016 atÂÂ7:36pm -0400,
> Kani, Toshimitsu <toshi.kani@xxxxxxx> wrote:
Â:
> > 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

lvcreateÂ-I only allows multiple of page size, so we are OK with lvm2. ÂI was
wondering if the check in lvm2 is enough. ÂAre there any other tools that may
be used to configure stripe size? ÂCan we trust userspace on this?

Thanks,
-Toshi