Received: by 10.223.185.116 with SMTP id b49csp2591887wrg; Mon, 5 Mar 2018 05:42:06 -0800 (PST) X-Google-Smtp-Source: AG47ELvXnwiVIcp0ELYbfctpwtXskNnVKpA63CziHKSSXtROWlAhkzd5NFtSBC4LynJ/kq7VXdaw X-Received: by 2002:a17:902:9a08:: with SMTP id v8-v6mr5793492plp.252.1520257326107; Mon, 05 Mar 2018 05:42:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520257326; cv=none; d=google.com; s=arc-20160816; b=sBSWbURt6aAkmihQgkLrjbqrmygEWRGDhWRlUUUeIcTayk7w93K/bZNvoGfGSavz0u /lbxerYLMwNTlmjVCFQ6Qi/BNiNSDy4V3hVLCmJHTozncYkurwwI6rEAoCxw+xLcweus 6YMPGD489gAFySZl/yqSMWuxUuokwx27T19NnioZkvlYL8FV2ftD5IZ49dbJmOxllpQ8 uDzyUtM9sHmp19/E6/mgfSBoOf6jy1LUeAVXWhrFke+7vw0ynDGh9gHkeau+S7bkih/r DAcIoDIoelVyToOEgzLwUKcPIhDbPBEeka/RMehWKInCQPvktu2yDNlrpXGoAYDOhtWS OhnA== 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:arc-authentication-results; bh=bzcUgMlxsQy6LzWwjlP8701RpIeN/YDKR4M5ovnM3gg=; b=N2HGRaUPy8Q00vZtnGH0JEcBAw7QHeigOjzau67Pik8ggN8wn1ohHGXufNSm4Q4shl ELdp1IonwDZh8Up/1UBPO3MMYRaG/FM1DAtEOQURa6M0lqZsa7Mf9ahdEXPoY5Ei5t1a Yso6gs/PRyM1NYHC3SmMIojybpSiQ+JW47YTIDizbY38MRF5iBR/Ad6B5qhcoBHpTTDH wmUT/jnG9AKd+84c3VnuC158JysJbee92xk1NSrIF4NvmL+5kMBBUObCpiEtQ1znK2RO 0bBWRZeXxq3U6CFEchIN9rJiMUCBWHcblLWxaFfiuV1DJyM2NG1WsoXIFJoMpUUSTZWF Qxzg== ARC-Authentication-Results: i=1; mx.google.com; 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 v12-v6si1994226plo.170.2018.03.05.05.41.51; Mon, 05 Mar 2018 05:42:06 -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; 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 S1752539AbeCEK7h (ORCPT + 99 others); Mon, 5 Mar 2018 05:59:37 -0500 Received: from foss.arm.com ([217.140.101.70]:48126 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752423AbeCEK7e (ORCPT ); Mon, 5 Mar 2018 05:59:34 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 22B1D14; Mon, 5 Mar 2018 02:59:34 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DFC463F487; Mon, 5 Mar 2018 02:59:31 -0800 (PST) Date: Mon, 5 Mar 2018 10:59:26 +0000 From: Mark Rutland To: Saravana Kannan Cc: robh@kernel.org, mathieu.poirier@linaro.org, Suzuki K Poulose , peterz@infradead.org, sudeep.holla@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, marc.zyngier@arm.com, jonathan.cameron@huawei.com, frowand.list@gmail.com, leo.yan@linaro.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v11 8/8] perf: ARM DynamIQ Shared Unit PMU support Message-ID: <20180305105925.4cjiqejfid7rswe6@lakrids.cambridge.arm.com> References: <20180102112533.13640-1-suzuki.poulose@arm.com> <20180102112533.13640-9-suzuki.poulose@arm.com> <5A90B77E.8040105@codeaurora.org> <20180225143653.peb4quk3ha5h3t5x@salmiak> <5A972A7D.9020301@codeaurora.org> <20180301114911.fundyuqxtj5klk4e@lakrids.cambridge.arm.com> <5A986425.9080007@codeaurora.org> <20180302104223.7tpsyhsum7nej237@lakrids.cambridge.arm.com> <5A99A3DC.9020400@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5A99A3DC.9020400@codeaurora.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 02, 2018 at 11:19:56AM -0800, Saravana Kannan wrote: > On 03/02/2018 02:42 AM, Mark Rutland wrote: > > It's important to note that the DSU PMU's event_init() ensures events > > are affine to a single CPU, and the perf core code serializes operations > > on those events via the context lock. > > Ah, I see that now. Thanks! > > > Therefore, two CPUs *won't* try to access the registers simultaneously. > > Right, and this driver seems to be going through a lot of work to make sure > all events are read in one CPU. > > Do you even have an upstream target where there are multiple DSU's in a > system? I have no idea, though I do beleive that it's possible for a system to have multiple DSUs. > If not, we can simplify a ton of this code (no hotplug notifiers, no > migrating PMUs, no SMP calls, etc) by just adding a spinlock and letting any > CPU read these DSU counters. Regardless of whether we allow arbitrary CPUs to read the counters, other logic still needs to be CPU affine, and we'll still need hotplug notifiers and event migration. I am not necessarily opposed to allowing read() calls from associated CPUs, but as before, I'll leave that to Suzuki. Thanks, Mark.