lkml.org 
[lkml]   [2017]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4] DAX: enable iostat for read/write
Date
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@hpe.com>
> 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
\
 
 \ /
  Last update: 2017-01-11 00:56    [W:0.048 / U:2.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site