From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 884F8C388F9 for ; Thu, 19 Nov 2020 19:15:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D5B2238E6 for ; Thu, 19 Nov 2020 19:15:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="JZ5/cADu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727983AbgKSTPX (ORCPT ); Thu, 19 Nov 2020 14:15:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:35988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727658AbgKSTPW (ORCPT ); Thu, 19 Nov 2020 14:15:22 -0500 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57A9822267; Thu, 19 Nov 2020 19:15:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605813322; bh=xBOcBxca72bKqLRS+dLuVtZoFEY5roI4F6617wVfhho=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JZ5/cADunQa/pilv7aE73K7zgv2+enzkoL08MCGDGb6j5swSxLGdq08YG06KdJuPK F/Ikk9M3BO+W6pQYpeE/JmygTm0RN0pRAPnoMK2QjUNJnJpeHu0ssTTO+1HQ/VdAOR 2ESa5UIG1hRMaNHOu8Ry2U3PUEMpev0OY6/lEXqU= Date: Thu, 19 Nov 2020 19:15:15 +0000 From: Will Deacon To: Mark Rutland Cc: Rob Herring , Catalin Marinas , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Jiri Olsa , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alexander Shishkin , Namhyung Kim , Raphael Gault , Jonathan Cameron , Ian Rogers , honnappa.nagarahalli@arm.com, Itaru Kitayama Subject: Re: [PATCH v4 2/9] arm64: perf: Enable pmu counter direct access for perf event on armv8 Message-ID: <20201119191515.GA4906@willie-the-truck> References: <20201001140116.651970-1-robh@kernel.org> <20201001140116.651970-3-robh@kernel.org> <20201113180633.GE44988@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201113180633.GE44988@C02TD0UTHF1T.local> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 13, 2020 at 06:06:33PM +0000, Mark Rutland wrote: > On Thu, Oct 01, 2020 at 09:01:09AM -0500, Rob Herring wrote: > > +static void armv8pmu_event_unmapped(struct perf_event *event, struct mm_struct *mm) > > +{ > > + if (!(event->hw.flags & ARMPMU_EL0_RD_CNTR)) > > + return; > > + > > + if (atomic_dec_and_test(&mm->context.pmu_direct_access)) > > + on_each_cpu_mask(mm_cpumask(mm), refresh_pmuserenr, NULL, 1); > > +} > > I didn't think we kept our mm_cpumask() up-to-date in all cases on > arm64, so I'm not sure we can use it like this. > > Will, can you confirm either way? We don't update mm_cpumask() as the cost of the atomic showed up in some benchmarks I did years ago and we've never had any need for the thing anyway because out TLB invalidation is one or all. Will