Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp508822img; Wed, 20 Mar 2019 05:26:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyC5LI5UuCLDqRCWJ9xWVS1lnuHgkbHK35+YqUyztAge/GDI8qmeGgvgEvRa/YbreB3J/ob X-Received: by 2002:a17:902:784c:: with SMTP id e12mr8187183pln.117.1553084793433; Wed, 20 Mar 2019 05:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553084793; cv=none; d=google.com; s=arc-20160816; b=DP3AwY2+Pq50TfVnaPWLgLQXVlWGRnQhkjsDW1aUKziNDMuK9QcqdaQP1hKd3NcZ7s QqUnucomR/fG+MMA5ImzNWk/PpGKGzMR9GkldfgpNArAGvzi8aJflM1ne5amDwG7jQqm 7GW0LLoM4xRmEeqnXPCn4ypR9HTrXSI86HiQ1OHfuXHTyCadVurGAD361XeR6ft50Hy8 pmDRW8sxsBWoUMMNrp8aFzZ8Kty6P9ES+Mov8AKBvqw34OjWx3cR+PYQ8ZeKBR1sIIbC v9bBezv/MlEk9p4uea8n58wsbh3wJ1jOqHg0/ECYHXxsPdH7Gkwllc8WtvyCZN+9FKB0 OScQ== 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=smgpF9UKcmBfA9N5X/DOY2q9U2CSoD48XaQLEORD2dI=; b=iUPFalXAXzQxiRowr7e7fc12wehmsTEZDu+cwiVWyH1VZkpAbQHlaK7iKDeXZS5vUV +WJ3YbSDlaN2NAw1sN7PKtS//8SqfYeo2BsQbBzaCb1gavdif1w7MUUJ2THFKY6qPe41 nGPwGzTEwasZe2lT4yJ8BND2/warwq9LYTgQe5eJm/vO8Kf3tq9qew3NULJgrvIaZVML zIfatUAjyPAZb203VIxy7AxjvsdZ7B4oSc9bblcfFl3bmAEy+5HsAknNSIXWkgqLPShf WW6h469Nf72c8dF35F6nVol7TneOOWp0usuI+UNu41gY9SAWOd6GeqoGFy02HkW/8yl1 dLlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Dfru4UH0; 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 w1si1723081plz.106.2019.03.20.05.26.17; Wed, 20 Mar 2019 05:26:33 -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=merlin.20170209 header.b=Dfru4UH0; 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 S1727538AbfCTMZ3 (ORCPT + 99 others); Wed, 20 Mar 2019 08:25:29 -0400 Received: from merlin.infradead.org ([205.233.59.134]:50206 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbfCTMZ3 (ORCPT ); Wed, 20 Mar 2019 08:25:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=smgpF9UKcmBfA9N5X/DOY2q9U2CSoD48XaQLEORD2dI=; b=Dfru4UH0ntTrplb6Ke5efLEJE rkznrgnYBSKt6cUgqtBbkSVef9olE7JcagcMs64PgwoMsT95Sq2cdBE/axhYpDQiEYbPKGeCuFNmY NXZwcLn1vLAzKhx3jV0vghnWzuK0JjsVWuHMiGAXxZiIKh06a9BjatNep27D8fjIWKXmlTv/9L/ny HYUJ4DrWW55x4O4A6Z40e0hOSDkUpPDpkIPAFAorWgRQJ+KH+fQQlBkwJXqaJ9NPabukcFeSs4M58 sCvSOT7kXAYLXQV89FKckicNVUg7xpI8m/TyLUYa/DN9ip2G5R2BkNxCe+ssHPcYecBYlyxDd0zFk Igw9mSZBA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6aHU-0002cC-GI; Wed, 20 Mar 2019 12:25:16 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F3C5923EA30BA; Wed, 20 Mar 2019 13:25:14 +0100 (CET) Date: Wed, 20 Mar 2019 13:25:14 +0100 From: Peter Zijlstra To: Stephane Eranian Cc: Ingo Molnar , Jiri Olsa , LKML , tonyj@suse.com, nelson.dsouza@intel.com Subject: Re: [RFC][PATCH 6/8] perf/x86: Clear ->event_constraint[] on put Message-ID: <20190320122514.GF6058@hirez.programming.kicks-ass.net> References: <20190314130113.919278615@infradead.org> <20190314130705.956098225@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Mar 19, 2019 at 02:50:21PM -0700, Stephane Eranian wrote: > On Thu, Mar 14, 2019 at 6:11 AM Peter Zijlstra wrote: > > > > The current code unconditionally clears cpuc->event_constraint[i] > > before calling get_event_constraints(.idx=i). The only site that cares > > is intel_get_event_constraints() where the c1 load will always be > > NULL. > > > > However, always calling get_event_constraints() on all events is > > wastefull, most times it will return the exact same result. Therefore > > retain the logic in intel_get_event_constraints() and change the > > generic code to only clear the constraint on put. > > > > Signed-off-by: Peter Zijlstra (Intel) > > I thought there was caching of the constraint in case it was static > (or unconstrained) Yeah, I was under the same impression :-/ > to avoid walking the constraint table each time between invocations > on the same group_sched_in() call. But the way the c1 vs. c2 logic > is written I don't see it. In which case, this could be another opportunity. Right, the next patch attempts this.