From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754025AbbCaAqa (ORCPT ); Mon, 30 Mar 2015 20:46:30 -0400 Received: from casper.infradead.org ([85.118.1.10]:38796 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753932AbbCaAq2 (ORCPT ); Mon, 30 Mar 2015 20:46:28 -0400 Date: Mon, 30 Mar 2015 21:46:35 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Jiri Olsa , David Ahern , Jiri Olsa , Stephane Eranian , LKML Subject: Re: [BUG] segfault in perf-top -- thread refcnt Message-ID: <20150331004635.GB9438@kernel.org> References: <20150327201126.GM21510@kernel.org> <5515B9E6.5020007@gmail.com> <20150330080737.GD1413@krava> <20150330102220.GE1413@krava> <20150330112108.GG1413@krava> <20150330114907.GH1413@krava> <20150330124852.GA4507@danjae.kornet> <20150330145805.GC32560@kernel.org> <20150330151303.GD32560@kernel.org> <20150331002730.GE32033@sejong> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150331002730.GE32033@sejong> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Mar 31, 2015 at 09:27:30AM +0900, Namhyung Kim escreveu: > On Mon, Mar 30, 2015 at 12:13:03PM -0300, Arnaldo Carvalho de Melo wrote: > > Em Mon, Mar 30, 2015 at 11:58:05AM -0300, Arnaldo Carvalho de Melo escreveu: > > > Em Mon, Mar 30, 2015 at 09:48:52PM +0900, Namhyung Kim escreveu: > > > > But this makes every sample processing grabs and releases the lock so > > > > might cause high overhead. It can be a problem if such processing is > > > > done parallelly like my multi-thread work. :-/ > > > > > > Still untested, using rw lock, next step is auditing the > > > machine__findnew_thread users that really should be using > > > machine__find_thread, i.e. grabbing just the reader lock, and measuring > > > the overhead of using a pthread rw lock instead of pthread_mutex_t as > > > Jiri is doing. > > > > Don't bother trying it, doesn't even compile ;-\ > > OK. :) > > But I think rw lock still has not-so-low overhead as it involves > atomic operations and cache misses. But we will have to serialize access to the data structure at some point... - Arnaldo