Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934773AbdCWWXI (ORCPT ); Thu, 23 Mar 2017 18:23:08 -0400 Received: from mga11.intel.com ([192.55.52.93]:47637 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934707AbdCWWXF (ORCPT ); Thu, 23 Mar 2017 18:23:05 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,211,1486454400"; d="scan'208";a="70138140" Date: Thu, 23 Mar 2017 15:23:03 -0700 From: Andi Kleen To: Peter Zijlstra Cc: kan.liang@intel.com, mingo@redhat.com, acme@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, eranian@google.com, jolsa@kernel.org Subject: Re: [PATCH 1/3] perf/x86: add sysfs entry to freeze counter on SMI Message-ID: <20170323222303.GA9371@tassilo.jf.intel.com> References: <1490293551-5552-1-git-send-email-kan.liang@intel.com> <1490293551-5552-2-git-send-email-kan.liang@intel.com> <20170323203138.li45llrzfxcaqieu@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170323203138.li45llrzfxcaqieu@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 958 Lines: 24 On Thu, Mar 23, 2017 at 09:31:38PM +0100, Peter Zijlstra wrote: > On Thu, Mar 23, 2017 at 11:25:49AM -0700, kan.liang@intel.com wrote: > > From: Kan Liang > > > > When setting FREEZE_WHILE_SMM bit in IA32_DEBUGCTL, all performance > > counters will be effected. There is no way to do per-counter freeze > > on smi. So it should not use the per-event interface (e.g. ioctl or > > event attribute) to set FREEZE_WHILE_SMM bit. > > > > Adds sysfs entry /sys/device/cpu/freeze_on_smi to set FREEZE_WHILE_SMM > > bit in IA32_DEBUGCTL. When set, freezes perfmon and trace messages > > while in SMM. > > Value has to be 0 or 1. It will be applied to all possible cpus. > > So is there ever a good reason to not set this? That means SMIs become invisible to most performance counters. I don't think that's a good default. If the SMI takes 1% of my cycles I want to see it. The masking trick is mainly useful when doing --smi-cost -Andi