All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: David Ahern <dsahern@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Don Zickus <dzickus@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Mike Galbraith <efault@gmx.de>,
	Namhyung Kim <namhyung@kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 3/5] perf tools: Reference count map_groups objects
Date: Tue, 15 Apr 2014 11:56:58 +0200	[thread overview]
Message-ID: <20140415095657.GC1700@krava.brq.redhat.com> (raw)
In-Reply-To: <534C193A.2000806@gmail.com>

On Mon, Apr 14, 2014 at 11:22:02AM -0600, David Ahern wrote:
> On 4/14/14, 9:52 AM, Jiri Olsa wrote:

SNIP

> >
> >+void map_groups__put(struct map_groups *mg)
> >+{
> >+	if (--mg->refcnt == 0)
> >+		map_groups__delete(mg);
> >+}
> >+
> >  void map_groups__flush(struct map_groups *mg)
> >  {
> >  	int type;
> >diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
> >index 1073e2d..d6445b2 100644
> >--- a/tools/perf/util/map.h
> >+++ b/tools/perf/util/map.h
> >@@ -59,11 +59,20 @@ struct map_groups {
> >  	struct rb_root	 maps[MAP__NR_TYPES];
> >  	struct list_head removed_maps[MAP__NR_TYPES];
> >  	struct machine	 *machine;
> >+	int		 refcnt;
> >  };
> 
> 
> atomic for refcnt? This is part of a libperf; would be good to
> support multithreaded users.

hum.. I think using atomic type is not enough, we'd need
to make map_groups__put/get atomic as well

not sure what's the support in user space for that.. will check

also not to be negative, but libperf is not thread safe anyway, right? ;-)

thanks,
jirka

  reply	other threads:[~2014-04-15  9:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-14 15:51 [PATCHv2 0/5] perf tools: Share map groups within process Jiri Olsa
2014-04-14 15:51 ` [PATCH 1/5] perf tests: Add thread maps lookup automated tests Jiri Olsa
2014-04-29  6:46   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-04-14 15:52 ` [PATCH 2/5] perf tools: Allocate thread map_groups's dynamically Jiri Olsa
2014-04-29  6:46   ` [tip:perf/core] perf tools: Allocate thread map_groups' s dynamically tip-bot for Arnaldo Carvalho de Melo
2014-04-14 15:52 ` [PATCH 3/5] perf tools: Reference count map_groups objects Jiri Olsa
2014-04-14 17:22   ` David Ahern
2014-04-15  9:56     ` Jiri Olsa [this message]
2014-04-15 18:17       ` David Ahern
2014-04-23 16:31         ` Jiri Olsa
2014-04-23 16:45           ` David Ahern
2014-04-29  6:46   ` [tip:perf/core] " tip-bot for Arnaldo Carvalho de Melo
2014-04-14 15:52 ` [PATCH 4/5] perf tools: Share map_groups among threads of the same group Jiri Olsa
2014-04-29  6:46   ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-04-14 15:52 ` [PATCH 5/5] perf tests: Add map groups sharing with thread object test Jiri Olsa
2014-04-24 14:29   ` Namhyung Kim
2014-04-29  6:46   ` [tip:perf/core] " tip-bot for Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140415095657.GC1700@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=dzickus@redhat.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.