From: "Wangnan (F)" <wangnan0@huawei.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
Ingo Molnar <mingo@kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
"Jiri Olsa" <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
David Ahern <dsahern@gmail.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
"Arnaldo Carvalho de Melo" <acme@redhat.com>
Subject: Re: [PATCH 05/16] perf test: Fix hist testcases when kptr_restrict is on
Date: Tue, 15 Dec 2015 12:03:22 +0800 [thread overview]
Message-ID: <566F910A.9010901@huawei.com> (raw)
In-Reply-To: <1450115081-22962-6-git-send-email-acme@kernel.org>
Hi,
On 2015/12/15 1:44, Arnaldo Carvalho de Melo wrote:
> From: Namhyung Kim <namhyung@kernel.org>
>
> Currently if kptr_restrict is enabled, all hist tests failed with
> segfaults. This is because machine__create_kernel_maps() in
> setup_fake_machine() failed in that situation, and it called
> machine__delete() on the error path. But outer callers again called
> machines__exit() causing double free for the host machine.
>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Link: http://lkml.kernel.org/r/1450062673-22312-1-git-send-email-namhyung@kernel.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
> tools/perf/tests/hists_common.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
I have a similar patch on this problem at [1][2].
This patch applied solves only half of the problem I seen. Although double
free is gone, in case when kptr_restrict is enabled a normal user still
gets incorrect result. For example:
$ ./perf test -v 'filtering hist entries'
25: Test filtering hist entries :
--- start ---
test child forked, pid 4186
Cannot create kernel maps
test child finished with 0
---- end ----
Test filtering hist entries: Ok
The test body doesn't get called at all. I think in this case we'd better
return 'Skip'.
I'd like to send another for it.
[1]
http://lkml.kernel.org/g/1450089563-122430-2-git-send-email-wangnan0@huawei.com
[2]
http://lkml.kernel.org/g/1449726768-79624-1-git-send-email-wangnan0@huawei.com
next prev parent reply other threads:[~2015-12-15 4:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-14 17:44 [GIT PULL 00/16] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 01/16] perf tools: Use same signal handling strategy as 'record' Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 02/16] perf test: Dump the stack when test segfaults when in verbose mode Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 03/16] perf thread: Fix reference count initial state Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 04/16] perf evsel: Disable branch flags/cycles for --callgraph lbr Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 05/16] perf test: Fix hist testcases when kptr_restrict is on Arnaldo Carvalho de Melo
2015-12-15 4:03 ` Wangnan (F) [this message]
2015-12-14 17:44 ` [PATCH 06/16] perf build: Remove unnecessary line in Makefile.feature Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 07/16] perf test: Add Build file to dependencies for llvm-src-*.c Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 08/16] perf test: Remove tarpkg at end of test Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 09/16] perf build: Fix 'make clean' Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 10/16] perf build: Rename LIB_PATH -> API_PATH Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 11/16] perf tools: Create pager.h Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 12/16] perf tools: Remove check for unused PERF_PAGER_IN_USE Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 13/16] perf tools: Move help_unknown_cmd() to its own file Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 14/16] perf tools: Convert parse-options.c internal functions to static Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 15/16] perf tools: Make options always available, even if required libs not linked Arnaldo Carvalho de Melo
2015-12-14 17:44 ` [PATCH 16/16] perf record: Support custom vmlinux path Arnaldo Carvalho de Melo
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=566F910A.9010901@huawei.com \
--to=wangnan0@huawei.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox