Received: by 10.213.65.68 with SMTP id h4csp251258imn; Sat, 17 Mar 2018 02:35:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELua/zDlbyqyv0maYcuZrP9VIGY6wUUSIlevorwKM+4FwIA8cngUdIqo2JkjxtxQ3Svyg+iV X-Received: by 10.99.142.201 with SMTP id k192mr3936256pge.278.1521279356806; Sat, 17 Mar 2018 02:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521279356; cv=none; d=google.com; s=arc-20160816; b=0pA5etHZoOhVbvxWyWfTYu9olYE5ErMIlu+VLVkaDqEOO//ikz3MxliQ2WQlnsTwrT CADWm5NwilF29A6RCcfvkzLUhs/1bYls+645Or+YXv7mSzm/yv8kpSTLVxQnHlgXgmMw Ni1NGn3K/qabv9azsDDTMRrS0QU0mgnEQPBhWu6Hm6v70wGnRgPNYbLtXlQgql3pNdXg zc15rrJvOmeafRUlqUbBEFf0Y3hFe7kjvetc8oZACVlvjyXMA55mk+obju6uUiRrppBI ZbuKFXlNOVqlavJ8fNV3E1MeaNUy3qWIv5gWjxO8kdhfrVuiSMONPlvijjs4Zdtj0vh+ lNJQ== 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:arc-authentication-results; bh=OLqlT7HaxWx+1srAzciTlx8cnUh8RfWXfnT+t9xZDd8=; b=zvec1frJcOhJ4rzJhBNUW0iomj+wZbCKsdJYaZK5pbGfnztUG1mV8bsq8TssCU2Wvq 7p2r410dtfFyFUJa+BvUlO5hrBZubtwlkJ5sYRIUK6B4DU2k+jXkpX3e57b2Zh03D/Yu vQUIAVBrDGu4E/Ewi69MO5dBxjQtHoXQ5cSwMz6AOmQ6Ck7nKmgzcRcIJ0mSPP4JOOeQ KVqZOr0WG7FiaRBV1WCY+EHdT5NHwsyeqyDp+iAouuXiLR+td51dtV7sQgNDIn8wapty vyP7OIXRUll/NDIAC9/aUdcLuAm7Zo4PT4ultFSOxc1uB7BOEI9ZBtqhyAkyJVhPau6M MmMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fgsNRv+T; 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 a90-v6si7729805plc.329.2018.03.17.02.35.42; Sat, 17 Mar 2018 02:35:56 -0700 (PDT) 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=fgsNRv+T; 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 S1752077AbeCQJes (ORCPT + 99 others); Sat, 17 Mar 2018 05:34:48 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:42790 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbeCQJer (ORCPT ); Sat, 17 Mar 2018 05:34:47 -0400 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=OLqlT7HaxWx+1srAzciTlx8cnUh8RfWXfnT+t9xZDd8=; b=fgsNRv+ThA52Vt3ImK9tjbRqi eNnmZO3pM7MnCRaywFRsHmXezNi4b4ogOAicA25amWddW+nuDlXqXtoHrn40l+vQAU06zU+hg6cYz peFLcazkoUQCPqmVWWgxxGt9Q5gWHngB4Tzk/a7jspHVlvJA8nOA94uvCRGEj3GpCt29Y0A0XCntI l7Pm46HvD8avCQYmryA/Au3m8t1CMCdbzs/oo4zRd8AtUNFedyjHdAByv+hofM5tuFeKaoOGLY4rX 7LKfpAez7GRJcR2iz9EEGnbokNjbFuHHSUHvBr4m9jcCl0BNhyoMg3GOHlItlzsaY8BzmeqJbRkMe sfiS1fqaA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ex8Eb-0007q2-7C; Sat, 17 Mar 2018 09:34:41 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id AED9E2029F860; Sat, 17 Mar 2018 10:34:38 +0100 (CET) Date: Sat, 17 Mar 2018 10:34:38 +0100 From: Peter Zijlstra To: kan.liang@intel.com Cc: tglx@linutronix.de, mingo@redhat.com, linux-kernel@vger.kernel.org, acme@kernel.org, eranian@google.com, ak@linux.intel.com Subject: Re: [PATCH V6 5/8] perf/x86/intel/uncore: add infrastructure for free running counter Message-ID: <20180317093438.GI4064@hirez.programming.kicks-ass.net> References: <1516911228-5293-1-git-send-email-kan.liang@intel.com> <1516911228-5293-5-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516911228-5293-5-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 25, 2018 at 12:13:45PM -0800, kan.liang@intel.com wrote: > @@ -512,6 +538,17 @@ static int uncore_pmu_event_add(struct perf_event *event, int flags) > if (!box) > return -ENODEV; > > + /* > + * The free funning counter is assigned in event_init(). > + * The free running counter event and free running counter > + * are 1:1 mapped. It doesn't need to be tracked in event_list. > + */ > + if (uncore_pmc_freerunning(hwc->idx)) { > + if (flags & PERF_EF_START) > + uncore_pmu_event_start(event, 0); > + return 0; > + } > + > ret = n = uncore_collect_events(box, event, false); > if (ret < 0) > return ret; This will result in some (probably) unexpected scheduling artifacts. Probably the only way to really cure that is to have the free running counters in their own PMU and not share with the GP counters of this box.