diff options
author | Peter Zijlstra <peterz@infradead.org> | 2009-03-24 08:18:16 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-06 03:30:32 -0400 |
commit | c7138f37f905bb7987b1f9f5a8ee73667db39f25 (patch) | |
tree | 8d1c2bf404f1179d35e8b35b0166c7bf0b39840e /include/linux/perf_counter.h | |
parent | f66c6b2066b44d4ab8e8ac1ee4cae543738fe2ac (diff) |
perf_counter: fix perf_poll()
Impact: fix kerneltop 100% CPU usage
Only return a poll event when there's actually been one, poll_wait()
doesn't actually wait for the waitq you pass it, it only enqueues
you on it.
Only once all FDs have been iterated and none of thm returned a
poll-event will it schedule().
Also make it return POLL_HUP when there's not mmap() area to read from.
Further, fix a silly bug in the write code.
Reported-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arjan van de Ven <arjan@infradead.org>
Orig-LKML-Reference: <1237897096.24918.181.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r-- | include/linux/perf_counter.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 2b5e66d5ebdf..48212c15b7d6 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -246,6 +246,7 @@ struct file; | |||
246 | struct perf_mmap_data { | 246 | struct perf_mmap_data { |
247 | struct rcu_head rcu_head; | 247 | struct rcu_head rcu_head; |
248 | int nr_pages; | 248 | int nr_pages; |
249 | atomic_t wakeup; | ||
249 | atomic_t head; | 250 | atomic_t head; |
250 | struct perf_counter_mmap_page *user_page; | 251 | struct perf_counter_mmap_page *user_page; |
251 | void *data_pages[0]; | 252 | void *data_pages[0]; |