From: Sasha Levin <sasha.levin@oracle.com>
To: Peter Zijlstra <peterz@infradead.org>,
mingo@kernel.org, alexander.shishkin@linux.intel.com,
eranian@google.com
Cc: linux-kernel@vger.kernel.org, vince@deater.net,
dvyukov@google.com, andi@firstfloor.org, jolsa@redhat.com
Subject: Re: [RFC][PATCH 12/12] perf: Collapse and fix event_function_call() users
Date: Wed, 17 Feb 2016 17:38:43 -0500 [thread overview]
Message-ID: <56C4F673.40600@oracle.com> (raw)
In-Reply-To: <20160111163229.411314288@infradead.org>
On 01/11/2016 11:25 AM, Peter Zijlstra wrote:
> There is one common bug left in all the event_function_call() users,
> between loading ctx->task and getting to the remote_function(),
> ctx->task can already have been changed.
>
> Therefore we need to double check and retry if ctx->task != current.
>
> Insert another trampoline specific to event_function_call() that
> checks for this and further validates state. This also allows getting
> rid of the active/inactive functions.
>
>
> Note: Stephane, can you please look at __perf_event_enable()?
>
> Cc: Stephane Eranian <eranian@google.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Hey Peter,
I seem to be hitting a warning added by this patch:
[ 258.890172] WARNING: CPU: 5 PID: 14801 at kernel/events/core.c:226 event_function+0x3a7/0x550()
[ 258.891356] Modules linked in:[ 258.892440] CPU: 5 PID: 14801 Comm: syz-executor Not tainted 4.5.0-rc4-next-20160217-sasha-00024-g888c008-dirty #2976
[ 258.893818] 1ffff1006c57bf07 ffff880362bdf8c0 ffffffffa43d511d ffffffff00000005
[ 258.895071] fffffbfff60265b8 0000000041b58ab3 ffffffffafb1d490 ffffffffa43d4f85
[ 258.896127] ffffffffa25984c0 0000000000000038 0000000000000282 ffff880362bdf898
[ 258.897182] Call Trace:
[ 258.897559] [<ffffffffa43d511d>] dump_stack+0x198/0x21b
[ 258.898258] [<ffffffffa43d4f85>] ? arch_local_irq_restore+0x5f/0x5f
[ 258.899099] [<ffffffffa25984c0>] ? is_module_text_address+0x20/0x20
[ 258.899934] [<ffffffffa23a6851>] warn_slowpath_common+0xe1/0x160
[ 258.900723] [<ffffffffa268cf07>] ? event_function+0x3a7/0x550
[ 258.901473] [<ffffffffa23a6a99>] warn_slowpath_null+0x29/0x30
[ 258.902186] [<ffffffffa268cf07>] event_function+0x3a7/0x550
[ 258.902913] [<ffffffffa268cb60>] ? perf_event_read_event+0x3c0/0x3c0
[ 258.906328] [<ffffffffa267d7a0>] ? free_ctx+0x70/0x70
[ 258.907633] [<ffffffffa267d8ea>] remote_function+0x14a/0x200
[ 258.908776] [<ffffffffa2582cb8>] generic_exec_single+0x2e8/0x5a0
[ 258.913186] [<ffffffffa258314d>] smp_call_function_single+0x1dd/0x350
[ 258.917536] [<ffffffffa267bc83>] task_function_call+0x123/0x160
[ 258.938733] [<ffffffffa267dbdb>] event_function_call+0x23b/0x440
[ 258.949427] [<ffffffffa267df7f>] _perf_event_enable+0xbf/0x100
[ 258.952368] [<ffffffffa267e04c>] _perf_event_refresh+0x8c/0xd0
[ 258.953776] [<ffffffffa26aa49f>] perf_ioctl+0x2af/0x870
[ 258.963056] [<ffffffffa28fcc60>] do_vfs_ioctl+0x1b0/0x1250
[ 258.975817] [<ffffffffa28fdd8f>] SyS_ioctl+0x8f/0xc0
[ 258.976277] [<ffffffffad5c96c0>] entry_SYSCALL_64_fastpath+0x23/0xc1
Thanks,
Sasha
next prev parent reply other threads:[~2016-02-17 22:40 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-11 16:24 [RFC][PATCH 00/12] various perf fixes Peter Zijlstra
2016-01-11 16:24 ` [RFC][PATCH 01/12] perf: Add lockdep assertions Peter Zijlstra
2016-01-11 16:25 ` [RFC][PATCH 02/12] perf: Fix cgroup event scheduling Peter Zijlstra
2016-01-11 19:43 ` Stephane Eranian
2016-01-11 22:03 ` Peter Zijlstra
2016-01-11 16:25 ` [RFC][PATCH 03/12] perf: Fix cgroup scheduling in enable_on_exec Peter Zijlstra
2016-01-11 16:25 ` [RFC][PATCH 04/12] perf: Remove stale comment Peter Zijlstra
2016-01-11 16:25 ` [RFC][PATCH 05/12] perf: Fix enable_on_exec event scheduling Peter Zijlstra
2016-01-11 16:25 ` [RFC][PATCH 06/12] perf: Use task_ctx_sched_out() Peter Zijlstra
2016-01-11 16:25 ` [RFC][PATCH 07/12] perf: Simplify/fix perf_event_enable() event scheduling Peter Zijlstra
2016-03-08 10:04 ` James Morse
2016-03-08 10:26 ` Peter Zijlstra
2016-03-08 10:42 ` James Morse
2016-03-08 11:29 ` Peter Zijlstra
2016-01-11 16:25 ` [RFC][PATCH 08/12] perf: Optimize perf_sched_events usage Peter Zijlstra
2016-01-11 16:25 ` [RFC][PATCH 09/12] perf: Make ctx->is_active and cpuctx->task_ctx consistent Peter Zijlstra
2016-01-11 16:25 ` [RFC][PATCH 10/12] perf: Fix task context scheduling Peter Zijlstra
2016-01-11 16:25 ` [RFC][PATCH 11/12] perf: Specialize perf_event_exit_task() Peter Zijlstra
2016-01-11 16:25 ` [RFC][PATCH 12/12] perf: Collapse and fix event_function_call() users Peter Zijlstra
2016-01-13 10:50 ` Peter Zijlstra
2016-01-13 13:46 ` Alexander Shishkin
2016-01-13 17:30 ` Peter Zijlstra
2016-01-13 15:00 ` Alexander Shishkin
2016-01-13 15:38 ` Alexander Shishkin
2016-01-13 18:10 ` Peter Zijlstra
2016-01-13 20:44 ` Peter Zijlstra
2016-01-14 10:44 ` Peter Zijlstra
2016-01-14 16:30 ` Peter Zijlstra
2016-02-17 22:38 ` Sasha Levin [this message]
2016-02-18 7:46 ` Peter Zijlstra
2016-02-18 12:37 ` Peter Zijlstra
2016-01-11 18:44 ` [RFC][PATCH 00/12] various perf fixes Dmitry Vyukov
2016-01-11 19:56 ` Andi Kleen
2016-01-11 22:00 ` Peter Zijlstra
2016-01-12 9:59 ` Ingo Molnar
2016-01-12 10:11 ` Ingo Molnar
2016-01-12 10:57 ` Dmitry Vyukov
2016-01-12 11:00 ` Dmitry Vyukov
2016-01-12 11:01 ` Dmitry Vyukov
2016-01-12 11:26 ` Dmitry Vyukov
2016-01-12 11:35 ` Dmitry Vyukov
2016-01-12 12:01 ` Peter Zijlstra
2016-01-13 15:18 ` Alexander Shishkin
2016-01-13 15:22 ` Dmitry Vyukov
2016-01-13 15:35 ` Alexander Shishkin
2016-01-14 9:35 ` Peter Zijlstra
2016-01-14 10:05 ` Dmitry Vyukov
2016-02-15 15:04 ` Dmitry Vyukov
2016-02-15 15:38 ` Peter Zijlstra
2016-02-15 15:47 ` Dmitry Vyukov
2016-02-15 16:01 ` Vince Weaver
2016-02-15 16:17 ` Peter Zijlstra
2016-02-15 16:29 ` Dmitry Vyukov
2016-02-15 16:29 ` Peter Zijlstra
2016-02-15 16:35 ` Dmitry Vyukov
2016-02-15 16:38 ` Dmitry Vyukov
2016-02-15 16:52 ` Peter Zijlstra
2016-02-15 17:04 ` Dmitry Vyukov
2016-02-15 17:07 ` Peter Zijlstra
2016-02-15 17:45 ` Dmitry Vyukov
2016-02-15 18:01 ` Peter Zijlstra
2016-02-15 18:33 ` Dmitry Vyukov
2016-02-15 16:41 ` Peter Zijlstra
2016-02-15 16:54 ` Dmitry Vyukov
2016-02-15 16:59 ` Peter Zijlstra
2016-01-12 13:13 ` Peter Zijlstra
2016-01-12 13:31 ` Ingo Molnar
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=56C4F673.40600@oracle.com \
--to=sasha.levin@oracle.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=dvyukov@google.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=vince@deater.net \
/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;
as well as URLs for NNTP newsgroup(s).