linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf tools: Fix lockup using 32-bit compat vdso
@ 2015-07-07 11:13 Adrian Hunter
  2015-07-07 14:05 ` Arnaldo Carvalho de Melo
  2015-07-10  8:13 ` [tip:perf/urgent] " tip-bot for Adrian Hunter
  0 siblings, 2 replies; 3+ messages in thread
From: Adrian Hunter @ 2015-07-07 11:13 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Jiri Olsa, Namhyung Kim, David Ahern

__machine__findnew_compat() is called only from
__machine__findnew_vdso_compat() which is called
only from machine__findnew_vdso() which already
holds machine->dsos.lock, so remove locking from
__machine__findnew_compat().

This manifests itself tracing 32-bit programs
with a 64-bit perf.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/util/vdso.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c
index 4b89118f158d..44d440da15dc 100644
--- a/tools/perf/util/vdso.c
+++ b/tools/perf/util/vdso.c
@@ -236,18 +236,16 @@ static struct dso *__machine__findnew_compat(struct machine *machine,
 	const char *file_name;
 	struct dso *dso;
 
-	pthread_rwlock_wrlock(&machine->dsos.lock);
 	dso = __dsos__find(&machine->dsos, vdso_file->dso_name, true);
 	if (dso)
-		goto out_unlock;
+		goto out;
 
 	file_name = vdso__get_compat_file(vdso_file);
 	if (!file_name)
-		goto out_unlock;
+		goto out;
 
 	dso = __machine__addnew_vdso(machine, vdso_file->dso_name, file_name);
-out_unlock:
-	pthread_rwlock_unlock(&machine->dsos.lock);
+out:
 	return dso;
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf tools: Fix lockup using 32-bit compat vdso
  2015-07-07 11:13 [PATCH] perf tools: Fix lockup using 32-bit compat vdso Adrian Hunter
@ 2015-07-07 14:05 ` Arnaldo Carvalho de Melo
  2015-07-10  8:13 ` [tip:perf/urgent] " tip-bot for Adrian Hunter
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-07 14:05 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: linux-kernel, Jiri Olsa, Namhyung Kim, David Ahern

Em Tue, Jul 07, 2015 at 02:13:38PM +0300, Adrian Hunter escreveu:
> __machine__findnew_compat() is called only from
> __machine__findnew_vdso_compat() which is called
> only from machine__findnew_vdso() which already
> holds machine->dsos.lock, so remove locking from
> __machine__findnew_compat().
> 
> This manifests itself tracing 32-bit programs
> with a 64-bit perf.

Thanks, applying it to my perf/urgent branch.

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/urgent] perf tools: Fix lockup using 32-bit compat vdso
  2015-07-07 11:13 [PATCH] perf tools: Fix lockup using 32-bit compat vdso Adrian Hunter
  2015-07-07 14:05 ` Arnaldo Carvalho de Melo
@ 2015-07-10  8:13 ` tip-bot for Adrian Hunter
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Adrian Hunter @ 2015-07-10  8:13 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: adrian.hunter, jolsa, mingo, hpa, acme, dsahern, linux-kernel,
	namhyung, tglx

Commit-ID:  6d545a632fbbce79492ba535b15ea0142aa3e80d
Gitweb:     http://git.kernel.org/tip/6d545a632fbbce79492ba535b15ea0142aa3e80d
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Tue, 7 Jul 2015 14:13:38 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 7 Jul 2015 11:05:08 -0300

perf tools: Fix lockup using 32-bit compat vdso

The __machine__findnew_compat() function is called only from
__machine__findnew_vdso_compat() which is called only from
machine__findnew_vdso() which already holds machine->dsos.lock, so
remove locking from __machine__findnew_compat().

This manifests itself tracing 32-bit programs with a 64-bit perf.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1436267618-20521-1-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/vdso.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c
index 4b89118..44d440d 100644
--- a/tools/perf/util/vdso.c
+++ b/tools/perf/util/vdso.c
@@ -236,18 +236,16 @@ static struct dso *__machine__findnew_compat(struct machine *machine,
 	const char *file_name;
 	struct dso *dso;
 
-	pthread_rwlock_wrlock(&machine->dsos.lock);
 	dso = __dsos__find(&machine->dsos, vdso_file->dso_name, true);
 	if (dso)
-		goto out_unlock;
+		goto out;
 
 	file_name = vdso__get_compat_file(vdso_file);
 	if (!file_name)
-		goto out_unlock;
+		goto out;
 
 	dso = __machine__addnew_vdso(machine, vdso_file->dso_name, file_name);
-out_unlock:
-	pthread_rwlock_unlock(&machine->dsos.lock);
+out:
 	return dso;
 }
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-10  8:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-07 11:13 [PATCH] perf tools: Fix lockup using 32-bit compat vdso Adrian Hunter
2015-07-07 14:05 ` Arnaldo Carvalho de Melo
2015-07-10  8:13 ` [tip:perf/urgent] " tip-bot for Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).