From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753986AbbERMXD (ORCPT ); Mon, 18 May 2015 08:23:03 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:36255 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751288AbbERMWx (ORCPT ); Mon, 18 May 2015 08:22:53 -0400 Date: Mon, 18 May 2015 21:21:31 +0900 From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Adrian Hunter , Andi Kleen , Frederic Weisbecker , Stephane Eranian Subject: Re: [PATCH Not-for-merge 40/40] perf tools: Disable thread refcount due to bug Message-ID: <20150518122131.GA7683@danjae.kornet> References: <1431909055-21442-1-git-send-email-namhyung@kernel.org> <1431909055-21442-41-git-send-email-namhyung@kernel.org> <20150518012336.GB15972@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150518012336.GB15972@kernel.org> 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 On Sun, May 17, 2015 at 10:23:36PM -0300, Arnaldo Carvalho de Melo wrote: > Em Mon, May 18, 2015 at 09:30:55AM +0900, Namhyung Kim escreveu: > > This makes thread mg sharing test failed due to not decrement > > thread->refcnt on thread__put(). > > I fixed this one already: > > https://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/core&id=8b00f46951bed1edd9c5cb9d9adb62d28bbe7623 > > No? I meant that I added this patch not to segfault caused by the thread refcount, but as a side-effect it makes thread_mg_sharing test failed due to non-decremented refcount. As of 70923bd26c73 ("perf tools: Make flex/bison calls honour V=1") I can reproduce the segfault. Thanks, Namhyung > > > Not-signed-off-by: Namhyung Kim > > --- > > tools/perf/util/thread.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c > > index 702f12dc5a90..dc5ec9a5cca1 100644 > > --- a/tools/perf/util/thread.c > > +++ b/tools/perf/util/thread.c > > @@ -163,7 +163,7 @@ struct thread *thread__get(struct thread *thread) > > > > void thread__put(struct thread *thread) > > { > > - if (thread && atomic_dec_and_test(&thread->refcnt)) { > > + if (thread && atomic_dec_and_test(&thread->refcnt) && 0) { > > if (!RB_EMPTY_NODE(&thread->rb_node)) { > > struct machine *machine = thread->mg->machine; > > > > -- > > 2.4.0