Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751980AbdFOBVO (ORCPT ); Wed, 14 Jun 2017 21:21:14 -0400 Received: from g2t2352.austin.hpe.com ([15.233.44.25]:43565 "EHLO g2t2352.austin.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbdFOBVM (ORCPT ); Wed, 14 Jun 2017 21:21:12 -0400 X-Greylist: delayed 2094 seconds by postgrey-1.27 at vger.kernel.org; Wed, 14 Jun 2017 21:21:12 EDT From: "Kani, Toshimitsu" To: "dan.j.williams@intel.com" , "linux-nvdimm@lists.01.org" CC: "dm-devel@redhat.com" , "linux-kernel@vger.kernel.org" , "viro@zeniv.linux.org.uk" , "hch@lst.de" , "x86@kernel.org" , "snitzer@redhat.com" , "linux-fsdevel@vger.kernel.org" Subject: Re: [PATCH v3 02/14] dm: add ->copy_from_iter() dax operation support Thread-Topic: [PATCH v3 02/14] dm: add ->copy_from_iter() dax operation support Thread-Index: AQHS4V9NuqSfayrQ902LcK7VpNo0cqIlHq6AgAAJwIA= Date: Thu, 15 Jun 2017 01:21:08 +0000 Message-ID: <1497489635.9288.18.camel@hpe.com> References: <149703982465.20620.14881139332926778446.stgit@dwillia2-desk3.amr.corp.intel.com> <149703983692.20620.3787021839815275819.stgit@dwillia2-desk3.amr.corp.intel.com> <1497487541.9288.16.camel@hpe.com> In-Reply-To: <1497487541.9288.16.camel@hpe.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=hpe.com; x-originating-ip: [15.211.195.8] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DF4PR84MB0106;7:bCdRhRd5We16L86cGeoBJJBGoHgTVj0rDMo9Dah3nY0UrcdKarAIo0za7OQks2jfqtxu3s+1v1LV7FGXQfuW9MNtMu7HGWxdYn4WVvctFAvRthPEZSrwRyJslWNqtP5RCwAH0e+Nxh/gpcnWsTTWsbQncf35U5Gnv0Qz50AAGsdTY02x/4qoNBl1uePC2FmeXLFpHLX0RSDTgzINrpDHUb2Np6RMh6KqEyUZW9ojLqyxJeNHoYe1exDCfJ9a92BziYQJ76P8I7WhPkVUFudBxT6YIjFQDcIQr1X7c9IVhDzVskkVUA89HaqrSf6nmXhK5u5ffp8s53wwgW4H6oeKIg== x-ms-traffictypediagnostic: DF4PR84MB0106: x-ms-office365-filtering-correlation-id: eb4a9121-c8dd-4adf-1d21-08d4b38cccf4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:DF4PR84MB0106; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DF4PR84MB0106;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DF4PR84MB0106; x-forefront-prvs: 0339F89554 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39450400003)(39840400002)(39860400002)(39850400002)(39400400002)(39410400002)(24454002)(377424004)(6246003)(53936002)(478600001)(76176999)(54356999)(6436002)(6512007)(103116003)(54906002)(3660700001)(3280700002)(25786009)(6506006)(77096006)(2906002)(14454004)(2950100002)(66066001)(122556002)(6486002)(229853002)(2501003)(36756003)(2900100001)(6116002)(3846002)(305945005)(86362001)(189998001)(50986999)(5660300001)(38730400002)(102836003)(4326008)(81166006)(33646002)(8676002)(7736002)(8936002);DIR:OUT;SFP:1102;SCL:1;SRVR:DF4PR84MB0106;H:DF4PR84MB0105.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jun 2017 01:21:08.0801 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR84MB0106 X-OriginatorOrg: hpe.com 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 v5F1LIDc021589 Content-Length: 2086 Lines: 42 On Wed, 2017-06-14 at 18:45 -0600, Toshi Kani wrote: > On Fri, 2017-06-09 at 13:23 -0700, Dan Williams wrote: > > Allow device-mapper to route copy_from_iter operations to the > > per-target implementation. In order for the device stacking to work > > we need a dax_dev and a pgoff relative to that device. This gives > > each layer of the stack the information it needs to look up the > > operation pointer for the next level. > > > > This conceptually allows for an array of mixed device drivers with > > varying copy_from_iter implementations. > > > > Cc: Toshi Kani > > Reviewed-by: Mike Snitzer > > Signed-off-by: Dan Williams > > I was worried about possible overhead with additional stub calls, but > it looks fine with a single thread fio write test with direct=1. > >  92.62%  [kernel.kallsyms]   [k] __copy_user_nocache >   0.04%  [kernel.kallsyms]   [k] entry_SYSCALL_64_fastpath >   0.08%  libpthread-2.22.so  [.] __GI___libc_write >   0.01%  [kernel.kallsyms]   [k] sys_write >   0.02%  [kernel.kallsyms]   [k] vfs_write >   0.02%  [kernel.kallsyms]   [k] __vfs_write >   0.02%  [kernel.kallsyms]   [k] ext4_file_write_iter >   0.02%  [kernel.kallsyms]   [k] dax_iomap_rw >   0.03%  [kernel.kallsyms]   [k] iomap_apply >   0.04%  [kernel.kallsyms]   [k] dax_iomap_actor >   0.01%  [kernel.kallsyms]   [k] dax_copy_from_iter >   0.01%  [kernel.kallsyms]   [k] dm_dax_copy_from_iter >   0.01%  [kernel.kallsyms]   [k] linear_dax_copy_from_iter >   0.03%  [kernel.kallsyms]   [k] copy_from_iter_flushcache >   0.00%  [kernel.kallsyms]   [k] pmem_copy_from_iter I had bs=256k, which was too big for this test. bs=4k result is not this pretty at all, only 23% in __copy_user_nocache. This change accounts for approx. 1% with 4k. Given we have larger overheads in many other functions in the path, the change looks acceptable (I keep my review-by). I'd prefer to reduce code in the path, though. Thanks, -Toshi