From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751415AbdKUVT5 (ORCPT ); Tue, 21 Nov 2017 16:19:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37584 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751263AbdKUVT4 (ORCPT ); Tue, 21 Nov 2017 16:19:56 -0500 Date: Tue, 21 Nov 2017 22:19:50 +0100 From: Jiri Olsa To: Andi Kleen Cc: Jin Yao , acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, kan.liang@intel.com, yao.jin@intel.com Subject: Re: [PATCH v1 5/9] perf util: Remove a set of shadow stats static variables Message-ID: <20171121211950.GA28582@krava> References: <1511189024-19908-1-git-send-email-yao.jin@linux.intel.com> <1511189024-19908-6-git-send-email-yao.jin@linux.intel.com> <20171121151740.GG20440@krava> <20171121180350.GJ28112@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171121180350.GJ28112@tassilo.jf.intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 21 Nov 2017 21:19:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 21, 2017 at 10:03:50AM -0800, Andi Kleen wrote: > > all this is about switching from array to rb_list for the --per-thread case, > > which can be considered as a special use case.. how much do we suffer in > > performance with new code? how about the "perf stat -I 100", would it scale > > ok for extreme cases (many events in -e or -dddd..) > > rbtrees scale by log N, with N being the entries in the tree. > > Even in extreme cases, let's say 10000 events and 1000 cpus it would > need only 8 memory accesses and comparisons for each look up. > Even if we assume cache misses for all of the memory lookups, > at ~200ns per cache miss it's still only 1us per event, which > is negligible. > > In practice not all memory accesses will be misses because > the upper levels of the tree are almost certainly cached > from earlier accesses. sounds good, thanks jirka