[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37D7C6CF3E00A74B8858931C1DB2F077537C389A@SHSMSX103.ccr.corp.intel.com>
Date: Mon, 18 Sep 2017 16:18:26 +0000
From: "Liang, Kan" <kan.liang@...el.com>
To: Jiri Olsa <jolsa@...hat.com>
CC: "acme@...nel.org" <acme@...nel.org>,
"peterz@...radead.org" <peterz@...radead.org>,
"mingo@...hat.com" <mingo@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"jolsa@...nel.org" <jolsa@...nel.org>,
"namhyung@...nel.org" <namhyung@...nel.org>,
"Hunter, Adrian" <adrian.hunter@...el.com>,
"Odzioba, Lukasz" <lukasz.odzioba@...el.com>,
"ak@...ux.intel.com" <ak@...ux.intel.com>
Subject: RE: [PATCH RFC V2 05/10] perf tools: lock to protect thread list
>
> 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?
I also wanted to protect
*dev = ns ? ns->link_info[CGROUP_NS_INDEX].dev : 0;
*ino = ns ? ns->link_info[CGROUP_NS_INDEX].ino : 0;
Because I was not sure if ns is still accurate when we try to use
it later.
But for our case (perf top event synthesizing), it looks I worried too much.
Namespaces event isn't processed at all.
So yes, we don't need patch 4 for the optimization.
Based on the same reason, I used comm_str in patch 3.
It's not help for the optimization either, but should be useful for future.
Anyway, I think I will drop patch 3 & 4 for V3.
Thanks,
Kan
>
> if that's the case we don't need the change for __hists__add_entry in
> previous patch
>
> jirka
Powered by blists - more mailing lists