perf_counter: use list_move_tail()
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>
This commit is contained in:
parent
595258aaea
commit
755642322a
|
@ -89,8 +89,7 @@ list_del_counter(struct perf_counter *counter, struct perf_counter_context *ctx)
|
||||||
list_for_each_entry_safe(sibling, tmp,
|
list_for_each_entry_safe(sibling, tmp,
|
||||||
&counter->sibling_list, list_entry) {
|
&counter->sibling_list, list_entry) {
|
||||||
|
|
||||||
list_del_init(&sibling->list_entry);
|
list_move_tail(&sibling->list_entry, &ctx->counter_list);
|
||||||
list_add_tail(&sibling->list_entry, &ctx->counter_list);
|
|
||||||
sibling->group_leader = sibling;
|
sibling->group_leader = sibling;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -959,8 +958,7 @@ static void rotate_ctx(struct perf_counter_context *ctx)
|
||||||
*/
|
*/
|
||||||
perf_flags = hw_perf_save_disable();
|
perf_flags = hw_perf_save_disable();
|
||||||
list_for_each_entry(counter, &ctx->counter_list, list_entry) {
|
list_for_each_entry(counter, &ctx->counter_list, list_entry) {
|
||||||
list_del(&counter->list_entry);
|
list_move_tail(&counter->list_entry, &ctx->counter_list);
|
||||||
list_add_tail(&counter->list_entry, &ctx->counter_list);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
hw_perf_restore(perf_flags);
|
hw_perf_restore(perf_flags);
|
||||||
|
|
Reference in New Issue