linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Jingyi Wang <wangjingyi11@huawei.com>
Cc: <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <tglx@linutronix.de>,
	<wanghaibin.wang@huawei.com>, <yuzenghui@huawei.com>,
	<zhukeqian1@huawei.com>
Subject: Re: [RFC PATCH 3/3] arm/arm64: Use gic_ipi_send_single() to inject single IPI
Date: Mon, 29 Mar 2021 11:07:35 +0100	[thread overview]
Message-ID: <87v99aqnmg.wl-maz@kernel.org> (raw)
In-Reply-To: <20210329085210.11524-4-wangjingyi11@huawei.com>

On Mon, 29 Mar 2021 09:52:10 +0100,
Jingyi Wang <wangjingyi11@huawei.com> 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 <wangjingyi11@huawei.com>
> ---
>  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.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-03-29 21:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29  8:52 [RFC PATCH 0/3] arm: Some IPI injection optimization Jingyi Wang
2021-03-29  8:52 ` [RFC PATCH 1/3] irqchip/gic-v3: Make use of ICC_SGI1R IRM bit Jingyi Wang
2021-03-29  9:55   ` Marc Zyngier
2021-03-29 10:38     ` Jingyi Wang
2021-03-29 11:28       ` Marc Zyngier
2021-03-29  8:52 ` [RFC PATCH 2/3] irqchip/gic-v3: Implement gic_ipi_send_single() Jingyi Wang
2021-03-29  8:52 ` [RFC PATCH 3/3] arm/arm64: Use gic_ipi_send_single() to inject single IPI Jingyi Wang
2021-03-29 10:07   ` Marc Zyngier [this message]
2021-03-29 11:03     ` Jingyi Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v99aqnmg.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wanghaibin.wang@huawei.com \
    --cc=wangjingyi11@huawei.com \
    --cc=yuzenghui@huawei.com \
    --cc=zhukeqian1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).