Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754163AbcJNRfa (ORCPT ); Fri, 14 Oct 2016 13:35:30 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:33191 "EHLO mail-oi0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755696AbcJNRfH (ORCPT ); Fri, 14 Oct 2016 13:35:07 -0400 MIME-Version: 1.0 In-Reply-To: <1476465913-25305-1-git-send-email-toshi.kani@hpe.com> References: <1476465913-25305-1-git-send-email-toshi.kani@hpe.com> From: Dan Williams Date: Fri, 14 Oct 2016 10:35:05 -0700 Message-ID: Subject: Re: [PATCH] DAX: enable iostat for read/write To: Toshi Kani Cc: Andrew Morton , Al Viro , Ross Zwisler , "linux-nvdimm@lists.01.org" , linux-fsdevel , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1344 Lines: 37 On Fri, Oct 14, 2016 at 10:25 AM, Toshi Kani 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 > Cc: Andrew Morton > Cc: Alexander Viro > Cc: Dan Williams > Cc: Ross Zwisler > --- > 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?