From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122234 invoked by alias); 24 Feb 2016 19:50:21 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 122175 invoked by uid 89); 24 Feb 2016 19:50:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=psymtab, Hx-languages-length:1816, H*f:sk:87lh6a6, chunks X-HELO: gproxy8-pub.mail.unifiedlayer.com Received: from gproxy8-pub.mail.unifiedlayer.com (HELO gproxy8-pub.mail.unifiedlayer.com) (67.222.33.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Wed, 24 Feb 2016 19:50:19 +0000 Received: (qmail 2454 invoked by uid 0); 24 Feb 2016 19:50:16 -0000 Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy8.mail.unifiedlayer.com with SMTP; 24 Feb 2016 19:50:16 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id NKqC1s00C2f2jeq01KqFaP; Wed, 24 Feb 2016 12:50:16 -0700 X-Authority-Analysis: v=2.1 cv=FouWoQbq c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=PnD2wP_eR3oA:10 a=ezDAll7g0wUA:10 a=jFJIQSaiL_oA:10 a=DBFum8z0lFVzQOYwX0UA:9 a=9Ks_zYhAIaidtxaW:21 a=65XsJqkszPmWclBi:21 Received: from [71.218.200.158] (port=35428 helo=pokyo) by box522.bluehost.com with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1aYfRr-000166-OH; Wed, 24 Feb 2016 12:50:11 -0700 From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , Pedro Alves , gdb@sourceware.org Subject: Re: Multi-threaded dwarf parsing References: <2c38d5c574de28faa9fc94fe4ed17d45@simark.ca> <56CD8EC0.3010304@redhat.com> <87lh6a6s8s.fsf@tromey.com> Date: Wed, 24 Feb 2016 19:50:00 -0000 In-Reply-To: (Simon Marchi's message of "Wed, 24 Feb 2016 11:43:03 -0500") Message-ID: <87d1rl7us0.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 71.218.200.158 authed with tom+tromey.com} X-SW-Source: 2016-02/txt/msg00024.txt.bz2 Simon> Just to make sure I understand correctly: instead of blocking on Simon> the psymtabs creation at startup (in elf_symfile_read), you Simon> offload that to worker threads and carry on. If you happen to Simon> need the information and it's not ready yet, then the main code Simon> will have to block until the corresponding task is complete Simon> (dwarf2_require_psymtabs). That's correct. Simon> However, in each worker thread, each objfile is still processed Simon> sequentially. So if you are waiting for libxul.so's debug info Simon> to be ready (such as in #1), it won't be ready any faster. Is Simon> that right? Yes, each task constructs the psymtabs for an entire objfile. Simon> My view of the parallelism was that when reading an objfile's Simon> debug info, the main thread would offload chunks of work (a chunk Simon> == a CU) to the worker threads, but wait for all of them to be Simon> done before continuing. So it would still be blocking on the Simon> psymtab creation, but it would block for a shorter time (divided Simon> by the number of threads/cores, in an ideal world). It's just Simon> replacing a serial algorithm by a parallel one, but it would be Simon> mostly transparent to the rest of gdb. Yeah. This sounds doable in the abstract; though of course details matter. The DWARF reader has a lot of per-objfile state that would have to be split up (ideally) or locked. And there is stuff like buildsym.h, which is full of globals for no good reason. Simon> I hadn't thought of reading the info in the background, but I Simon> like the fact that it can get the user to a prompt faster. And I Simon> think these two forms of parallelism are not mutually exclusive, Simon> we could very well read CUs in parallel, in the background. I agree. Tom