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 0C948C00145 for ; Mon, 12 Dec 2022 14:30:30 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=3Du6HdstGlei8HsTD3GPkD3p1vxbkPgpFESFZlO3oaY=; b=R60BGFgKq+uhMc jx6y+kGVDnm74FYLTDbAskeweCwVhwHMPmluOeqJlmhIjbf+W8wYdmQOPSxXzvEpY41DSPZP5Zekh 4einn8F2+iKtT+nCsTpt3JhpbB7uPehSEh/x5dhu8iWkqKEEXxGIszn+KGrKmlwlVvWOumuYvVaDI kTeLBVArUISZeJNQnY6P6qfbijp4HCRx4cJkbYNaNdgqoJX+tkqZB20ZaIPInwspkaGFmHZsaIJgJ +33XlA7G3IYTGEfHRE8S0TS8By3pqz+qdituqurNKLefnqSbMyhovRyVMYvFep6naurgGR7CNgZsD h+YGw5rFytXi30/DfFiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p4jnz-00HVev-1e; Mon, 12 Dec 2022 14:29:19 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p4jnu-00HVa8-Qm for linux-arm-kernel@lists.infradead.org; Mon, 12 Dec 2022 14:29:16 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 70D876111A; Mon, 12 Dec 2022 14:29:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9C71C433D2; Mon, 12 Dec 2022 14:29:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670855352; bh=Rus4CdOiiPn7zFAosG9gmqEHn/vU+rdHuj+PuYGnEXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PAmAzWWkhYpob2WNGn5P3l87YkLVt2J+gDnA5q/PAfUReD/3Y5Vfjmc1YYMg6jC9P 5XtNdReR5EbdW6ySCZZALPLA1rfxWksQNIIcp6tLuWJXyuK205G5KrEtlT6nN8WRmL JdoDFb8bS1qXi/eVjlTIjt0TnPGii1Zmrn9bH053ZbO4EGWlr7XlUKZOmb3zHQHht8 gxZr0BfBNHuYM5dQw82FJTt+qXG47m1khF+auqnwwvKOYdM3gOGN1BZ1aohHFWsLc0 0x2BdSUFsBoekH48ZIviTY0edLXP/AUtlUgaYTOFA+KQ93wsoNIyEoo/84u2kkIeRX fPWG7s6x4m6JQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1p4joF-0007Mc-B7; Mon, 12 Dec 2022 15:29:36 +0100 Date: Mon, 12 Dec 2022 15:29:35 +0100 From: Johan Hovold To: Thomas Gleixner Cc: Johan Hovold , Marc Zyngier , x86@kernel.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 19/19] irqdomain: Switch to per-domain locking Message-ID: References: <20221209140150.1453-1-johan+linaro@kernel.org> <20221209140150.1453-20-johan+linaro@kernel.org> <87mt7sbtf9.ffs@tglx> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87mt7sbtf9.ffs@tglx> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221212_062914_975732_9BCB40C7 X-CRM114-Status: GOOD ( 18.94 ) 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-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 Mon, Dec 12, 2022 at 03:14:34PM +0100, Thomas Gleixner wrote: > On Fri, Dec 09 2022 at 15:01, Johan Hovold wrote: > > The IRQ domain structures are currently protected by the global > > irq_domain_mutex. Switch to using more fine-grained per-domain locking, > > which may potentially speed up parallel probing somewhat. > > > > Note that the domain lock of the root domain (innermost domain) must be > > used for hierarchical domains. For non-hierarchical domain (as for root > > domains), the new root pointer is set to the domain itself so that > > domain->root->mutex can be used in shared code paths. > > > > Also note that hierarchical domains should be constructed using > > irq_domain_create_hierarchy() (or irq_domain_add_hierarchy()) to avoid > > poking at irqdomain internals. > > While I agree in principle, this change really makes me nervous. > > Any fail in setting up domain->root correctly, e.g. by not using > irq_domain_create_hierarchy(), cannot be detected and creates nasty to > debug race conditions. > > So we need some debug mechanism which allows to validate that > domain->root is set up correctly when domain->parent != NULL. Lockdep will catch that due to the lockdep_assert_held(&domain->root->mutex); I added to irq_domain_set_mapping() and which is is called for each (inner) domain in a hierarchy when allocating an IRQ. Johan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel