From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752801AbcAUCEo (ORCPT ); Wed, 20 Jan 2016 21:04:44 -0500 Received: from eu-smtp-delivery-143.mimecast.com ([207.82.80.143]:50743 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327AbcAUCEl convert rfc822-to-8bit (ORCPT ); Wed, 20 Jan 2016 21:04:41 -0500 Date: Thu, 21 Jan 2016 10:04:11 +0800 From: Huang Shijie To: Robin Murphy CC: Joerg Roedel , , , , Subject: Re: [PATCH] iommu/arm-smmu: add a shortcut when the @dev_node is NULL Message-ID: <20160121020409.GA7792@sha-win-210.asiapac.arm.com> References: <1452564905-2662-1-git-send-email-shijie.huang@arm.com> <20160120120225.GD18805@8bytes.org> <20160120133401.GA3487@localhost.localdomain> <569F9DCA.3030808@arm.com> MIME-Version: 1.0 In-Reply-To: <569F9DCA.3030808@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [217.140.104.200] X-ClientProxiedBy: TY1PR01CA0005.jpnprd01.prod.outlook.com (25.161.131.143) To HE1PR08MB0441.eurprd08.prod.outlook.com (25.161.120.13) X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB0441;2:vw/H2lZULV+dW6a8vTnNX7yUg9F2Zfw5qadqQGEM0nV8S0V0d5TeirRPKzVVHLg2KxY0lZXIIF2a7gKf7t8oyx3eIzH0hfj3Emy/1pnI0YpMyOX49MLqHNrO+zu/hSVvMs7yA5BEdeGmKeq38vzPHg==;3:oA/u00pBaScLLyQrCEgtu/3Yviq3HUuAGHvgc561i8WqbA1WmIbQZOpzL0ZxWHDBZ/NvPH2FPWXDFATXAif//BLyIdmG8z4I2i9LfSBxCq9eAUuWB+ophWA8SkZ/m32L;25:LMERM+aGP/o9/Gg7vMaKu82UkFBt3Oqdl+24UmZediVoTmQdhuZhxLrGXN4yhNCfAMWPjy/Dk3bz/C4esOHIDS9Sx/T3cdXNYETPAEs17G11oAj3gkmkAul2y2qBYAgNKbvVtESs2Zy0jBfxbMYRT3pVVmWsCHu2UgACA89T5v6iwwnxzvNqXabH5oXBZt1h2idg7sphCeek+b5MYPoo62IyemzgtD/kVNGLbzz5AqKyCgDJZUwa94sJ2YxVvYOj;20:1D8DPKg+O87wLpXZxC0HsantXqMvE9pRWY9AicflDyRbRkqjLOeg5CmG++8uqSYXds3ATg34zuAAjZCdHLo3DMRDqDs8HyvuFDdrMcKAzYxa5fbtyEvtEufYgu4mE26GGRzjQ+74xuXbRAwRLaacJIHyD0lmrFBLuvGGRl9D14jDQ5SojvgQs5/Tz6CWnbQAoxW4BqE+ZCnTIP9AzS5lV/yU9oaN+NFAs84OlxM6rG4PUvaKIH3i8Zv2BVUHL0pK X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR08MB0441; X-MS-Office365-Filtering-Correlation-Id: 73cd3c04-0b42-4104-bbf9-08d322073711 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(10201501046)(3002001);SRVR:HE1PR08MB0441;BCL:0;PCL:0;RULEID:;SRVR:HE1PR08MB0441; X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB0441;4:3yYHEU7Eu1q4QetmUb8BOYFdzmzalVqvKyZ4e6sqUcRcCoXQpdgqcjxB9/Dv7tzkccVOL8twJprDuH0R3XuX/UbEJ5FQ+KRH2lNODtXrzG2P8ZIAiyimLHr4tdtZkOp3gpCRGcSDmU3LMhvCvNeJcbDqgqiD2XCh+E9ZyfBNON3YPQtXVo3ozfFGkup6yqqxB/mnL1b50KObLKgfIHblX+OdrSKI5CrWVqE0g3sQts9L2/9f+7TpehsdfzZW3lf+mE0HyeemEcrKD2Cjc9PdRmEsWWXVrRWjKwbtPoxWnZUCXn+m49eoAKuYeAH/aOSoSZHvEQhj2qR4TCBfsOFvqcsKWa4RVGecXIsUEE+OrR+kxr2mBxxsoqEmodO//Jzl X-Forefront-PRVS: 08286A0BE2 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(189002)(24454002)(479174004)(40434004)(199003)(23726003)(50466002)(5008740100001)(5004730100002)(6116002)(4326007)(105586002)(3846002)(1096002)(77096005)(1076002)(42186005)(92566002)(189998001)(97736004)(106356001)(2950100001)(4001350100001)(87976001)(2906002)(110136002)(46406003)(86362001)(93886004)(586003)(83506001)(66066001)(47776003)(97756001)(54356999)(40100003)(122386002)(101416001)(33656002)(76176999)(5890100001)(50986999);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR08MB0441;H:sha-win-210.asiapac.arm.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HE1PR08MB0441;23:2iV3KARg4SBm2p5qvTGQRJys8qJWSy6PkQVj/CVKZ?= =?us-ascii?Q?/l1sMvr0zUWH0uydDSJLSkeOJu582xpTiXmVzWeYSl16biBAgiKslCJssD0E?= =?us-ascii?Q?/n6zUDHZLwztIhIzYZZJiq4xjF45z5bIj3yRNgEAYA88MNPmFAOR9BFUBUXB?= =?us-ascii?Q?Nzy+ATfn+Sf5PJRFRYxDLVg6sTltDftYYSATJpPNank0tQZuhVc0pdDdxObc?= =?us-ascii?Q?AFzRXTqjJ2f97vHl9hmQNUqPL+i6OoTVC1KIy0Uk9eEG5k7Fy0EjGEisVbWR?= =?us-ascii?Q?XwndVSkRbi9K/qR/06gjziVc+y9qLLnTjj7PB9ef8ZtQ68Av//LuVh3AYvkV?= =?us-ascii?Q?LMYB4nRSo6t9xVrKQepb0XzYVM0BhKA+xm9T59vhuMngNS+hNXSuHYEu5ci/?= =?us-ascii?Q?u285nwwYEwUr9JvXdx8gdiDTS/82+RNr0Sq8JCJe871uDC2fklHdikxCVo/6?= =?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mvxKP81fxFV8QxFJxH5ndbT4E1MN0l68O5CBHXg6v+J8fq/Y26t0E=;20:RUEQx7PDKtnKyE26dXW25dAch/W+gc/j4orKHnOEd2B1LCQ2D4WkWuM7XNn161sFVs3ZAPZFBizVlGPOGWEVtuKT1+/kdRs68TX0Xad0v6AGh74s/YINmvuBg89zVM4aBpAZ4TuSQIo0HHkKaF2ok02SemjZWJTal3r0i3YI8l0= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2016 02:04:34.4958 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB0441 X-MC-Unique: Je3Cm1KtQCSVhClOR6cEjw-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2016 at 02:46:34PM +0000, Robin Murphy wrote: > On 20/01/16 13:34, Huang Shijie wrote: > >On Wed, Jan 20, 2016 at 01:02:25PM +0100, Joerg Roedel wrote: > >>On Tue, Jan 12, 2016 at 10:15:05AM +0800, Huang Shijie wrote: > >>>This patch adds a shortcut for the code when the @device_node is NULL. > >>>In my juno-r1 board, the boot time can be faster by 0.004014s. > >> > >>How have you made sure this number is reliable and not just noise in the > >>boot process? > >In the boot process, there are 5 or more modules whose @dev_node are > >NULL. Without the patch, the kernel will waste some cycles to do the > >meaningless calculations for all these modules. > > With a quick counting hack, booting 4.4 on my r1 indeed shows 5 calls where > dev_node is null. Plus 68 calls in which we waste cycles doing meaningless > calculations when dev_node is non-null. The fundamental issue at hand is The 68 calls are just compare instructions, such as "b.eq". But if the code runs to the followng branch when the @dev_node is NULL, the instructions executed will more the 68 calls (even including some read memory instructions when try to grab the locks). > that the "platform bus" is a rubbish abstraction. This is just a small trivial patch, please ignore it if we think it is no use. :) thanks Huang Shijie IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.