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=-5.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 79742C433E0 for ; Wed, 24 Jun 2020 12:50:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F7BE2076E for ; Wed, 24 Jun 2020 12:50:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593003055; bh=+Kf1QO6wgC2hEGOUt0o6CDJuByakQhbWMS2qb5q4egs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=Bv/mVbyH3JP/U7YnuijcZYrNxOLM2J6ViPiQB3jNNPfF4sUKtdy6Ml+xgBMpFDNDO yUPKpw9CUFd3oTnwiGixZ91P1aIPR6nIr9dYGGv2NOxQtpbB4X/rsUx3JvCY+SQkoh 8kvDJnYBB5xVuyyldDvtRUXiGb3k3DqTme/i9vCo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390889AbgFXMuy (ORCPT ); Wed, 24 Jun 2020 08:50:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:42576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390845AbgFXMuu (ORCPT ); Wed, 24 Jun 2020 08:50:50 -0400 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 02E2620663; Wed, 24 Jun 2020 12:50:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593003050; bh=+Kf1QO6wgC2hEGOUt0o6CDJuByakQhbWMS2qb5q4egs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KexdEXajkBXXkeJHwCLviB9dTD51SZqHb8XJi6GVgBXNgsjULPBftkc0BH5bpeWLE E8ijx24xCKlZTug1Mtc61oVCw2GfLQGPm4rpURBMcYk7gsgmS1LgtS4pFkij1G+v4C Ctyam3S+A5Wq516L02qIULTEP32y9k3tu/CqGMqc= Date: Wed, 24 Jun 2020 13:50:46 +0100 From: Will Deacon To: Robin Murphy Cc: mark.rutland@arm.com, tuanphan@os.amperecomputing.com, john.garry@huawei.com, linux-kernel@vger.kernel.org, shameerali.kolothum.thodi@huawei.com, harb@amperecomputing.com, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH] perf/smmuv3: Fix shared interrupt handling Message-ID: <20200624125045.GC6270@willie-the-truck> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2020 at 12:48:14PM +0100, Robin Murphy wrote: > On 2020-04-08 17:49, Robin Murphy wrote: > > IRQF_SHARED is dangerous, since it allows other agents to retarget the > > IRQ's affinity without migrating PMU contexts to match, breaking the way > > in which perf manages mutual exclusion for accessing events. Although > > this means it's not realistically possible to support PMU IRQs being > > shared with other drivers, we *can* handle sharing between multiple PMU > > instances with some explicit affinity bookkeeping and manual interrupt > > multiplexing. > > > > RCU helps us handle interrupts efficiently without having to worry about > > fine-grained locking for relatively-theoretical race conditions with the > > probe/remove/CPU hotplug slow paths. The resulting machinery ends up > > looking largely generic, so it should be feasible to factor out with a > > "system PMU" base class for similar multi-instance drivers. > > > > Signed-off-by: Robin Murphy > > --- > > > > RFC because I don't have the means to test it, and if the general > > approach passes muster then I'd want to tackle the aforementioned > > factoring-out before merging anything anyway. > > Any comments on whether it's worth pursuing this? Sorry, I don't really get the problem that it's solving. Is there a crash log somewhere I can look at? If all the users of the IRQ are managed by this driver, why is IRQF_SHARED dangerous? Will 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=-5.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 3FA50C433E0 for ; Wed, 24 Jun 2020 12:52:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 0E43A20663 for ; Wed, 24 Jun 2020 12:52:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AllHWmbY"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="KexdEXaj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E43A20663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4+EZ+Uh6ubsq96K7EQk2FvUQunIMah2zY3O1HJiqF5Y=; b=AllHWmbYlNQU5FS0rGriis8jW eiNN9xkPgaazmtb5osd3DKgAZLjBWkuHG9kgcojwkp7XQLhr52HOA5QwbdnbvcHlkd7vkvhVFZASU 2/Av7zLruoe+RaysQPPQxN1nI45FXfksreNpDVIS/CUqj9RvguxoZhkyQ+VX9zkwKOALh9evlRWn/ yN+kw9qbZ/yWKhxAoSLshUw2l+i14pq7NucmJ15blXgASBXhHWZD8m3dtTi3ow6C9ncc68eM8kMrG ZD+PoQc65AeI3WnsA8wPVDIns/T2NPLsyHIDT4AzpCPcJ03u1s+a+SOuNCdlySvzB0P2QKODPqrJH 9E6B6k83w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo4rd-0004nG-RJ; Wed, 24 Jun 2020 12:50:53 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo4rb-0004mM-13 for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 12:50:51 +0000 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 02E2620663; Wed, 24 Jun 2020 12:50:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593003050; bh=+Kf1QO6wgC2hEGOUt0o6CDJuByakQhbWMS2qb5q4egs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KexdEXajkBXXkeJHwCLviB9dTD51SZqHb8XJi6GVgBXNgsjULPBftkc0BH5bpeWLE E8ijx24xCKlZTug1Mtc61oVCw2GfLQGPm4rpURBMcYk7gsgmS1LgtS4pFkij1G+v4C Ctyam3S+A5Wq516L02qIULTEP32y9k3tu/CqGMqc= Date: Wed, 24 Jun 2020 13:50:46 +0100 From: Will Deacon To: Robin Murphy Subject: Re: [RFC PATCH] perf/smmuv3: Fix shared interrupt handling Message-ID: <20200624125045.GC6270@willie-the-truck> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, tuanphan@os.amperecomputing.com, john.garry@huawei.com, linux-kernel@vger.kernel.org, shameerali.kolothum.thodi@huawei.com, harb@amperecomputing.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 24, 2020 at 12:48:14PM +0100, Robin Murphy wrote: > On 2020-04-08 17:49, Robin Murphy wrote: > > IRQF_SHARED is dangerous, since it allows other agents to retarget the > > IRQ's affinity without migrating PMU contexts to match, breaking the way > > in which perf manages mutual exclusion for accessing events. Although > > this means it's not realistically possible to support PMU IRQs being > > shared with other drivers, we *can* handle sharing between multiple PMU > > instances with some explicit affinity bookkeeping and manual interrupt > > multiplexing. > > > > RCU helps us handle interrupts efficiently without having to worry about > > fine-grained locking for relatively-theoretical race conditions with the > > probe/remove/CPU hotplug slow paths. The resulting machinery ends up > > looking largely generic, so it should be feasible to factor out with a > > "system PMU" base class for similar multi-instance drivers. > > > > Signed-off-by: Robin Murphy > > --- > > > > RFC because I don't have the means to test it, and if the general > > approach passes muster then I'd want to tackle the aforementioned > > factoring-out before merging anything anyway. > > Any comments on whether it's worth pursuing this? Sorry, I don't really get the problem that it's solving. Is there a crash log somewhere I can look at? If all the users of the IRQ are managed by this driver, why is IRQF_SHARED dangerous? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel