]> git.baikalelectronics.ru Git - kernel.git/commit
perf: Fix fasync handling on inherited events
authorPeter Zijlstra <peterz@infradead.org>
Thu, 11 Jun 2015 08:32:01 +0000 (10:32 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 4 Aug 2015 07:57:52 +0000 (09:57 +0200)
commitbc39a5429725b294f122a10f1c328ab3d1b855a5
treecc275577a4a4e9e2cc44fd6df67b36f022b654c1
parentc48898663321363138eb6b7b325046b8c81707e0
perf: Fix fasync handling on inherited events

Vince reported that the fasync signal stuff doesn't work proper for
inherited events. So fix that.

Installing fasync allocates memory and sets filp->f_flags |= FASYNC,
which upon the demise of the file descriptor ensures the allocation is
freed and state is updated.

Now for perf, we can have the events stick around for a while after the
original FD is dead because of references from child events. So we
cannot copy the fasync pointer around. We can however consistently use
the parent's fasync, as that will be updated.

Reported-and-Tested-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Cc: Arnaldo Carvalho deMelo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: eranian@google.com
Link: http://lkml.kernel.org/r/1434011521.1495.71.camel@twins
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c