From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751101AbdE2KnO (ORCPT ); Mon, 29 May 2017 06:43:14 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:60402 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751080AbdE2KnN (ORCPT ); Mon, 29 May 2017 06:43:13 -0400 Date: Mon, 29 May 2017 12:43:04 +0200 From: Peter Zijlstra To: Alexey Budankov Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Andi Kleen , Kan Liang , Dmitri Prokhorov , Valery Cherepennikov , David Carrillo-Cisneros , Stephane Eranian , Mark Rutland , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2]: perf/core: addressing 4x slowdown during per-process, profiling of STREAM benchmark on Intel Xeon Phi Message-ID: <20170529104304.vy47zhf6fdq6bki3@hirez.programming.kicks-ass.net> References: <1e962b59-3e39-e0d6-515d-c4fd3502edae@linux.intel.com> <20170529074636.tjftcdtcg6op74i3@hirez.programming.kicks-ass.net> <75f031d8-68ec-4cd6-752f-1fbecaa86026@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <75f031d8-68ec-4cd6-752f-1fbecaa86026@linux.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 29, 2017 at 12:15:14PM +0300, Alexey Budankov wrote: > On 29.05.2017 10:46, Peter Zijlstra wrote: > > On Sat, May 27, 2017 at 02:19:51PM +0300, Alexey Budankov wrote: > > > @@ -742,7 +772,17 @@ struct perf_event_context { > > > > > > struct list_head active_ctx_list; > > > struct list_head pinned_groups; > > > + /* > > > + * Cpu tree for pinned groups; keeps event's group_node nodes > > > + * of attached flexible groups; > > > + */ > > > + struct rb_root pinned_tree; > > > struct list_head flexible_groups; > > > + /* > > > + * Cpu tree for flexible groups; keeps event's group_node nodes > > > + * of attached flexible groups; > > > + */ > > > + struct rb_root flexible_tree; > > > struct list_head event_list; > > > int nr_events; > > > int nr_active; > > > @@ -758,6 +798,7 @@ struct perf_event_context { > > > */ > > > u64 time; > > > u64 timestamp; > > > + struct perf_event_tstamp tstamp_data; > > > > > > /* > > > * These fields let us detect when two contexts have both > > > > > > So why do we now have a list _and_ a tree for the same entries? > We need groups list to iterate through all groups configured for collection > and we need the tree to quickly iterate through the groups allocated for a > particular CPU only. *confused*, what? Why can't the tree do both?