From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757795AbdLTWFe (ORCPT ); Wed, 20 Dec 2017 17:05:34 -0500 Received: from mga03.intel.com ([134.134.136.65]:18775 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757214AbdLTWFc (ORCPT ); Wed, 20 Dec 2017 17:05:32 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,433,1508828400"; d="scan'208";a="188757491" Subject: Re: [PATCH V2 4/4] perf/x86: fix: disable userspace RDPMC usage for large PEBS To: Andi Kleen Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, jolsa@redhat.com, eranian@google.com References: <1513798971-4257-1-git-send-email-kan.liang@linux.intel.com> <1513798971-4257-5-git-send-email-kan.liang@linux.intel.com> <20171220214147.GJ25156@tassilo.jf.intel.com> From: "Liang, Kan" Message-ID: Date: Wed, 20 Dec 2017 17:05:29 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171220214147.GJ25156@tassilo.jf.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/20/2017 4:41 PM, Andi Kleen wrote: > On Wed, Dec 20, 2017 at 11:42:51AM -0800, kan.liang@linux.intel.com wrote: >> From: Kan Liang >> >> The userspace RDPMC usage never works for large PEBS since the large >> PEBS is introduced by >> commit b8241d20699e ("perf/x86/intel: Implement batched PEBS interrupt >> handling (large PEBS interrupt threshold)") >> >> When the PEBS interrupt threshold is larger than one, there is no way to >> get exact auto-reload times and value for userspace RDPMC. >> >> Disable the userspace RDPMC usage when large PEBS is enabled. > > The only drawback is that the event wraps quickly. It's broken. The value read from RDPMC command will always between -reload_val and 0. Without reload times, I think it's impossible to calculate the total count number. > I suspect in many > cases it's still usable for measuring short regions. > Unless the short region is less than reload_val. Otherwise, reload times is needed. Thanks, Kan > I wouldn't force disable it, just let the users deal with it. > > -Andi >