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 A2C48C4321E for ; Sat, 26 Nov 2022 14:28:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229582AbiKZO2f (ORCPT ); Sat, 26 Nov 2022 09:28:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiKZO2d (ORCPT ); Sat, 26 Nov 2022 09:28:33 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85A8F1A827 for ; Sat, 26 Nov 2022 06:28:32 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 3AB3FB80159 for ; Sat, 26 Nov 2022 14:28:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 028C6C433C1; Sat, 26 Nov 2022 14:28:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669472910; bh=5ajgFZi4SmoYha16KEs1dhL0q/O9X7fn18AlzYpYO/8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AgeGjwEi63Doabk4rXHAtNmEhbtwfb6ve/0TwP2Ce+oIXxBhP+yIBGKX+pfvfaT/q uzldSOLudko3FQnnzo5poPVu7avDhcoRTE+ORIyrjLaaOijYQHPN2Uwk/onJD8zmb7 YT094YAEGVUMiZgwUcKeUYtywYqVV3NbheOdKm1BVIKk39AR5VSEDjsxkSMl/tpQhD pIUHhmfAPsgdD8LtIB79pykoU+9BYyPNEjY9+GaQfjnOpUVpQ1PnnxbLJ14N7Rquy4 rRNnPsdaaWOwAOO+ZyfCyb4Le3+Rsj5nm9SRGAu+GJjl0mXOghaZrAkP6ttbkbyefn lHoOvm8zKAf0Q== Received: from 82-132-228-24.dab.02.net ([82.132.228.24] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oywAN-008j2K-Hd; Sat, 26 Nov 2022 14:28:27 +0000 Date: Sat, 26 Nov 2022 14:28:14 +0000 Message-ID: <87sfi5u6wx.wl-maz@kernel.org> From: Marc Zyngier To: Anup Patel Cc: Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Daniel Lezcano , Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v11 3/7] genirq: Add mechanism to multiplex a single HW IPI In-Reply-To: References: <20221114093904.1669461-1-apatel@ventanamicro.com> <20221114093904.1669461-4-apatel@ventanamicro.com> <87y1rxubty.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 82.132.228.24 X-SA-Exim-Rcpt-To: apatel@ventanamicro.com, palmer@dabbelt.com, paul.walmsley@sifive.com, tglx@linutronix.de, daniel.lezcano@linaro.org, atishp@atishpatra.org, Alistair.Francis@wdc.com, anup@brainfault.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 26 Nov 2022 13:31:46 +0000, Anup Patel wrote: > > On Sat, Nov 26, 2022 at 6:12 PM Marc Zyngier wrote: > > > > On Mon, 14 Nov 2022 09:39:00 +0000, > > Anup Patel wrote: > > > > > > +struct ipi_mux_control { > > > + void *data; > > > + unsigned int nr; > > > > Honestly, I think we can get rid of this. The number of IPIs Linux > > uses is pretty small, and assuming a huge value (like 32) would be > > enough. It would save looking up this value on each IPI handling. > > I had kept in-case some driver wanted to create fewer (< 32) > muxed IPIs. I'm fine with being able to specifying the max, but I'm not sure there is a need to keep track of it any further. Certainly, the overhead of loading this value on each IPI could be removed. On most architecture, for_each_set_bit() and co and better optimised with a fixed number of bits. > > > +static const struct irq_chip ipi_mux_chip = { > > > + .name = "IPI Mux", > > > + .irq_mask = ipi_mux_mask, > > > + .irq_unmask = ipi_mux_unmask, > > > + .ipi_send_mask = ipi_mux_send_mask, > > > +}; > > > > I really think this could either be supplied by the irqchip, or > > somehow patched to avoid the pointless imux->ops->ipi_mux_send > > indirection. Pointer chasing hurts. > > Once we remove ipi_mux_pre/post_handle() callbacks, the > "ops" will be pointless and we will be able to remove one level > of indirection here. > > We certainly need a mux irqchip to implement the > mask/unmask semantics for muxed IPIs. I'm not disputing that last point. > > > +/** > > > + * ipi_mux_create - Create virtual IPIs multiplexed on top of a single > > > + * parent IPI. > > > + * @parent_virq: virq of the parent per-CPU IRQ > > > + * @nr_ipi: number of virtual IPIs to create. This should > > > + * be <= BITS_PER_TYPE(int) > > > + * @ops: multiplexing operations for the parent IPI > > > + * @data: opaque data used by the multiplexing operations > > > > What is the use for data? If anything, that data should be passed via > > the mux interrupt. But the whole point of this is to make the mux > > invisible. So this whole 'data' business is a mystery to me. > > This is added only to pass back driver data in ipi_mux_send(). Again, what is the purpose of such data? If you need per-interrupt data, this should be provided by the requester of the interrupt. M. -- Without deviation from the norm, progress is not possible.