Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4526810ybc; Fri, 15 Nov 2019 06:09:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyNa1RipPWQbZ83UNR1vmsEmeazcqUcBg58vru/98rlGQVBbfhFbdoAuPJf/RVAo/MkVSeP X-Received: by 2002:a2e:9d97:: with SMTP id c23mr11324686ljj.121.1573826995383; Fri, 15 Nov 2019 06:09:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573826995; cv=none; d=google.com; s=arc-20160816; b=X5wQoFDuDVcYYwA7VlowPq4Mpm6lNaHxYv3LfGtxWR1s5o0Nvv2Dv02j25ySp5f1xH 8tEJgOIZFGkzbpurOFRdw7aOaO+wgw+JJVnkb3H/PUUJeUuKl7Vtq+GhdxhZodPbdI+S XSSnh3TYfHN9tCD7Ghb9n4ilqYzsItGis5fA9eECjSu2NLJYhrfleKchvngyUdjBhqo2 JJEsAW5DdI9NxbOC4HI2tiCoi3/3Epf1XYgcxygQMSnzzQ7p7KRoJuSC7QA//mGyHUGC H4Dudf1qFCRzBm4NNf/87gf5YiflOtbM9b3MinEiGdE7u9w8n7Qmi3NN5Z9oQmc8fi1h k9ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lAZYg3lS135TwSE30pNm6foCygkKVQSy8A1PI6nH2bM=; b=H4Isvrx84Avxw7AvvFEnfgz1HvykdrQvrrroBE/PFIgzJVgeWWzUiuXuA7XOplZsPF 1MH0DKQVZc7yiLWN/6tpQIXw0Y1UK2Oy9omtEul0Y8HWG2BZFVTRyLR1ygb7QbDDIY89 21dcp19t7Q43zRYSFcjBQnCe8Sbox+cxAWtLeIA+472sgHeVNC43uSdyP6JoavZJx3Ms CBP9xMuisfYUNG4kzioHwDAwiv106PHILKYXC0MD5wAugrZCAesnLx4rO18mjHczelKW QiOqSRTFUxMVibeYVp2+G+5adPN1L49SHvYPPkw9fHevM5s9kMgL24FWV/YyV8a1w1Y0 /MOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=TNzmAWCC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si6051276edq.394.2019.11.15.06.09.30; Fri, 15 Nov 2019 06:09:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=TNzmAWCC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727591AbfKOOHq (ORCPT + 99 others); Fri, 15 Nov 2019 09:07:46 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:34562 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727380AbfKOOHp (ORCPT ); Fri, 15 Nov 2019 09:07:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=lAZYg3lS135TwSE30pNm6foCygkKVQSy8A1PI6nH2bM=; b=TNzmAWCCScOR2GxCFXUW0B9z6 Tu9V8WfQkcTEmTnlofuupVMf4k+D8zlIKu5xM7xLUlAPNYFh4evZ+fzTa7jHk7G41vcch05E32xvQ ZTzXogv37+1W6ffGTnP9Zj/XpuDm0y1vdPchaII8iZPkUW5XThG5k+10Y44PZE8h63Y2zzCP3nTEy q2V3LrcA/6OnoHuQ4xI/PW4SQWLy6fCeLZjyCmtJKWtKv8c7Y/u620R/tSkAXsSVKJiqgqA18pFdQ MwsIRwzQDxxQAuWuD0G684VqYqIv6M8FAQz9ZmdmxJK0lvZPFtU2XU/1peO9A8GPEJJp6Ue9gpPKm BxCuXhzOA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVcGC-0000rB-Qe; Fri, 15 Nov 2019 14:07:40 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 13AE9303D9F; Fri, 15 Nov 2019 15:06:31 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 338A02B12E7AC; Fri, 15 Nov 2019 15:07:39 +0100 (CET) Date: Fri, 15 Nov 2019 15:07:39 +0100 From: Peter Zijlstra To: kan.liang@linux.intel.com Cc: acme@redhat.com, mingo@kernel.org, linux-kernel@vger.kernel.org, ak@linux.intel.com, eranian@google.com Subject: Re: [PATCH] perf/x86/intel: Avoid PEBS_ENABLE MSR access in PMI Message-ID: <20191115140739.GM4131@hirez.programming.kicks-ass.net> References: <20191115133917.24424-1-kan.liang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191115133917.24424-1-kan.liang@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 15, 2019 at 05:39:17AM -0800, kan.liang@linux.intel.com wrote: > From: Kan Liang > > The perf PMI handler, intel_pmu_handle_irq(), currently does > unnecessary MSR accesses when PEBS is enabled. > > When entering the handler, global ctrl is explicitly disabled. All > counters do not count anymore. It doesn't matter if the PEBS is > enabled or disabled. Furthermore, cpuc->pebs_enabled is not changed > in PMI. The PEBS status doesn't change. The PEBS_ENABLE MSR doesn't need > to be changed either. PMI can throttle, and iirc x86_pmu_stop() ends up in intel_pmu_pebs_disable()