Skip to content

Commit

Permalink
perf_counter: use list_move_tail()
Browse files Browse the repository at this point in the history
Instead of del/add use a move list-op.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 6, 2009
1 parent 595258a commit 7556423
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ list_del_counter(struct perf_counter *counter, struct perf_counter_context *ctx)
list_for_each_entry_safe(sibling, tmp,
&counter->sibling_list, list_entry) {

list_del_init(&sibling->list_entry);
list_add_tail(&sibling->list_entry, &ctx->counter_list);
list_move_tail(&sibling->list_entry, &ctx->counter_list);
sibling->group_leader = sibling;
}
}
Expand Down Expand Up @@ -959,8 +958,7 @@ static void rotate_ctx(struct perf_counter_context *ctx)
*/
perf_flags = hw_perf_save_disable();
list_for_each_entry(counter, &ctx->counter_list, list_entry) {
list_del(&counter->list_entry);
list_add_tail(&counter->list_entry, &ctx->counter_list);
list_move_tail(&counter->list_entry, &ctx->counter_list);
break;
}
hw_perf_restore(perf_flags);
Expand Down

0 comments on commit 7556423

Please sign in to comment.