Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964925AbcJQT1M (ORCPT ); Mon, 17 Oct 2016 15:27:12 -0400 Received: from mail-co1nam03on0123.outbound.protection.outlook.com ([104.47.40.123]:13792 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753309AbcJQT1E (ORCPT ); Mon, 17 Oct 2016 15:27:04 -0400 From: "Kani, Toshimitsu" To: "dan.j.williams@intel.com" CC: "viro@zeniv.linux.org.uk" , "david@fromorbit.com" , "linux-nvdimm@lists.01.org" , "ross.zwisler@linux.intel.com" , "akpm@linux-foundation.org" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@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/ACAABVogIAABB8A Date: Mon, 17 Oct 2016 19:12:18 +0000 Message-ID: <1476731438.20881.73.camel@hpe.com> References: <1476465913-25305-1-git-send-email-toshi.kani@hpe.com> <20161015075443.GG27872@dastard> <1476725956.20881.68.camel@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: 6f6785ec-9b70-46b6-3412-08d3f6c1835f x-microsoft-exchange-diagnostics: 1;CS1PR84MB0005;7:Y6D47TYWUEFUzd7ZrazXKL4v80cvrLJre1Tqin4oKMoIs9xC0IBUS8FF2X+QTo+PFQGWluX002GnmsX2x3jW0c/oqf73ACbeYLnZv9yCqRHkYD5YWZwdl8sV9UoUAK7TKQF4hfFEbTs5K1fgvJ8sZmjsfeRwlF5BXIGO8rYyF2h6Espzghnd9Btg9ZOscHBjkeCx693jwDePaj24z+mJHUr09rUur55ruWefjB4csvlDoo7w4bS15K/StoqX2JKQ/9XDRnk3H4C9c0KRAkGR7u4gihuU0h+sZ/awC4PSLBTFWAhsVeAQR8Tx1gsli0poGqi5eYSW1+BfEqP87ThpGxH8drWfwpbePQtNy3UeByc= 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)(5005006)(8121501046)(3002001)(10201501046)(6055026);SRVR:CS1PR84MB0005;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0005; x-forefront-prvs: 0098BA6C6C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(377454003)(199003)(24454002)(189002)(377424004)(106356001)(4001150100001)(81156014)(8676002)(68736007)(7736002)(103116003)(110136003)(33646002)(93886004)(3660700001)(3280700002)(10400500002)(8936002)(2351001)(2501003)(19580405001)(19580395003)(4326007)(5660300001)(6116002)(102836003)(3846002)(586003)(87936001)(76176999)(54356999)(36756003)(11100500001)(2950100002)(50986999)(6916009)(77096005)(101416001)(92566002)(7846002)(106116001)(5640700001)(105586002)(122556002)(189998001)(99286002)(2906002)(97736004)(2900100001)(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 19:12:18.0445 (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 u9HJSqRN005248 Content-Length: 1243 Lines: 41 On Mon, 2016-10-17 at 11:55 -0700, Dan Williams wrote: > On Mon, Oct 17, 2016 at 10:40 AM, Kani, Toshimitsu m> wrote: > > > > 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? > > Yes, sounds good to me. Will do. Thanks! -Toshi