From: Marc Zyngier <maz@kernel.org>
To: Rex Nie <rex.nie@jaguarmicro.com>
Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] irqchip/gic-v3: move reading of GICR_TYPER later
Date: Tue, 26 Sep 2023 17:39:31 +0100 [thread overview]
Message-ID: <87msx8nb24.wl-maz@kernel.org> (raw)
In-Reply-To: <20230925023408.1441-1-rex.nie@jaguarmicro.com>
On Mon, 25 Sep 2023 03:34:08 +0100,
Rex Nie <rex.nie@jaguarmicro.com> wrote:
>
> This changeset will reduce one reading of GICR_TYPER register
> when any of next 2 condictions meets:
> 1. found redistributor for current cpu
> 2. single_redist is true for gic_data.redist_regions[i]
>
> Signed-off-by: Rex Nie <rex.nie@jaguarmicro.com>
> ---
> drivers/irqchip/irq-gic-v3.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> index eedfa8e9f077..d08a4773f631 100644
> --- a/drivers/irqchip/irq-gic-v3.c
> +++ b/drivers/irqchip/irq-gic-v3.c
> @@ -982,7 +982,6 @@ static int gic_iterate_rdists(int (*fn)(struct redist_region *, void __iomem *))
> }
>
> do {
> - typer = gic_read_typer(ptr + GICR_TYPER);
> ret = fn(gic_data.redist_regions + i, ptr);
> if (!ret)
> return 0;
> @@ -990,6 +989,7 @@ static int gic_iterate_rdists(int (*fn)(struct redist_region *, void __iomem *))
> if (gic_data.redist_regions[i].single_redist)
> break;
>
> + typer = gic_read_typer(ptr + GICR_TYPER);
> if (gic_data.redist_stride) {
> ptr += gic_data.redist_stride;
> } else {
I personally prefer establishing the exit condition for the loop as
early as possible. Doing it later makes this code slightly more
fragile, and I somehow doubt that you will notice the extra reads.
Can you at least quantify the improvement?
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2023-09-26 16:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 2:34 [PATCH] irqchip/gic-v3: move reading of GICR_TYPER later Rex Nie
2023-09-26 16:39 ` Marc Zyngier [this message]
2023-10-08 12:55 ` 答复: " Rex Nie
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=87msx8nb24.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rex.nie@jaguarmicro.com \
--cc=tglx@linutronix.de \
/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