From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752107AbdBFTLm (ORCPT ); Mon, 6 Feb 2017 14:11:42 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:51402 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751810AbdBFTLk (ORCPT ); Mon, 6 Feb 2017 14:11:40 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E77A060272 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=nleeder@codeaurora.org Subject: Re: [PATCH v9] perf: add qcom l2 cache perf events driver To: Mark Rutland References: <1486161081-28409-1-git-send-email-nleeder@codeaurora.org> <20170206154814.GA4190@leverpostej> Cc: Catalin Marinas , Will Deacon , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mark Langsdorf , Mark Salter , Jon Masters , Timur Tabi , cov@codeaurora.org, nleeder@codeaurora.org From: "Leeder, Neil" Message-ID: <8d61d7fb-71d0-190e-26e3-a72e98cfb10d@codeaurora.org> Date: Mon, 6 Feb 2017 14:11:36 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170206154814.GA4190@leverpostej> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, Thanks for those comments - I'll add the fixes. On 2/6/2017 10:48 AM, Mark Rutland wrote: > I'm still concerned by this use of the filter_match callback, because it > depends on the set of other active events, and can change as other > events are scheduled in and out. > > When we schedule in two conflicting events A and B in order, B will fail > its filter match. When we scheduled out A and B in order, B will succeed > its filter match. > > The perf core does not expect this inconsistency, and this appears to > break the timing update logic in event_sched_out(), when unconditionally > called from ctx_sched_out() as part of perf_rotate_context(). > > I would feel much happier if we dropped l2_cache_filter_match(), at > least for the timebeing, and handled this as we do for other cases of > intra-pmu resource contention. > > We can then consider the filter_match addition on its own at a later > point. So could this be detected in get_event_idx, the same way we handle counter resource contention? That would eliminate filter_match, and it's the same way its done in armv7 (arch/arm/kernel/perf_event_v7.c:krait_pmu_get_event_idx()). It's less obvious to the user, but seeing 2 events being rotated so they each have ~50% coverage should provide a hint that the user did something wrong, so I think that would work. Thanks, Neil -- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.