Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933461AbdCXIRx (ORCPT ); Fri, 24 Mar 2017 04:17:53 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:41190 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752405AbdCXIQJ (ORCPT ); Fri, 24 Mar 2017 04:16:09 -0400 Date: Fri, 24 Mar 2017 09:16:02 +0100 From: Peter Zijlstra To: Andi Kleen 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: <20170324081602.fw7jyv5huyd32cgv@hirez.programming.kicks-ass.net> 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> <20170323222303.GA9371@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170323222303.GA9371@tassilo.jf.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 Content-Length: 1153 Lines: 26 On Thu, Mar 23, 2017 at 03:23:03PM -0700, Andi Kleen wrote: > 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 Changelog should spell this out though. It adds a knob, so it should say why it needs be a knob.