From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754095AbbDNUZe (ORCPT ); Tue, 14 Apr 2015 16:25:34 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:52840 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753737AbbDNUZ1 (ORCPT ); Tue, 14 Apr 2015 16:25:27 -0400 Date: Tue, 14 Apr 2015 13:24:50 -0700 From: Guenter Roeck To: Randy Dunlap Cc: Alexey Dobriyan , mmarek@suse.cz, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tags: much faster, parallel "make tags" Message-ID: <20150414202450.GA20232@roeck-us.net> References: <20150414172047.GA5641@p183.telecom.by> <552D72F5.3060404@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <552D72F5.3060404@infradead.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020204.552D77B6.02AC,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.000 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 5 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 14, 2015 at 01:05:09PM -0700, Randy Dunlap wrote: > On 04/14/15 10:20, Alexey Dobriyan wrote: > > ctags is single-threaded program. Split list of files to be tagged into > > equal parts, 1 part for each CPU and then merge the results. > > > > Speedup on one 2-way box I have is ~143 s => ~99 s (-31%). > > On another 4-way box: ~120 s => ~65 s (-46%!). > > > > Resulting "tags" files aren't byte-for-byte identical because ctags > > program numbers anon struct and enum declarations with "__anonNNN" > > symbols. If those lines are removed, "tags" file becomes byte-for-byte > > identical with those generated with current code. > > > > Signed-off-by: Alexey Dobriyan > > --- > > > > scripts/tags.sh | 34 ++++++++++++++++++++++++++++++++-- > > 1 file changed, 32 insertions(+), 2 deletions(-) > > > > --- a/scripts/tags.sh > > +++ b/scripts/tags.sh > > @@ -152,7 +152,24 @@ dogtags() > > > > exuberant() > > { > > - all_target_sources | xargs $1 -a \ > > + NR_CPUS=1 > > + if [ -e /proc/cpuinfo ]; then > > + NR_CPUS=$(grep -e '^processor : ' /proc/cpuinfo | wc -l) > > That grep is rather arch-specific. If an arch does not have that string > (with an embedded tab), won't NR_CPUS be zero? so at least, set it back to 1? > > or (if 'getconf' is installed): > NR_CPUS = `getconf _NPROCESSORS_ONLN` > What is wrong with nproc ? Guenter