lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140415095657.GC1700@krava.brq.redhat.com>
Date:	Tue, 15 Apr 2014 11:56:58 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	David Ahern <dsahern@...il.com>
Cc:	linux-kernel@...r.kernel.org,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Don Zickus <dzickus@...hat.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Mike Galbraith <efault@....de>,
	Namhyung Kim <namhyung@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 3/5] perf tools: Reference count map_groups objects

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ