archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <>
To: Christophe Leroy <>
	Thomas Bogendoerfer <>,
	Yoshinori Sato <>,
	Haojian Zhuang <>,
	Rich Felker <>,
	Thomas Gleixner <>,
	Robert Jarzmik <>,
	Daniel Mack <>
Subject: Re: [PATCH 1/9] irqdomain: Reimplement irq_linear_revmap() with irq_find_mapping()
Date: Tue, 06 Apr 2021 13:12:55 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>


On Tue, 06 Apr 2021 12:21:33 +0100,
Christophe Leroy <> wrote:
> Le 06/04/2021 à 11:35, Marc Zyngier a écrit :
> > irq_linear_revmap() is supposed to be a fast path for domain
> > lookups, but it only exposes low-level details of the irqdomain
> > implementation, details which are better kept private.
> Can you elaborate with more details ?

Things like directly picking into the revmap are positively awful, and
doesn't work if the domain has been constructed using the radix
tree. Which on its own is totally broken, because things like
irq_domain_create_hierarchy() will pick an implementation or the

> > 
> > The *overhead* between the two is only a function call and
> > a couple of tests, so it is likely that noone can show any
> > meaningful difference compared to the cost of taking an
> > interrupt.
> Do you have any measurement ?

I did measure things on arm64, and couldn't come up with any
difference other than noise.

> Can you make the "likely" a certitude ?

Of course not. You can always come up with an artificial CPU
implementation that has a very small exception entry overhead, and a
ridiculously slow memory subsystem. Do I care about these? No.

If you can come up with realistic platforms that show a regression
with this patch, I'm all ears.

> > 
> > Reimplement irq_linear_revmap() with irq_find_mapping()
> > in order to preserve source code compatibility, and
> > rename the internal field for a measure.
> This is in complete contradiction with commit
> At that time, irq_linear_revmap() was less complex than what
> irq_find_mapping() is today, and nevertheless it was considered worth
> restoring in as a fast path. What has changed since then ?

Over 8 years? Plenty. The use of irqdomains has been generalised, we
have domain hierarchies, and if anything, this commit introduces the
buggy behaviour I was mentioning above. I also don't see any mention
of actual performance in that commit.

And if we're worried about a fast path, being able to directly cache
the irq_data in the revmap, hence skipping the irq_desc lookup that
inevitable follows, is a much more interesting prospect than the "get
useless data quick" that irq_linear_revmap() implements.

This latter optimisation is what I am after.

> Can you also explain the reason for the renaming of "linear_revmap"
> into "revmap" ? What is that "measure" ?

To catch the potential direct use of the reverse map field.



Without deviation from the norm, progress is not possible.

  reply	other threads:[~2021-04-06 12:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06  9:35 [PATCH 0/9] Cleaning up some of the irqdomain features Marc Zyngier
2021-04-06  9:35 ` [PATCH 1/9] irqdomain: Reimplement irq_linear_revmap() with irq_find_mapping() Marc Zyngier
2021-04-06 11:21   ` Christophe Leroy
2021-04-06 12:12     ` Marc Zyngier [this message]
2021-04-06  9:35 ` [PATCH 2/9] ARM: PXA: Kill use of irq_create_strict_mappings() Marc Zyngier
2021-04-26 22:39   ` Guenter Roeck
2021-04-27  8:30     ` Marc Zyngier
2021-04-27 12:56       ` Guenter Roeck
2021-04-06  9:35 ` [PATCH 3/9] irqchip/jcore-aic: " Marc Zyngier
2021-04-06  9:35 ` [PATCH 4/9] sh: intc: Drop the use of irq_create_identity_mapping() Marc Zyngier
2021-04-06 10:32   ` Geert Uytterhoeven
2021-04-06 13:02     ` Marc Zyngier
2021-04-06  9:35 ` [PATCH 5/9] irqdomain: Kill irq_create_strict_mappings()/irq_create_identity_mapping() Marc Zyngier
2021-04-06  9:35 ` [PATCH 6/9] mips: netlogic: Use irq_domain_simple_ops for XLP PIC Marc Zyngier
2021-04-06 11:36   ` Thomas Bogendoerfer
2021-04-06  9:35 ` [PATCH 7/9] irqdomain: Drop references to recusive irqdomain setup Marc Zyngier
2021-04-06  9:35 ` [PATCH 8/9] powerpc: Convert irq_domain_add_legacy_isa use to irq_domain_add_legacy Marc Zyngier
2021-04-06  9:35 ` [PATCH 9/9] irqdomain: Kill irq_domain_add_legacy_isa Marc Zyngier

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

* 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).