Re: [PATCH v4] DAX: enable iostat for read/write
From: Kani, Toshimitsu
Date: Tue Jan 10 2017 - 18:55:02 EST
On Tue, 2017-01-10 at 15:41 -0800, Dan Williams wrote:
> On Tue, Jan 10, 2017 at 4:11 PM, Toshi Kani <toshi.kani@xxxxxxx>
> wrote:
:
> >
> > +ÂÂÂÂÂÂÂif (blk_queue_io_stat(disk->queue)) {
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂint sec = iov_iter_count(iter) >> 9;
> > +
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂstart = jiffies;
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂgeneric_start_io_acct(iov_iter_rw(iter),
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ(!sec) ? 1 : sec, &disk-
> > >part0);
> > +ÂÂÂÂÂÂÂ}
> > +
> > ÂÂÂÂÂÂÂÂwhile (iov_iter_count(iter)) {
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂret = iomap_apply(inode, pos, iov_iter_count(iter),
> > flags, ops,
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂiter, dax_iomap_actor);
> > @@ -1073,6 +1083,9 @@ dax_iomap_rw(struct kiocb *iocb, struct
> > iov_iter *iter,
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdone += ret;
> > ÂÂÂÂÂÂÂÂ}
> >
> > +ÂÂÂÂÂÂÂif (start)
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂgeneric_end_io_acct(iov_iter_rw(iter), &disk-
> > >part0, start);
> > +
>
> I think we can afford to add a separate flag that indicates whether
> we called generic_start_io_acct(). Just in case 'start' is '0' after
> 'jiffies' rolls over.
Good point. I will add a flag to account such a case.
Thanks,
-Toshi