From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753585AbbE0Quf (ORCPT ); Wed, 27 May 2015 12:50:35 -0400 Received: from terminus.zytor.com ([198.137.202.10]:39054 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751626AbbE0Quc (ORCPT ); Wed, 27 May 2015 12:50:32 -0400 Date: Wed, 27 May 2015 09:50:16 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: namhyung@kernel.org, bp@suse.de, dsahern@gmail.com, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, eranian@google.com, adrian.hunter@intel.com, fweisbec@gmail.com, jolsa@redhat.com, dzickus@redhat.com, acme@redhat.com, mingo@kernel.org Reply-To: mingo@kernel.org, acme@redhat.com, jolsa@redhat.com, dzickus@redhat.com, dsahern@gmail.com, hpa@zytor.com, bp@suse.de, namhyung@kernel.org, fweisbec@gmail.com, adrian.hunter@intel.com, eranian@google.com, tglx@linutronix.de, linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Import rb_erase_init from block/ in the kernel sources Git-Commit-ID: 9402e23f90c5a672db7170e4c0f1fc80ca8c009a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9402e23f90c5a672db7170e4c0f1fc80ca8c009a Gitweb: http://git.kernel.org/tip/9402e23f90c5a672db7170e4c0f1fc80ca8c009a Author: Arnaldo Carvalho de Melo AuthorDate: Mon, 25 May 2015 11:49:11 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 27 May 2015 12:21:44 -0300 perf tools: Import rb_erase_init from block/ in the kernel sources I was assuming rb_erase() was setting things up like list_del_init, but the fact that thread__delete() was being sucessfull is because the last thing before deleting is to remove the thread from the machine->dead_threads list, using list_del_init(), that has the same effect as using rb_erase_init()... Introduce this function so that we can use it when removing objects from rb_trees. Then we will be able to BUG_ON(still on a list) in destructors. Cc: Adrian Hunter Cc: Borislav Petkov Cc: David Ahern Cc: Don Zickus Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-55b16mbtndjyd7zzg8nmnamx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/include/linux/rbtree.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/perf/util/include/linux/rbtree.h b/tools/perf/util/include/linux/rbtree.h index 2a030c5..f06d89f 100644 --- a/tools/perf/util/include/linux/rbtree.h +++ b/tools/perf/util/include/linux/rbtree.h @@ -1,2 +1,16 @@ +#ifndef __TOOLS_LINUX_PERF_RBTREE_H +#define __TOOLS_LINUX_PERF_RBTREE_H #include #include "../../../../include/linux/rbtree.h" + +/* + * Handy for checking that we are not deleting an entry that is + * already in a list, found in block/{blk-throttle,cfq-iosched}.c, + * probably should be moved to lib/rbtree.c... + */ +static inline void rb_erase_init(struct rb_node *n, struct rb_root *root) +{ + rb_erase(n, root); + RB_CLEAR_NODE(n); +} +#endif /* __TOOLS_LINUX_PERF_RBTREE_H */