Re: [PATCH] DAX: enable iostat for read/write

From: Kani, Toshimitsu
Date: Fri Oct 14 2016 - 14:48:03 EST


On Fri, 2016-10-14 at 10:35 -0700, Dan Williams wrote:
> On Fri, Oct 14, 2016 at 10:25 AM, Toshi Kani <toshi.kani@xxxxxxx>
> wrote:
> >
> > DAX IO path does not support iostat, but its metadata IO path does.
> > Therefore, iostat shows metadata IO statistics only, which has been
> > confusing to users.
> >
> > Add iostat support to the DAX read/write path.
> >
> > Note, iostat still does not support the DAX mmap path as it allows
> > user applications to access directly.
> >
> > Signed-off-by: Toshi Kani <toshi.kani@xxxxxxx>
> > Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> > Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>
> > Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
> > Cc: Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx>
> > ---
> > Âfs/dax.c |ÂÂÂ37 +++++++++++++++++++++++++++++++++++++
> > Â1 file changed, 37 insertions(+)
> >
> > diff --git a/fs/dax.c b/fs/dax.c
> > index 014defd..3aaaac2 100644
> > --- a/fs/dax.c
> > +++ b/fs/dax.c
> > @@ -144,6 +144,34 @@ static sector_t to_sector(const struct
> > buffer_head *bh,
> > ÂÂÂÂÂÂÂÂreturn sector;
> > Â}
> >
> > +static void dax_iostat_start(struct gendisk *disk, struct iov_iter
> > *iter,
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂunsigned long *start)
> > +{
> > +ÂÂÂÂÂÂÂint rw = iov_iter_rw(iter);
> > +ÂÂÂÂÂÂÂint sec = iov_iter_count(iter) >> 9;
>
> Should this be a minimum of one sector since we allow unaligned
> transfers through this interface?
>
> ...or is iov_iter_count() somehow guaranteed to be sector aligned
> here?

You are right. I will update to set a minimum of one sector in v2.Â

Thanks!
-Toshi