From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759019AbZCMNJp (ORCPT ); Fri, 13 Mar 2009 09:09:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759217AbZCMNIU (ORCPT ); Fri, 13 Mar 2009 09:08:20 -0400 Received: from hera.kernel.org ([140.211.167.34]:36752 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758579AbZCMNIP (ORCPT ); Fri, 13 Mar 2009 09:08:15 -0400 Date: Fri, 13 Mar 2009 13:06:34 GMT From: Peter Zijlstra To: linux-tip-commits@vger.kernel.org Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com, a.p.zijlstra@chello.nl, tglx@linutronix.de, mingo@elte.hu Reply-To: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, tglx@linutronix.de, mingo@elte.hu In-Reply-To: <20090313112301.288765724@chello.nl> References: <20090313112301.288765724@chello.nl> Subject: [tip:perfcounters/core] perf_counter: use list_move_tail() Message-ID: Git-Commit-ID: 5026af9f8cc04ced259b492a1fa2754c11ddda1a X-Mailer: tip-git-log-daemon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (hera.kernel.org [127.0.0.1]); Fri, 13 Mar 2009 13:06:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 5026af9f8cc04ced259b492a1fa2754c11ddda1a Gitweb: http://git.kernel.org/tip/5026af9f8cc04ced259b492a1fa2754c11ddda1a Author: Peter Zijlstra AuthorDate: Fri, 13 Mar 2009 12:21:29 +0100 Commit: Ingo Molnar CommitDate: Fri, 13 Mar 2009 14:02:43 +0100 perf_counter: use list_move_tail() Instead of del/add use a move list-op. Signed-off-by: Peter Zijlstra LKML-Reference: <20090313112301.288765724@chello.nl> Signed-off-by: Ingo Molnar --- kernel/perf_counter.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index b2e8389..0fe22c9 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) 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; } } @@ -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);