Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932982AbcJNSrr (ORCPT ); Fri, 14 Oct 2016 14:47:47 -0400 Received: from mail-cys01nam02on0113.outbound.protection.outlook.com ([104.47.37.113]:20759 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932090AbcJNSri (ORCPT ); Fri, 14 Oct 2016 14:47:38 -0400 From: "Kani, Toshimitsu" To: "dan.j.williams@intel.com" CC: "viro@zeniv.linux.org.uk" , "ross.zwisler@linux.intel.com" , "linux-nvdimm@lists.01.org" , "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , "linux-fsdevel@vger.kernel.org" Subject: Re: [PATCH] DAX: enable iostat for read/write Thread-Topic: [PATCH] DAX: enable iostat for read/write Thread-Index: AQHSJkAwV6IPkv81+E6hHqMOpambIaCoNhmAgAAT0AA= Date: Fri, 14 Oct 2016 18:47:36 +0000 Message-ID: <1476470760.20881.63.camel@hpe.com> References: <1476465913-25305-1-git-send-email-toshi.kani@hpe.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=toshi.kani@hpe.com; x-originating-ip: [15.219.163.9] x-ms-office365-filtering-correlation-id: 116d04bd-b549-48ef-46c5-08d3f4629101 x-microsoft-exchange-diagnostics: 1;CS1PR84MB0006;7:bCk7qQLS3d1WXEZCS+3y+tvSLpk1EVwDItpX6MZmBUOj5cT2dDwwUkznY8DasAZp7CRKajDBWP4LGUraaClkT283bFDBe30BRTYvCInz+7bR5eV9Hd6497G1Uj9IsE1qdqPECTKbFpAuiMVsdYoAinMvPCtjCQvcupkq4A56FJFyTcVYrUNET9Ia5htwqKkj86ENrxdyOCRc/26pLXceN10CRx/CH80QCkF7S1POJOJr67/mChBOpLUkOBNGP0OonyO9vyvO8juHTmrQe/CWvjr2Qqgc1hvbtu4LnwDEc4QfmNV/8ksYlq0YpYLRHBmB2lLhuEo6SVOKEmCqkpILtBn6ZBpt3DxmsdozJeuLBDs= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0006; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(278428928389397)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026);SRVR:CS1PR84MB0006;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0006; x-forefront-prvs: 0095BCF226 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(24454002)(189002)(377424004)(199003)(377454003)(8676002)(6116002)(76176999)(102836003)(3846002)(66066001)(81156014)(81166006)(3660700001)(86362001)(8936002)(3280700002)(586003)(5640700001)(2351001)(5002640100001)(189998001)(305945005)(97736004)(4001150100001)(36756003)(2501003)(7736002)(7846002)(103116003)(33646002)(10400500002)(92566002)(68736007)(101416001)(77096005)(50986999)(110136003)(54356999)(87936001)(2900100001)(2906002)(99286002)(106356001)(2950100002)(106116001)(6916009)(5660300001)(4326007)(105586002)(19580395003)(19580405001)(122556002);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR84MB0006;H:CS1PR84MB0005.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <6B877BA1E93E4A41828FD5338365FA20@NAMPRD84.PROD.OUTLOOK.COM> MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2016 18:47:36.3932 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0006 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u9EIm4pq026002 Content-Length: 1637 Lines: 48 On Fri, 2016-10-14 at 10:35 -0700, Dan Williams wrote: > 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? You are right. I will update to set a minimum of one sector in v2.  Thanks! -Toshi