Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753181AbZGANui (ORCPT ); Wed, 1 Jul 2009 09:50:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751484AbZGANub (ORCPT ); Wed, 1 Jul 2009 09:50:31 -0400 Received: from one.firstfloor.org ([213.235.205.2]:46471 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbZGANub (ORCPT ); Wed, 1 Jul 2009 09:50:31 -0400 Date: Wed, 1 Jul 2009 15:50:34 +0200 From: Andi Kleen To: Ingo Molnar Cc: Hitoshi Mitake , andi@firstfloor.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][RFC] Adding information of counts processes acquired how many spinlocks to schedstat II Message-ID: <20090701135034.GU6760@one.firstfloor.org> References: <20090701.152115.706994265076015808.mitake@dcl.info.waseda.ac.jp> <87hbxwj1k3.fsf@basil.nowhere.org> <20090701.174226.419764642024067218.mitake@dcl.info.waseda.ac.jp> <20090701090749.GA13535@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090701090749.GA13535@elte.hu> User-Agent: Mutt/1.4.2.2i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1208 Lines: 26 On Wed, Jul 01, 2009 at 11:07:49AM +0200, Ingo Molnar wrote: > His arguments are bogus: both lockstat and perfcounters are optional > (and default off), and the sw counter can be made near zero cost > even if both perfcounters and lockstat is enabled. Also, sw counters > are generally per CPU, etc. so not a performance issue. BTW I looked through the code generated by this again. As far as I can see it still uses a global flag word to enable/disable the counter. The standard problem -- discussed a lot -- with that set up used to be that if the kernel is entered cache cold then you end up with a potential full cache miss (200-1000 cycles) just to access that global variable. The old LTT had a neat optimization to patch in immediate values to avoid this problem. Has this been considered for these counters? With such a change it might be indeed a "small" cost even in the worst cases. -Andi -- ak@linux.intel.com -- Speaking for myself only. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/