Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp473110ybx; Wed, 6 Nov 2019 03:39:00 -0800 (PST) X-Google-Smtp-Source: APXvYqykV9E1lzOOSxHF/cP1IqrpJe/3fYOKrJw1PNdevrHbk7056PI31jVw65bptZ9M4dUvV1rA X-Received: by 2002:a17:906:8697:: with SMTP id g23mr28159979ejx.177.1573040339896; Wed, 06 Nov 2019 03:38:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573040339; cv=none; d=google.com; s=arc-20160816; b=pmMwo4MzsLdMS2MJvMy/LTGN8TYN8BwnIOQ7v7Ogp6WEs1pHHd9MQHZsl7HxJOxCv5 gsvZ4DjLoD89UBihLupjqy7Jhm0wvgT9dNs+1W4jM99P+d3l7U/8WBB/lJH9Hz8l+QLr kuasqLf9MfpS4rPSPRY17R6o1xrfBNV3C7n0XBqyKpwvzpePIof985M7V9O6cITw3MDg 0lBlJi0Z8V2Td5IgnIFUvm2wBCW/i/pzCdTLcqT6tKPCmUVUmf5wM2vvKZtPFn5ypvXr GwfkYTfWUi7W97/GYE2UtFis+qvCneP6QMIK0oCEe7hE6q1iv/VdbqVS1xXeuPzoMiJa 2i/A== 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; bh=KJPTrZbLtwzTSG/zeYELwp4OR38q+9i/Pv45Kl659K0=; b=mDRlGRsOm8iXvf3Lp6S6HVI+493JK2+p5FpaeE9E6pTeNLKBFnhTtwz4t08A/isY+l 0KBWsskwqwuAmueuIUN5edp05hedhDnSSBw09Y5xR+M2BEvX3oy8gfn5ZIgxu7826bRz jN4R2NswtsFa1ks1rjrVXJHF8XQBTOiEJYl8JgJYK+C3+iUvKojM4e1YCoj91jccRYW1 0gCjTCzLMO/CxPFgBkLY/EXEPqptgduf8x7pTbd3e3IZ55oFSQD7UathAyDItgb5q46u ObQKKyZgTrRhWTxhXG5Yxl8VWYbludpXkK3ulXcpT7orQewGbapWRiKnXTrJ1SgWahWx r1HA== 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 l15si10833182ejc.27.2019.11.06.03.38.36; Wed, 06 Nov 2019 03:38:59 -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 S1730271AbfKFLhf (ORCPT + 99 others); Wed, 6 Nov 2019 06:37:35 -0500 Received: from foss.arm.com ([217.140.110.172]:38380 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfKFLhf (ORCPT ); Wed, 6 Nov 2019 06:37:35 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 48C0A7A7; Wed, 6 Nov 2019 03:37:34 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0D70B3F6C4; Wed, 6 Nov 2019 03:37:32 -0800 (PST) Date: Wed, 6 Nov 2019 11:37:30 +0000 From: Mark Rutland To: Ganapatrao Prabhakerrao Kulkarni Cc: "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "peterz@infradead.org" , "mingo@redhat.com" , "will@kernel.org" , "corbet@lwn.net" , "gklkml16@gmail.com" Subject: Re: [PATCH 2/2] Thunderx2, uncore: Add workaround for ThunderX2 erratum 221 Message-ID: <20191106113730.GB50610@lakrids.cambridge.arm.com> References: <1573002091-9744-1-git-send-email-gkulkarni@marvell.com> <1573002091-9744-3-git-send-email-gkulkarni@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1573002091-9744-3-git-send-email-gkulkarni@marvell.com> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 06, 2019 at 01:01:41AM +0000, Ganapatrao Prabhakerrao Kulkarni wrote: > When perf tried with more events than the PMU supported counters, the perf > core uses event multiplexing to accommodate all events. This results in > burst of PMU register read and writes and causes the system hang, when > executed along with the CPU intensive applications. Can you please elaborate on how a burst of PMU reads/writes leads to a hang? I see the PMU counts DMC/L3C events -- does this occur under heavy /cpu/ load, or heavy /memory/ load? Does this only happen with a specific timing of reads/writes, or is it always possible that accessing the PMU can trigger a lockup, and it's just more likely when the PMU is accessed more often? Thanks, Mark. > > Adding software workaround by disabling event multiplexing. > > Signed-off-by: Ganapatrao Prabhakerrao Kulkarni > --- > Documentation/admin-guide/perf/thunderx2-pmu.rst | 9 +++++++++ > drivers/perf/thunderx2_pmu.c | 3 ++- > 2 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/Documentation/admin-guide/perf/thunderx2-pmu.rst b/Documentation/admin-guide/perf/thunderx2-pmu.rst > index 08e33675853a..fff65382c887 100644 > --- a/Documentation/admin-guide/perf/thunderx2-pmu.rst > +++ b/Documentation/admin-guide/perf/thunderx2-pmu.rst > @@ -40,3 +40,12 @@ Examples:: > uncore_l3c_0/read_hit/,\ > uncore_l3c_0/inv_request/,\ > uncore_l3c_0/inv_hit/ sleep 1 > + > +ThunderX2 erratum 221: > +When perf tried with more events than the PMU supported counters, the perf core > +uses event multiplexing to accommodate all events. This results in burst of PMU > +registers read and write and leading to system hang when executed along with > +CPU intensive applications. > + > + > +Disabling PMUs event multiplexing capability. > diff --git a/drivers/perf/thunderx2_pmu.c b/drivers/perf/thunderx2_pmu.c > index 43d76c85da56..c443be8bd449 100644 > --- a/drivers/perf/thunderx2_pmu.c > +++ b/drivers/perf/thunderx2_pmu.c > @@ -563,7 +563,8 @@ static int tx2_uncore_pmu_register( > .start = tx2_uncore_event_start, > .stop = tx2_uncore_event_stop, > .read = tx2_uncore_event_read, > - .capabilities = PERF_PMU_CAP_NO_EXCLUDE, > + .capabilities = PERF_PMU_CAP_NO_EXCLUDE | > + PERF_PMU_CAP_NO_MUX_EVENTS, > }; > > tx2_pmu->pmu.name = devm_kasprintf(dev, GFP_KERNEL, > -- > 2.17.1 >