Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1181362

[tip:perf/urgent] perf tools: Fix lockup using 32-bit compat vdso

From tip-bot for Adrian Hunter <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:perf/urgent] perf tools: Fix lockup using 32-bit compat vdso
Date 2015-07-10 10:20 +0200
Message-ID <pKBHl-3ui-41@gated-at.bofh.it> (permalink)
References <pJz4S-4Y0-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[tip:perf/urgent] perf tools: Fix lockup using 32-bit compat vdso tip-bot for Adrian Hunter <tipbot@zytor.com> - 2015-07-10 10:20 +0200

csiph-web