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.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 A2CB3C4360F for ; Thu, 4 Apr 2019 10:47:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 70C4D204EC for ; Thu, 4 Apr 2019 10:47:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SkYjYMUc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70C4D204EC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ME/UtFVT9G7EmwuAvNCts6mKv8JRvzSNaiHbd0cdJTc=; b=SkYjYMUcJUMCrB4RsjhZNdurZ D775Ply1q+Y7STMDTm6Nmq9XK+7P7SIiCzCWhXdQxcezD+RJYgqW8kypDIlZw59e3LH7ctvxew1aw +6LhGq16XVe5+NhcU+3PFQafE0WAp7GvUq3K2mXF8Ip4jaWpZR5Wv4LhIxZ8X8MAa8roVtk4IjLtB MJiiQlm5oJxYkmHUcbO9wMZZLzeVxf9W3a0aktPcNPRg7lEztZNBxSIxbvW1NM9H5uw00eFtgyUaM fwcZmv+/g6YR606QKGudfcFVatvjA2qw+X60iWBeuEZpdt7DMucSPnsfhZVbVBe0azPxTmlme/spc /w3VX4UqQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBztZ-0000BB-L0; Thu, 04 Apr 2019 10:46:57 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBztW-0000Ap-Sa for linux-arm-kernel@lists.infradead.org; Thu, 04 Apr 2019 10:46:56 +0000 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 E660CA78; Thu, 4 Apr 2019 03:46:53 -0700 (PDT) Received: from [10.1.196.93] (en101.cambridge.arm.com [10.1.196.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4734E3F557; Thu, 4 Apr 2019 03:46:52 -0700 (PDT) Subject: Re: [PATCH v2 2/2] perf/arm-ccn: Remove broken race mitigation To: robin.murphy@arm.com, will.deacon@arm.com References: <49087b08f2685bed112dfc90b97ae59b8de8f6cf.1554310292.git.robin.murphy@arm.com> From: Suzuki K Poulose Message-ID: <2cbf5e2c-8a79-f2da-680f-ce20792ae2af@arm.com> Date: Thu, 4 Apr 2019 11:46:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <49087b08f2685bed112dfc90b97ae59b8de8f6cf.1554310292.git.robin.murphy@arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190404_034654_926623_470F49EB X-CRM114-Status: GOOD ( 23.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, peterz@infradead.org, bigeasy@linutronix.de, linux-kernel@vger.kernel.org, clabbe.montjoie@gmail.com, tglx@linutronix.de, Meng.Li@windriver.com, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Robin, On 03/04/2019 18:10, Robin Murphy wrote: > Like arm-cci, arm-ccn has the same issue of disabling preemption around > operations which can take mutexes. Again, remove the definite bug by > simply not trying to fight the theoretical races. And since we are > touching the hotplug handling code, take the opportunity to streamline > it, as there's really no need to store a full-sized cpumask to keep > track of a single CPU ID. > > Signed-off-by: Robin Murphy > --- > drivers/perf/arm-ccn.c | 23 +++++++++++------------ > 1 file changed, 11 insertions(+), 12 deletions(-) > > diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c > index 2ae76026e947..a0214308b0cd 100644 > --- a/drivers/perf/arm-ccn.c > +++ b/drivers/perf/arm-ccn.c > /* Pick one CPU which we will use to collect data from CCN... */ > - cpumask_set_cpu(get_cpu(), &ccn->dt.cpu); > + ccn->dt.cpu = raw_smp_processor_id(); > > /* Also make sure that the overflow interrupt is handled by this CPU */ > if (ccn->irq) { > - err = irq_set_affinity_hint(ccn->irq, &ccn->dt.cpu); > + err = irq_set_affinity_hint(ccn->irq, cpumask_of(ccn->dt.cpu)); > if (err) { > dev_err(ccn->dev, "Failed to set interrupt affinity!\n"); > goto error_set_affinity; > } > } > > + cpuhp_state_add_instance_nocalls(CPUHP_AP_PERF_ARM_CCN_ONLINE, > + &ccn->dt.node); > + > err = perf_pmu_register(&ccn->dt.pmu, name, -1); > if (err) > goto error_pmu_register; Should we not remove the above instance, in case we fail to register the PMU ? Similarly for the CCI driver, we may have to reset the g_cci_pmu if we fail. Cheers Suzuki > > - cpuhp_state_add_instance_nocalls(CPUHP_AP_PERF_ARM_CCN_ONLINE, > - &ccn->dt.node); > - put_cpu(); > return 0; > > error_pmu_register: > error_set_affinity: > - put_cpu(); > error_choose_name: > ida_simple_remove(&arm_ccn_pmu_ida, ccn->dt.id); > for (i = 0; i < ccn->num_xps; i++) > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel