From patchwork Fri Jan 13 22:54:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 9516605 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A6E68601E5 for ; Fri, 13 Jan 2017 22:54:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 965C828784 for ; Fri, 13 Jan 2017 22:54:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AADD2878A; Fri, 13 Jan 2017 22:54:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 23F0028784 for ; Fri, 13 Jan 2017 22:54:08 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 66F4C81C6B; Fri, 13 Jan 2017 14:54:08 -0800 (PST) X-Original-To: linux-nvdimm@ml01.01.org Delivered-To: linux-nvdimm@ml01.01.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 40E2281C6A for ; Fri, 13 Jan 2017 14:54:07 -0800 (PST) Received: from akpm3.mtv.corp.google.com (unknown [104.132.1.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 30CCCBC6; Fri, 13 Jan 2017 22:54:07 +0000 (UTC) Date: Fri, 13 Jan 2017 14:54:06 -0800 From: Andrew Morton To: Toshi Kani Subject: Re: [PATCH v6] DAX: enable iostat for read/write Message-Id: <20170113145406.b1f065fb7fda67fd18830969@linux-foundation.org> In-Reply-To: <20170113233418.32252-1-toshi.kani@hpe.com> References: <20170113233418.32252-1-toshi.kani@hpe.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-nvdimm@ml01.01.org, david@fromorbit.com, linux-kernel@vger.kernel.org, Joe Perches , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 13 Jan 2017 16:34:18 -0700 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. > > ... > > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -1058,12 +1058,24 @@ dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, > { > struct address_space *mapping = iocb->ki_filp->f_mapping; > struct inode *inode = mapping->host; > + struct gendisk *disk = inode->i_sb->s_bdev->bd_disk; > loff_t pos = iocb->ki_pos, ret = 0, done = 0; > unsigned flags = 0; > + unsigned long start = 0; > + int do_acct = blk_queue_io_stat(disk->queue); (The poorly named) blk_queue_io_stat() actually returns a bool. This is well concealed because blk_queue_io_stat() is unnecessarily implemented as a macro (why oh why). --- a/fs/dax.c~dax-enable-iostat-for-read-write-fix +++ a/fs/dax.c @@ -1085,7 +1085,7 @@ dax_iomap_rw(struct kiocb *iocb, struct loff_t pos = iocb->ki_pos, ret = 0, done = 0; unsigned flags = 0; unsigned long start = 0; - int do_acct = blk_queue_io_stat(disk->queue); + bool do_acct = blk_queue_io_stat(disk->queue); if (iov_iter_rw(iter) == WRITE) flags |= IOMAP_WRITE;