Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758092AbZD2LMh (ORCPT ); Wed, 29 Apr 2009 07:12:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754811AbZD2LMM (ORCPT ); Wed, 29 Apr 2009 07:12:12 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:57703 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753657AbZD2LML (ORCPT ); Wed, 29 Apr 2009 07:12:11 -0400 Date: Wed, 29 Apr 2009 13:11:59 +0200 From: Ingo Molnar To: Peter Zijlstra Cc: Robert Richter , Paul Mackerras , LKML Subject: Re: [PATCH 04/29] x86/perfcounters: rework pmc_amd_save_disable_all() and pmc_amd_restore_all() Message-ID: <20090429111159.GJ2373@elte.hu> References: <1241002046-8832-1-git-send-email-robert.richter@amd.com> <1241002046-8832-5-git-send-email-robert.richter@amd.com> <1241003260.8021.236.camel@laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1241003260.8021.236.camel@laptop> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1143 Lines: 33 * Peter Zijlstra wrote: > On Wed, 2009-04-29 at 12:47 +0200, Robert Richter wrote: > > MSR reads and writes are expensive. This patch adds checks to avoid > > its usage where possible. > > save_disable_all() > enable(1) > restore_all() > > would not correctly enable 1 with the below modification as we do > not write the configuration into the msr, on which restore relies, > as it only toggles the _ENABLE bit. > > That said, I'm not sure if that's really an issue, but its why the > does does as it does. > > A better abstraction could perhaps avoid this issue all-together. Could we remove the disable-all facility altogether and make the core code NMI-safe? The current approach wont scale on CPUs that dont have global-disable features. disable-all was arguably a hack i introduced and which spread too far. Can you see a conceptual need for it? Ingo -- 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/