Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752909AbdIRIvC (ORCPT ); Mon, 18 Sep 2017 04:51:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38686 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752886AbdIRIvB (ORCPT ); Mon, 18 Sep 2017 04:51:01 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8CB1913A8F Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Mon, 18 Sep 2017 10:50:58 +0200 From: Jiri Olsa To: kan.liang@intel.com Cc: acme@kernel.org, peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org, jolsa@kernel.org, namhyung@kernel.org, adrian.hunter@intel.com, lukasz.odzioba@intel.com, ak@linux.intel.com Subject: Re: [PATCH RFC V2 05/10] perf tools: lock to protect thread list Message-ID: <20170918085058.GB17203@krava> References: <1505096603-215017-1-git-send-email-kan.liang@intel.com> <1505096603-215017-6-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1505096603-215017-6-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.9.0 (2017-09-02) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 18 Sep 2017 08:51:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 568 Lines: 24 On Sun, Sep 10, 2017 at 07:23:18PM -0700, kan.liang@intel.com wrote: SNIP > + pthread_mutex_unlock(&thread->namespaces_lock); > + > return 0; > } > > -void thread__namespaces_id(const struct thread *thread, > +void thread__namespaces_id(struct thread *thread, > u64 *dev, u64 *ino) > { > struct namespaces *ns; > > + pthread_mutex_lock(&thread->namespaces_lock); > ns = thread__namespaces(thread); isn't it just thread__namespaces that needs this lock? if that's the case we don't need the change for __hists__add_entry in previous patch jirka