From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98036 invoked by alias); 31 May 2019 17:13:31 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 98027 invoked by uid 89); 31 May 2019 17:13:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mailsec118.isp.belgacom.be Received: from mailsec118.isp.belgacom.be (HELO mailsec118.isp.belgacom.be) (195.238.20.114) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 31 May 2019 17:13:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1559322808; x=1590858808; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=9yGhVm1EA/kjYhfhJe9YTUor9Iv2fqcCi83F8zV6VtU=; b=P6K9pP7yoQn580vv7WyUZeXTh4ckLnP5jl85vvHpLIQwlMEaTPzL5/8D 2ceqRbAjb0jhEoRGWIptjqs9f1bLOA==; Received: from 161.32-242-81.adsl-dyn.isp.belgacom.be (HELO md) ([81.242.32.161]) by relay.skynet.be with ESMTP/TLS/AES256-GCM-SHA384; 31 May 2019 19:13:25 +0200 Message-ID: <1559322805.1454.45.camel@skynet.be> Subject: Re: [PATCH v2 0/8] Demangle minimal symbol names in worker threads From: Philippe Waroquiers To: Tom Tromey Cc: gdb-patches@sourceware.org Date: Fri, 31 May 2019 17:13:00 -0000 In-Reply-To: <87sgsvcpax.fsf@tromey.com> References: <20190518210010.27697-1-tom@tromey.com> <1558274338.1454.13.camel@skynet.be> <87a7figtpz.fsf@tromey.com> <87sgsvcpax.fsf@tromey.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00753.txt.bz2 On Thu, 2019-05-30 at 20:48 -0600, Tom Tromey wrote: > Tom> Locally I only saw utilization of 1.5 CPUs or so -- so, not very > Tom> parallel yet. > > I found the "mutrace" tool and it looks like the new mutex is heavily > contended. This is pretty much what I suspected, but still unfortunate. > > $ mutrace -d ./gdb -nx -batch ./gdb > [...] > Mutex # Locked Changed Cont. tot.Time[ms] avg.Time[ms] max.Time[ms] Flags > 2 3714780 45723 26425 975.514 0.000 22.141 M-.--. > > I'm not really sure what to do about it. Use lockless data structures (e.g. concurrencykit.org) ? But I am quite sure such lockless libraries/data structures will not be available on all supported GDB platforms, so it might not be very cheap to change and maintain GDB to use e.g. lockless hash tables on some platforms and some other hash tables in less common platforms. Alternatively, develop a few GDB specific lockless data structures that are protected by a mutex and/or are single threads on less common platforms ? > > I do wonder if there are many duplicates when demangling minsym names. > One idea would be to demangle in parallel and only then fill in the > table. > > A similar problem will occur when/if we want to parallelize psymbol > reading. Those use the demangle hash table, but also the bcache. (The > bcache is important, but I found recently that the demangling isn't > really needed -- the names are demangled due to the physname work, and > the demangle hash table is only used to ensure that the bcache gives > good results. Removing the demangling step here can also provide a nice > speedup...) > > Tom