Skip to content

Commit

Permalink
perf_event: Clean up perf_event_init_task()
Browse files Browse the repository at this point in the history
While at it: we can traverse ctx->group_list to get all
group leader, it should be safe since we hold ctx->mutex.

Changlog v1->v2:

  - remove WARN_ON_ONCE() according to Peter Zijlstra's suggestion

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <4ABC5AF9.6060808@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Xiao Guangrong authored and Ingo Molnar committed Oct 1, 2009
1 parent 8c9ed8e commit 27f9994
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -4767,9 +4767,7 @@ int perf_event_init_task(struct task_struct *child)
* We dont have to disable NMIs - we are only looking at
* the list, not manipulating it:
*/
list_for_each_entry_rcu(event, &parent_ctx->event_list, event_entry) {
if (event != event->group_leader)
continue;
list_for_each_entry(event, &parent_ctx->group_list, group_entry) {

if (!event->attr.inherit) {
inherited_all = 0;
Expand Down

0 comments on commit 27f9994

Please sign in to comment.