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 2C452C4321E for ; Sat, 26 Nov 2022 14:28:51 +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:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6Qz0My0GUg1dBDVTvrGaMUGw7Htwhc5Ojd+NXROC7BU=; b=XR3IrXh1vYH8qB a6OYhdwRbLNPN2MooJBVf4saxEirQ54ig4sqEflrMQaqOGsmkyul2mdgs0TYZSWoEcctXG3O5dtDX sb2fAjruEhqLoCvsuYPggiGKmm1sLhrDYHCwddG66Z29UKV92CukOlLb3N2yj9SJibtLtC3xfdSz6 mQFJZ5s5yMVkT+bfib8nmyH5vsOm49bT/AidZm4kU0w+OSXTk8SfUVhAczUMmswu2l0x55CpUQYkA Mt2xBWV/yGR4YePuuOdS0GcYrlOz7ubbhL4AhcFDNXpSdB6Dtj38EHC9Rv53Gepp7KSahDaB5VqD/ jVWg9kHpQrfTL2V5iiBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oywAX-006ZFM-Er; Sat, 26 Nov 2022 14:28:37 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oywAS-006ZEH-Va for linux-riscv@lists.infradead.org; Sat, 26 Nov 2022 14:28:34 +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 ams.source.kernel.org (Postfix) with ESMTPS id 549FCB80937; 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") 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221126_062833_342043_41C2694B X-CRM114-Status: GOOD ( 30.48 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv