From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751483AbdFAGKo (ORCPT ); Thu, 1 Jun 2017 02:10:44 -0400 Received: from mail-bn3nam01on0061.outbound.protection.outlook.com ([104.47.33.61]:48603 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751093AbdFAGKm (ORCPT ); Thu, 1 Jun 2017 02:10:42 -0400 From: "Pinski, Andrew" To: Will Deacon CC: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "Norov, Yuri" , "catalin.marinas@arm.com" , "nathan_lynch@mentor.com" , "kevin.brodsky@arm.com" , "dave.martin@arm.com" , "john.stultz@linaro.org" , "arnd@arndb.de" Subject: RE: [PATCHv2 1/2] arm64:vdso: Rewrite gettimeofday into C. Thread-Topic: [PATCHv2 1/2] arm64:vdso: Rewrite gettimeofday into C. Thread-Index: AQHS2aWryniAhYZQdEm9cULdVjVdaqIOY/8AgAEiHYA= Date: Thu, 1 Jun 2017 06:10:37 +0000 Message-ID: References: <1496190860-5116-1-git-send-email-apinski@cavium.com> <20170531124430.GG9723@arm.com> In-Reply-To: <20170531124430.GG9723@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=cavium.com; x-originating-ip: [2602:306:cc9b:a150:25e4:aefd:d195:477f] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0701MB1269;7:RdDkg1B+z1SiyEd2KvhEAuaMSjV9Za5uy4nyuzHxam4gRvZasI1+91ZQRzi7YMlatXmUs5n4cjp56ZciBlG6l86lRVWS4471d4V6/+qX+6EZ4ezo0kc8FLnbkV8qeBXcU0m9hHUBqn2oATZ0boBcrAXGe3NMLo43VwXhS4yDoe+G0GuE0RBExmg/3rgSURsG5oi/ovjnFmc9wf4Y6fOxTqDKe0aGVhXc6923hIOq7df/WnIvUZufm/3lP3H6sNVHJwyyFXN98wscpPgudsI9SJ6W+rI5FDPykXPK7XIHGU7LPHn+qzCyZekMlCKcIcBmkkXRtfn7nIAetsS1jreXIA== x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(39840400002)(39450400003)(39410400002)(39850400002)(39400400002)(24454002)(13464003)(377454003)(25786009)(54356999)(76176999)(50986999)(54906002)(966005)(8936002)(6306002)(4326008)(99286003)(9686003)(72206003)(478600001)(55016002)(81166006)(122556002)(305945005)(229853002)(8676002)(6436002)(6506006)(5660300001)(74316002)(77096006)(2906002)(3280700002)(110136004)(6916009)(6246003)(2950100002)(189998001)(86362001)(102836003)(38730400002)(3660700001)(2900100001)(7696004)(14454004)(53936002)(33656002)(6116002)(7736002)(53546009);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1269;H:CY4PR07MB3415.namprd07.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; x-ms-traffictypediagnostic: BY1PR0701MB1269: x-ms-office365-filtering-correlation-id: 1eba2556-ed96-4ace-c73e-08d4a8b4ec88 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(201703131423075)(201703031133081);SRVR:BY1PR0701MB1269; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(9452136761055)(258649278758335)(42068640409301); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700084)(100105000095)(100000701084)(100105300095)(100000702084)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703084)(100105400095)(10201501046)(3002001)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123558100)(20161123564025)(6072148)(100000704084)(100105200095)(100000705084)(100105500095);SRVR:BY1PR0701MB1269;BCL:0;PCL:0;RULEID:(100000800084)(100110000095)(100000801084)(100110300095)(100000802084)(100110100095)(100000803084)(100110400095)(100000804084)(100110200095)(100000805084)(100110500095);SRVR:BY1PR0701MB1269; x-forefront-prvs: 0325F6C77B spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jun 2017 06:10:38.0237 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1269 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 quoted-printable to 8bit by mail.home.local id v516Anau016042 > -----Original Message----- > From: Will Deacon [mailto:will.deacon@arm.com] > Sent: Wednesday, May 31, 2017 5:45 AM > To: Pinski, Andrew > Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; > Norov, Yuri ; catalin.marinas@arm.com; > nathan_lynch@mentor.com; kevin.brodsky@arm.com; dave.martin@arm.com; > john.stultz@linaro.org; arnd@arndb.de > Subject: Re: [PATCHv2 1/2] arm64:vdso: Rewrite gettimeofday into C. > > Hi Andrew, > > Thanks for posting this, but please try to cc the maintainers in future -- > I almost missed it! Oh sorry; I didn't know when I am supposed to CC the maintainers or not. Different project, different rules. > > On Tue, May 30, 2017 at 05:34:19PM -0700, Andrew Pinski wrote: > > This allows the compiler to optimize the divide by 1000. > > And remove the other divide. > > > > On ThunderX, gettimeofday improves by 32%. On ThunderX 2, > > gettimeofday improves by 18%. > > > > Note I noticed a bug in the old implementation of > > __kernel_clock_getres; it was checking only the lower 32bits of the > > pointer; this would work for most cases but could fail in a few. > > > > Changes from v1: > > * Fixed bug in __kernel_clock_getres for checking the pointer argument. > > * Fix comments to refer to functions in arm64. > > I tested this patch on a few platforms I have access to and didn't see the > perf regressions I saw when I looked at this in the past with an older > toolchain (it was mostly about the same, with a couple of improvements). > > So, in principle, I'm not opposed to moving this into C. However, we're > currently close to a "vDSO-explosion" on arm64 with people wanting a compat > variant and also an ILP32 variant. When Kevin posted his compat variant > (also in C): > > http://lkml.kernel.org/r/20161206160353.14581-1-kevin.brodsky@arm.com > > Nathan (who apparently needs to set his mail host address ;) was concerned > about duplication between arm and arm64: > > http://lkml.kernel.org/r/87r35jmv3e.fsf@wedge.i-did-not-set--mail-host- > address--so-tickle-me > > I'm firmly of the opinion that we should try to write an arch-agnostic vDSO > implementation in core code (lib/vdso or something) where the arch header > provides things like: > > * The mechanism to read the counter > * The mechanism to issue a syscall > * A function to determine whether or not the current clocksource is > suitable > > I think the datapage format could be defined in core code and it would be > worth looking to see how much the virtual mapping code can be consolidated > too. > > If we can get something that works for arm native, arm64 native, arm64 > compat and arm64 ilp32 then it's probably going to be useful for other > architectures too, even if we need to add more customisation points in > future. To share code between the three vdso is a good goal and shouldn't be a hard to expand my patch to handle the arm compat vdso. To expand it to the arm native code shouldn't be too hard. The main thing is add a few #ifdef/#define in a header. I will try to do that but I don't know when I will be able to finish it. Thanks, Andrew > > I've spoken to Kevin about this, but I'm not sure whether he's had a chance > to look at knocking up a prototype. A first stab could just unconditionally > fallback to the system call. > > Will