aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_counter.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-03-13 07:21:29 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-06 03:29:31 -0400
commit755642322aa66fbc5421a35fd3e1733f73e20083 (patch)
treecfcdd495d14de3b78cdf7f1d064e8534ea8593e1 /kernel/perf_counter.c
parent595258aaeac4cc6e187b98b1bf29bb176febe763 (diff)
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>
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r--kernel/perf_counter.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index b2e838959f3e..0fe22c916e29 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -89,8 +89,7 @@ list_del_counter(struct perf_counter *counter, struct perf_counter_context *ctx)
89 list_for_each_entry_safe(sibling, tmp, 89 list_for_each_entry_safe(sibling, tmp,
90 &counter->sibling_list, list_entry) { 90 &counter->sibling_list, list_entry) {
91 91
92 list_del_init(&sibling->list_entry); 92 list_move_tail(&sibling->list_entry, &ctx->counter_list);
93 list_add_tail(&sibling->list_entry, &ctx->counter_list);
94 sibling->group_leader = sibling; 93 sibling->group_leader = sibling;
95 } 94 }
96} 95}
@@ -959,8 +958,7 @@ static void rotate_ctx(struct perf_counter_context *ctx)
959 */ 958 */
960 perf_flags = hw_perf_save_disable(); 959 perf_flags = hw_perf_save_disable();
961 list_for_each_entry(counter, &ctx->counter_list, list_entry) { 960 list_for_each_entry(counter, &ctx->counter_list, list_entry) {
962 list_del(&counter->list_entry); 961 list_move_tail(&counter->list_entry, &ctx->counter_list);
963 list_add_tail(&counter->list_entry, &ctx->counter_list);
964 break; 962 break;
965 } 963 }
966 hw_perf_restore(perf_flags); 964 hw_perf_restore(perf_flags);