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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35E91C77B7A for ; Fri, 2 Jun 2023 11:26:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235077AbjFBL0H (ORCPT ); Fri, 2 Jun 2023 07:26:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234920AbjFBL0G (ORCPT ); Fri, 2 Jun 2023 07:26:06 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4EA411AB; Fri, 2 Jun 2023 04:26:02 -0700 (PDT) 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 79CBB1063; Fri, 2 Jun 2023 04:26:47 -0700 (PDT) Received: from [10.57.84.31] (unknown [10.57.84.31]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A75AB3F7BD; Fri, 2 Jun 2023 04:26:00 -0700 (PDT) Message-ID: <4bc59e32-a3cc-4e8c-0264-e509aadeb534@arm.com> Date: Fri, 2 Jun 2023 12:25:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v2 2/5] perf: arm_cspmu: Support shared interrupts Content-Language: en-GB To: Ilkka Koskinen Cc: Jonathan Corbet , Will Deacon , Mark Rutland , Besar Wicaksono , Suzuki K Poulose , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20230601030144.3458136-1-ilkka@os.amperecomputing.com> <20230601030144.3458136-3-ilkka@os.amperecomputing.com> <77b19b2d-a84e-eb13-db38-78cb34a444a8@os.amperecomputing.com> From: Robin Murphy In-Reply-To: <77b19b2d-a84e-eb13-db38-78cb34a444a8@os.amperecomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On 2023-06-02 08:04, Ilkka Koskinen wrote: > > Hi Robin, > > On Thu, 1 Jun 2023, Robin Murphy wrote: >> On 2023-06-01 04:01, Ilkka Koskinen wrote: >>> Some of the PMUs may share the interrupt. Support them by >>> setting IRQF_SHARED >> >> This has the usual problem of allowing any PMU instance to move the >> IRQ affinity to a different CPU without also migrating all the other >> PMU contexts, and thus breaking perf core's assumptions of mutual >> exclusion. > > I see, I wasn't aware of such an assumption. Sounds like there isn't > necessarily an easy and clean solution for the shared interrupt case. I > drop the patch and get back on the issue if we come up with something > reasonable later. What comes to mind is factoring out the explicit interrupt-sharing machinery that we wrote to solve this problem in arm_dmc620_pmu, or possibly trying to do something with IRQ affinity notifiers (however, I recall looking into that a while ago and it didn't seem like they actually interact with CPU hotplug in the way we'd want). Thanks, Robin. 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E7BB9C7EE29 for ; Fri, 2 Jun 2023 11:26:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZtqwSGm1Zb8jpQjqP4xd/RyUy9JnNMqkizuFHffmTDs=; b=G87ZVWTdp02gpe uUHynJFd5nTCG9nW7iSLwpqBUK2pdlSDrlOdOa9ECnlZZCcMf1v4KGeIbEt8ufY4kzp/EjNOzWZUL vRMiZlsybTuW9VDINO2WAChHm4+QM7nirmok6QYC+qKqFniXbPZLtPiOY2Ho43+zMh6GOoefLWtTx 7xvwi5CzwL4ebKuyvhdXFaZPQYQ5hQn2yZMNaHAQIJ2jPthv/JPbUQ0J2mvVyG+jD1og3xgZ6AsU1 RKqYcsm9NkVoyWWxICO9UfSSEw0h9FLka/EtT8HC1CWszaaBo6ThJKwP16qFb2RX/sg5Faeum1qXC Xc+hxokvSg7X/aIMiWoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q52v8-006lbT-31; Fri, 02 Jun 2023 11:26:14 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q52v2-006la4-2q for linux-arm-kernel@lists.infradead.org; Fri, 02 Jun 2023 11:26:12 +0000 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 79CBB1063; Fri, 2 Jun 2023 04:26:47 -0700 (PDT) Received: from [10.57.84.31] (unknown [10.57.84.31]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A75AB3F7BD; Fri, 2 Jun 2023 04:26:00 -0700 (PDT) Message-ID: <4bc59e32-a3cc-4e8c-0264-e509aadeb534@arm.com> Date: Fri, 2 Jun 2023 12:25:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v2 2/5] perf: arm_cspmu: Support shared interrupts Content-Language: en-GB To: Ilkka Koskinen Cc: Jonathan Corbet , Will Deacon , Mark Rutland , Besar Wicaksono , Suzuki K Poulose , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20230601030144.3458136-1-ilkka@os.amperecomputing.com> <20230601030144.3458136-3-ilkka@os.amperecomputing.com> <77b19b2d-a84e-eb13-db38-78cb34a444a8@os.amperecomputing.com> From: Robin Murphy In-Reply-To: <77b19b2d-a84e-eb13-db38-78cb34a444a8@os.amperecomputing.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230602_042608_984837_F1DDB945 X-CRM114-Status: GOOD ( 12.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2023-06-02 08:04, Ilkka Koskinen wrote: > > Hi Robin, > > On Thu, 1 Jun 2023, Robin Murphy wrote: >> On 2023-06-01 04:01, Ilkka Koskinen wrote: >>> Some of the PMUs may share the interrupt. Support them by >>> setting IRQF_SHARED >> >> This has the usual problem of allowing any PMU instance to move the >> IRQ affinity to a different CPU without also migrating all the other >> PMU contexts, and thus breaking perf core's assumptions of mutual >> exclusion. > > I see, I wasn't aware of such an assumption. Sounds like there isn't > necessarily an easy and clean solution for the shared interrupt case. I > drop the patch and get back on the issue if we come up with something > reasonable later. What comes to mind is factoring out the explicit interrupt-sharing machinery that we wrote to solve this problem in arm_dmc620_pmu, or possibly trying to do something with IRQ affinity notifiers (however, I recall looking into that a while ago and it didn't seem like they actually interact with CPU hotplug in the way we'd want). Thanks, Robin. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel