Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp12349354rwb; Sat, 26 Nov 2022 07:45:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ib5lDBGZfpGmb9bSCqSYyY9BszW0Y8Dy4P5AJmwDfnxEIw1ZkBf9wo/AIfOG8g1jGi+/m X-Received: by 2002:a05:6402:f91:b0:469:82f7:5013 with SMTP id eh17-20020a0564020f9100b0046982f75013mr29195768edb.234.1669477548853; Sat, 26 Nov 2022 07:45:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669477548; cv=none; d=google.com; s=arc-20160816; b=CFcUFaFZY4fitnQu7nI/gdOtRgovE4P+EC3TrH5znF1plEA4nTAcki/IvQK0KaI/QC mP7Qg5UX8cR8iZs2uaVlDtDpPpjie9RWvZPQBP6kGBzJHghSBMtyB0xGd8o1nxDoQst6 WInl+2gSWPBr6yI744VDF0IDMkzk46ramXTJyhsFqZpV9dvgb+O8rzyaxmNTNZ5cNl5y Gej6vtKxUtKHncx8YM2Ns1XGooN19DtFL+eC4QqJ7KEOi1sLNAJ1VkJIZ2hDgu7vRB66 289MHmeKVPgyYyfOaESauanXMi8smhzCfmECEtLOF5c6Crl58L4c1ZMGioH14c1xdZqu 7Q3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=id7tRvJh2izsHqrd2WsM3X5nIPEZw18p1oSNXB+WkZw=; b=B8dUBPNZR2xGLdboKhJgDILRKrAFt1vjbOhm938BpC1gK7RH/PuSuAr1jQNV2PsNiA D4svFkLkN3uZF1uFRgHq9LbhxEh429uM/AQluiNFg+mCRC5DvrT9dLpxdh9m3GmHAF1L dxeL5U8bKN9is/0k7a6NhglGEU/HVZdlUTpj/hRV5Tv7Q+9XGPevkzYemwmwBF3FWewi hBsuPo3iJBtMOg5RX+jSJ8SzT3udCxsicn6G17nIgu2t1pMIZSc8cF+Jkcm9v0RocFqd RUQthE9fLjew0oVlPurvqTf89UzEtUWmGMkK+XxZB47hjtnOF+pQG1XgNMwt0nOH+nYX rk/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AgeGjwEi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq29-20020a1709073f1d00b007adef1dceffsi5605819ejc.677.2022.11.26.07.45.27; Sat, 26 Nov 2022 07:45:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AgeGjwEi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229564AbiKZO2f (ORCPT + 84 others); 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 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.