Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752635AbcDJVSi (ORCPT ); Sun, 10 Apr 2016 17:18:38 -0400 Received: from smtprelay0168.hostedemail.com ([216.40.44.168]:57540 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750953AbcDJVSg (ORCPT ); Sun, 10 Apr 2016 17:18:36 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2693:2828:3138:3139:3140:3141:3142:3355:3622:3743:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:5007:6119:7903:8603:10004:10400:10848:11026:11232:11658:11783:11914:12043:12050:12438:12517:12519:12555:12740:13095:13146:13149:13161:13229:13230:13439:13894:14180:14181:14659:14721:21080:30054:30060:30064:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: food41_109ba9f3aa860 X-Filterd-Recvd-Size: 3732 Message-ID: <1460323112.1800.59.camel@perches.com> Subject: Re: [PATCH] Bluetooth: Deinline large functions From: Joe Perches To: Denys Vlasenko Cc: Denys Vlasenko , Johan Hedberg , linux-bluetooth@vger.kernel.org, Linux Kernel Mailing List Date: Sun, 10 Apr 2016 14:18:32 -0700 In-Reply-To: References: <1460305444-14159-1-git-send-email-dvlasenk@redhat.com> <1460307544.1800.53.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2650 Lines: 71 On Sun, 2016-04-10 at 19:18 +0200, Denys Vlasenko wrote: > On Sun, Apr 10, 2016 at 6:59 PM, Joe Perches wrote: > > > > On Sun, 2016-04-10 at 18:24 +0200, Denys Vlasenko wrote: > > > > > > Fastest existing Bluetooth standard's top speed is 2.4 MB/s. > > > It is way off from being CPU limited, no need to squeeze > > > last few cycles by excessive inlining. > > > > > > This patch delinlines the following functions: > > > > > > hci_conn_hash_lookup_handle: 345 bytes, 39 calls > > > hci_conn_hash_lookup_ba: 372 bytes, 36 calls > > > hci_conn_hash_lookup_le: 382 bytes, 8 calls > > > hci_conn_hash_lookup_state: 356 bytes, 3 calls > > > hci_lookup_le_connect: 378 bytes, 7 calls > > > hci_conn_drop: 186 bytes, 30 calls > > > hci_connect_cfm: 121 bytes, 15 calls > > > hci_disconn_cfm: 121 bytes, 2 calls > > > hci_auth_cfm: 156 bytes, 2 calls > > > hci_encrypt_cfm: 156 bytes, 3 calls > > > > > > Size reduction is about 40k: > > > > > > ????text?????data??????bss???????dec?????hex filename > > > 95943139 20860256 35991552 152794947 91b7743 vmlinux_before > > > 95903714 20860256 35991552 152755522 91add42 vmlinux > > Hello Denys > > > > While removing unnecessary inlines is generally a > > good thing, for extremely low power embedded systems > > like a coin-battery operated bicycle computer or a > > heart rate monitor, this might cause a throughput > > reduction. > Todays CPUs can push several GB/s over, say, Ethernet. > BT is 2.4 MB/s, tops. > Therefore total CPU time spent preparing BT I/O must be > in the 0.1% ballpark. (Meaning, if we would have a magical > infinitely fast CPU, throughput would possibly increase > by about 0.1%). How much do you think this deinlining patch > can possibly hurt here? Today's extremely low power ARM chips that run at a couple dozen MHz cannot push gigabit speeds. > > Can you please also show the size decrease when done > > with a defconfig with bluetooth support? > > > > And for these types of patches in general, please > > add a defconfig size reduction to the commit message. > Okay, will do in the future. > > > > > This is an x86-64 defconfig with bluetooth with and > > without this patch: > > > > $ size vmlinux.defconfig.* > > ???text????data?????bss?????dec?????hex filename > > 10214414????????4313816 1097728 15625958?????????ee6ee6 vmlinux.defconfig.new > > 10224014????????4313816 1097728 15635558?????????ee9466 vmlinux.defconfig.old > > > > ~10k total > Looks good, right? Size reductions are generally good. The one function that might be appropriate to leave inline is perhaps hci_conn_hash_lookup_handle. ?Dunno. It's be good to test though.