Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753745AbcJOH7U (ORCPT ); Sat, 15 Oct 2016 03:59:20 -0400 Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:55287 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751096AbcJOH7L (ORCPT ); Sat, 15 Oct 2016 03:59:11 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2A8HwCp4AFYEIjVLHlcHAEBBAEBCgEBgzwBAQEBAR2BU4J5g3mcIAEBAQEBAQaBG4wFhiSEF4YcAgIBAQKCEk0BAgEBAQEBAgYBAQEBAQEBATdAhGIBAQQnExwjEAgDGAklDwUlAwcaE4hRwmsBAQgCASUehVSFIIomAQSZPkiPeIF5iB6FaYx7hACBGAYIgn4cgWcqNAGIVQEBAQ Date: Sat, 15 Oct 2016 18:54:43 +1100 From: Dave Chinner To: Toshi Kani Cc: akpm@linux-foundation.org, dan.j.williams@intel.com, viro@zeniv.linux.org.uk, ross.zwisler@linux.intel.com, linux-nvdimm@ml01.01.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] DAX: enable iostat for read/write Message-ID: <20161015075443.GG27872@dastard> References: <1476465913-25305-1-git-send-email-toshi.kani@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476465913-25305-1-git-send-email-toshi.kani@hpe.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1513 Lines: 48 On Fri, Oct 14, 2016 at 11:25:13AM -0600, 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; > + int cpu = part_stat_lock(); > + > + *start = jiffies; > + part_round_stats(cpu, &disk->part0); > + part_stat_inc(cpu, &disk->part0, ios[rw]); > + part_stat_add(cpu, &disk->part0, sectors[rw], sec); > + part_inc_in_flight(&disk->part0, rw); > + part_stat_unlock(); > +} Why reimplement generic_start_io_acct() and generic_end_io_acct()? -Dave. -- Dave Chinner david@fromorbit.com