Received: by 10.223.185.111 with SMTP id b44csp835494wrg; Fri, 9 Mar 2018 14:51:06 -0800 (PST) X-Google-Smtp-Source: AG47ELs+dD6jk6yj/EdqcGVWKwiLyBkoheV816SGS2vj09rS7bchXn91Jx4CXQ7/i4CXZ2hrBOcI X-Received: by 2002:a17:902:684a:: with SMTP id f10-v6mr94365pln.129.1520635865988; Fri, 09 Mar 2018 14:51:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520635865; cv=none; d=google.com; s=arc-20160816; b=qnIiLIILSdasAazXSpYU2+56c2Aa4qfb92bYrfvaTvEAQKaXs/DAiaG6m4Rnj8xtQ/ jPkpDEnYdpj83rReOmCAr+XSVqUJz4Nxo5uh13PXhlgjAzIz1PsJrE0aHGGFnOCNtx89 rW9dRtTWZNxZ53FOsQGxMkjtXPM9Osc5rODwpInCj2I+sSFmexjZlKFAQKpxJuSZ1xq0 YAPT1sQqsTR22oYYtmBFITdjOFwVA9PzPWYVToptLJIxV/P8uAhzG0WgbGDg036wgNda A32HKbJ4Dg09JAjCfba3OJ3HuZmN2jYSRroKZiCnQMzec93XeOQ8+NXVMxazqErTLjXx AgDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=UvMTIhn8dpLDI/9ZLHggaEuJfSBoVTix4YbszCVp328=; b=gpw0zOIoTXoIjDW6Fp0UTzvrmpMgv5XHJYhq11KZFjyiYycvud87/S84pz7tCpwUNo 8fl8lqPjKYb5GWhycLdBibhvI/HbvCB7jdsQiT+UR29BDjSVr/AwD1ALjLhMCOCt9gZG jPQZ/3ezRKxIqlfb5jJolblRRvkhPClXWw7cW5ePvGkJmhc5Uo2mWBObyvWW96j4culV q0KyAxhMgMrKfiGA+nLBrOla6IZLyPXE5u1kSdAeHQFfYzaPlvKWxvW9KVFsnkngkoPK YARrC7fyCIzyC0QOEBSjAdkhtlSjH+5vvOkGrxGvYjtPYQ9KlOJdTCF/1Z2LVgD5QPYn pcZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=dClHOJWi; dkim=pass header.i=@codeaurora.org header.s=default header.b=SL8iBNV2; 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 a13si1632263pfg.61.2018.03.09.14.50.51; Fri, 09 Mar 2018 14:51:05 -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=pass header.i=@codeaurora.org header.s=default header.b=dClHOJWi; dkim=pass header.i=@codeaurora.org header.s=default header.b=SL8iBNV2; 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 S932746AbeCIWtF (ORCPT + 99 others); Fri, 9 Mar 2018 17:49:05 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:54924 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932195AbeCIWtD (ORCPT ); Fri, 9 Mar 2018 17:49:03 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3D2806043F; Fri, 9 Mar 2018 22:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520635743; bh=Q8D38g5l46g3nD3eGaHDYsYO8KZ5YNMyPuHmntdF/oY=; h=Date:From:To:CC:Subject:References:In-Reply-To:From; b=dClHOJWiE0L9UTr22OABH7Ad011Uah3YRaCgWJGqCK3ANMaslkCKC2pKrQWeJ0R4L S1BeGpNUQfRo+irhI58LPfX8wJy+DuiWE2BAl8dAI8CGmgokehz4hsmzJA91EGhAtK 3b7MtWAlx6eCGi5OAXKS5Kmv392CmTyj0xA95wKU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.134.64.210] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: skannan@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5332F6043F; Fri, 9 Mar 2018 22:49:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520635742; bh=Q8D38g5l46g3nD3eGaHDYsYO8KZ5YNMyPuHmntdF/oY=; h=Date:From:To:CC:Subject:References:In-Reply-To:From; b=SL8iBNV2rKKGT5tTc+DwOHUogjNNYWdhndBVUYOxZps8el0WSH+ZAsF3mbY15E0Kl sAPyphRdszEdxO839LfzfdH6dXNcf330R9+zNvI4idkOZ3NGWQVMhSWrW5VtukRs37 uElAKweiZBv+7PXQy+E6iCsxyai+kDmIA/IPx0t0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5332F6043F 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=skannan@codeaurora.org Message-ID: <5AA30F5C.2010402@codeaurora.org> Date: Fri, 09 Mar 2018 14:49:00 -0800 From: Saravana Kannan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Mark Rutland CC: Suzuki K Poulose , will.deacon@arm.com, robh@kernel.org, sudeep.holla@arm.com, mathieu.poirier@linaro.org, peterz@infradead.org, jonathan.cameron@huawei.com, linux-kernel@vger.kernel.org, marc.zyngier@arm.com, leo.yan@linaro.org, frowand.list@gmail.com, linux-arm-kernel@lists.infradead.org, rananta@codeaurora.org, avilaj@codeaurora.org, Lorenzo Pieralisi , Charles Garcia-Tobin Subject: Re: [PATCH v11 8/8] perf: ARM DynamIQ Shared Unit PMU support References: <20180102112533.13640-1-suzuki.poulose@arm.com> <20180102112533.13640-9-suzuki.poulose@arm.com> <5AA1CE48.5030203@codeaurora.org> <20180309133531.fepm2suvdmvm4muv@lakrids.cambridge.arm.com> In-Reply-To: <20180309133531.fepm2suvdmvm4muv@lakrids.cambridge.arm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/09/2018 05:35 AM, Mark Rutland wrote: > On Fri, Mar 09, 2018 at 10:53:14AM +0000, Suzuki K Poulose wrote: >> + Cc: Lorenzo, Charles. >> >> On 08/03/18 23:59, Saravana Kannan wrote: >>> On 01/02/2018 03:25 AM, Suzuki K Poulose wrote: >>>> Add support for the Cluster PMU part of the ARM DynamIQ Shared Unit (DSU). >>>> The DSU integrates one or more cores with an L3 memory system, control >>>> logic, and external interfaces to form a multicore cluster. The PMU >>>> allows counting the various events related to L3, SCU etc, along with >>>> providing a cycle counter. >>>> >>>> The PMU can be accessed via system registers, which are common >>>> to the cores in the same cluster. The PMU registers follow the >>>> semantics of the ARMv8 PMU, mostly, with the exception that >>>> the counters record the cluster wide events. >>>> >>>> This driver is mostly based on the ARMv8 and CCI PMU drivers. >>>> The driver only supports ARM64 at the moment. It can be extended >>>> to support ARM32 by providing register accessors like we do in >>>> arch/arm64/include/arm_dsu_pmu.h. >>>> >>>> Cc: Mark Rutland >>>> Cc: Will Deacon >>>> Reviewed-by: Jonathan Cameron >>>> Reviewed-by: Mark Rutland >>>> Signed-off-by: Suzuki K Poulose >> >> [...] >> >>> >>> Looking at the code, I didn't see any specific handling of cluster power collapse. AFAIK, the HW counters do not retain config (what event they are counting) or value (the current count) across power collapse. Wouldn't you need to register for some kind of PM_ENTER/EXIT notifiers to handle that? >> >> Good point, yes *somebody* needs to save-restore the registers. But who ? As far >> as the kernel is concerned, it doesn't control the DSU states. Also, as of now >> there is no reliable way to get the "ENTER/EXIT" notifications for the DSU power >> domain state changes. All we do is use the PMU, assuming it is available. AFAIT, >> it should really be done at EL3, which manages the DSU, but may be I am wrong. > > Given this can happen behind the back of the kernel, if FW doesn't > save/restore this state, we'll have to inhibit cpuidle on a CPU > associated with the DSU PMU whenever it has active events, which would > keep the cluster online. > Using PMUs should be designed to have the least impact on power/performance. Otherwise, using them to profile and debug issues becomes impossible. Disabling cpuidle would significantly affect power and performance. Why not use CPU_CLUSTER_PM_ENTER similar to how arm-pmu.c uses CPU_PM_ENTER for saving and restoring the counters? Technically a lot of stuff could be pushed to FW. Doesn't mean we should. At worst, we'll save and restore for a few cases where we didn't need to. Thanks, Saravana -- Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project