Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938728AbcJQR4X (ORCPT ); Mon, 17 Oct 2016 13:56:23 -0400 Received: from mail-by2nam01on0099.outbound.protection.outlook.com ([104.47.34.99]:11117 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932125AbcJQR4P (ORCPT ); Mon, 17 Oct 2016 13:56:15 -0400 From: "Kani, Toshimitsu" To: "david@fromorbit.com" CC: "dan.j.williams@intel.com" , "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+E6hHqMOpambIaCpJkaAgAPH/AA= Date: Mon, 17 Oct 2016 17:40:56 +0000 Message-ID: <1476725956.20881.68.camel@hpe.com> References: <1476465913-25305-1-git-send-email-toshi.kani@hpe.com> <20161015075443.GG27872@dastard> In-Reply-To: <20161015075443.GG27872@dastard> 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: 931ecb00-7936-41f0-a0cc-08d3f6b4bff2 x-microsoft-exchange-diagnostics: 1;CS1PR84MB0005;7:qpEomWNXUSYl5fB2rAoxBU0Af/2gtQ5Gvn/xVV0SAyuRK2UxEV1rpMjk5JCGAJitzq+p1NYlgMuIdzaO/Gk6Da060YgG4+YhE4MYcKnFiQM7A+nhkD7e738/p79kWUyvjGnPvuaVsjMXZj7NnmXY9IrCI6Xf2DhY3aAduBrjkfregPuEmhjw59v9lo06DBzb9ZHLc/U2B7MYmrY1qTPdJ5RC1FRsDbGhhUXKNo1qbyxKcTzXa4xnztQ5EF+SnCHeT6rFdoJPlRLmbxQxrEJB3+9tEPZw0Gie4WXG47G+uTKDCbe9xGsJZBBjIHnI/ol/4M6OQqMD+u/1QmykaiTKCHCpfZ0Yi4pfEFw2RZwnUZg= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0005; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026);SRVR:CS1PR84MB0005;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0005; x-forefront-prvs: 0098BA6C6C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(199003)(24454002)(189002)(377424004)(4001150100001)(106356001)(81156014)(1730700003)(8676002)(68736007)(7736002)(110136003)(103116003)(33646002)(3660700001)(3280700002)(8936002)(2351001)(2501003)(10400500002)(5660300001)(4326007)(6116002)(102836003)(3846002)(586003)(87936001)(76176999)(54356999)(36756003)(2950100002)(50986999)(6916009)(77096005)(101416001)(92566002)(7846002)(106116001)(5640700001)(105586002)(122556002)(189998001)(99286002)(2906002)(2900100001)(97736004)(5002640100001)(86362001)(305945005)(66066001)(81166006);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR84MB0005;H:CS1PR84MB0005.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2016 17:40:56.2535 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0005 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 u9HHuRpc004782 Content-Length: 987 Lines: 32 On Sat, 2016-10-15 at 18:54 +1100, Dave Chinner wrote: > On Fri, Oct 14, 2016 at 11:25:13AM -0600, Toshi Kani wrote:  : > > +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()? It was modeled after __nd_iostat_start() / nd_iostart_end().  I agree that we can use generic_start_io_acct() and generic_end_io_acct() here. Should we also change the nd interface to use the generic version as well? Thanks, -Toshi ps. Sorry I realized this comment after sending out v2...