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=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 BD7F7C433DB for ; Mon, 29 Mar 2021 10:08:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F70B617C9 for ; Mon, 29 Mar 2021 10:08:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232057AbhC2KIC (ORCPT ); Mon, 29 Mar 2021 06:08:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:38044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232118AbhC2KHi (ORCPT ); Mon, 29 Mar 2021 06:07:38 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 7968D617C9; Mon, 29 Mar 2021 10:07:38 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lQoo4-004Pzn-Bg; Mon, 29 Mar 2021 11:07:36 +0100 Date: Mon, 29 Mar 2021 11:07:35 +0100 Message-ID: <87v99aqnmg.wl-maz@kernel.org> From: Marc Zyngier To: Jingyi Wang Cc: , , , , , Subject: Re: [RFC PATCH 3/3] arm/arm64: Use gic_ipi_send_single() to inject single IPI In-Reply-To: <20210329085210.11524-4-wangjingyi11@huawei.com> References: <20210329085210.11524-1-wangjingyi11@huawei.com> <20210329085210.11524-4-wangjingyi11@huawei.com> 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: 62.31.163.78 X-SA-Exim-Rcpt-To: wangjingyi11@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tglx@linutronix.de, wanghaibin.wang@huawei.com, yuzenghui@huawei.com, zhukeqian1@huawei.com 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 Mon, 29 Mar 2021 09:52:10 +0100, Jingyi Wang wrote: > > Currently, arm use gic_ipi_send_mask() to inject single IPI, which > make the procedure a little complex. We use gic_ipi_send_single() > instead as some other archs. > > Signed-off-by: Jingyi Wang > --- > arch/arm/kernel/smp.c | 16 +++++++++++++--- > arch/arm64/kernel/smp.c | 16 +++++++++++++--- > 2 files changed, 26 insertions(+), 6 deletions(-) > > diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c > index 74679240a9d8..369ce529cdd8 100644 > --- a/arch/arm/kernel/smp.c > +++ b/arch/arm/kernel/smp.c > @@ -534,6 +534,8 @@ static const char *ipi_types[NR_IPI] __tracepoint_string = { > }; > > static void smp_cross_call(const struct cpumask *target, unsigned int ipinr); > +static void smp_cross_call_single(const struct cpumask *target, int cpu, > + unsigned int ipinr); Why does this function need to take both a cpumask *and* a cpu, given that they represent the same thing? > > void show_ipi_list(struct seq_file *p, int prec) > { > @@ -564,14 +566,15 @@ void arch_send_wakeup_ipi_mask(const struct cpumask *mask) > > void arch_send_call_function_single_ipi(int cpu) > { > - smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC); > + smp_cross_call_single(cpumask_of(cpu), cpu, IPI_CALL_FUNC); > } > > #ifdef CONFIG_IRQ_WORK > void arch_irq_work_raise(void) > { > + int cpu = smp_processor_id(); > if (arch_irq_work_has_interrupt()) > - smp_cross_call(cpumask_of(smp_processor_id()), IPI_IRQ_WORK); > + smp_cross_call(cpumask_of(cpu), cpu, IPI_IRQ_WORK); Why isn't that a call to smp_cross_call_single()? > } > #endif > > @@ -707,6 +710,13 @@ static void smp_cross_call(const struct cpumask *target, unsigned int ipinr) > __ipi_send_mask(ipi_desc[ipinr], target); > } > > +static void smp_cross_call_single(const struct cpumask *target, int cpu, > + unsigned int ipinr) > +{ > + trace_ipi_raise_rcuidle(target, ipi_types[ipinr]); Why don't you compute the cpumask here^^? > + __ipi_send_single(ipi_desc[ipinr], cpu); > +} > + > static void ipi_setup(int cpu) > { > int i; > @@ -744,7 +754,7 @@ void __init set_smp_ipi_range(int ipi_base, int n) > > void smp_send_reschedule(int cpu) > { > - smp_cross_call(cpumask_of(cpu), IPI_RESCHEDULE); > + smp_cross_call_single(cpumask_of(cpu), cpu, IPI_RESCHEDULE); > } > > void smp_send_stop(void) > diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c > index 357590beaabb..d290b6dc5a6e 100644 > --- a/arch/arm64/kernel/smp.c > +++ b/arch/arm64/kernel/smp.c Similar comments for the arm64 side. Overall, this needs to be backed by data that indicates that there is an actual benefit for this extra complexity. Thanks, M. -- Without deviation from the norm, progress is not possible.