From: Marc Zyngier <maz@kernel.org>
To: "Raghavendra, Vignesh" <vigneshr@ti.com>
Cc: Nishanth Menon <nm@ti.com>, Tero Kristo <kristo@kernel.org>,
Santosh Shilimkar <ssantosh@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 2/2] irqchip: irq-ti-sci-inta: Introduce IRQ affinity support
Date: Mon, 20 Feb 2023 08:47:38 +0000 [thread overview]
Message-ID: <86h6vgyb85.wl-maz@kernel.org> (raw)
In-Reply-To: <cba927be-a83c-d397-100c-03c89b5696ec@ti.com>
On Fri, 27 Jan 2023 17:53:55 +0000,
"Raghavendra, Vignesh" <vigneshr@ti.com> wrote:
>
[...]
> >> @@ -504,11 +509,45 @@ static void ti_sci_inta_ack_irq(struct irq_data *data)
> >> ti_sci_inta_manage_event(data, VINT_STATUS_OFFSET);
> >> }
> >>
> >> +#ifdef CONFIG_SMP
> >> +static int ti_sci_inta_set_affinity(struct irq_data *d,
> >> + const struct cpumask *mask_val, bool force)
> >> +{
> >> + struct ti_sci_inta_event_desc *event_desc;
> >> + struct ti_sci_inta_vint_desc *vint_desc;
> >> + struct irq_data *parent_irq_data;
> >> +
> >> + if (cpumask_equal(irq_data_get_effective_affinity_mask(d), mask_val))
> >> + return 0;
> >> +
> >> + event_desc = irq_data_get_irq_chip_data(d);
> >> + if (event_desc) {
> >> + vint_desc = to_vint_desc(event_desc, event_desc->vint_bit);
> >> +
> >> + /*
> >> + * Cannot set affinity if there is more than one event
> >> + * mapped to same VINT
> >> + */
> >> + if (bitmap_weight(vint_desc->event_map, MAX_EVENTS_PER_VINT) > 1)
> >> + return -EINVAL;
> >> +
> >> + vint_desc->affinity_managed = true;
> >> +
> >> + irq_data_update_effective_affinity(d, mask_val);
> >> + parent_irq_data = irq_get_irq_data(vint_desc->parent_virq);
> >> + if (parent_irq_data->chip->irq_set_affinity)
> >> + return parent_irq_data->chip->irq_set_affinity(parent_irq_data, mask_val, force);
> >
> > This looks completely wrong.
> >
> > You still have a chained irqchip on all paths, and have to do some
> > horrible probing to work out:
> >
> > - which parent interrupt this is
> >
> > - how many interrupts are connected to it
> >
> > And then the fun begins:
> >
> > - You have one interrupt that is standalone, so its affinity can be
> > moved
> >
> > - An unrelated driver gets probed, and one of its interrupts gets
> > lumped together with the one above
> >
> > - Now it cannot be moved anymore, and userspace complains
> >
> > The rule is very simple: chained irqchip, no affinity management.
> > Either you reserve a poll of direct interrupts that have affinity
>
> This is what I am trying to accomplish, that is, reserve a pool of
> direct interrupts that can be used by certain drivers that require IRQ
> steering for performance. But I don't see a way to indicate from client
> drivers to allocate from this reserved pool (there is no hint in
> request_irq() call that ends up in .irq_request_resources() that I can use)
>
> I can try and virtually split INTA into two irqchips perhaps, with one
> part modeled as chained irqchip and other as stacked for the reserved
> pool (and would have to spawn of two child msi-domains I presume).
> But, there is only one DT node for this irqchip and thus clients cannot
> request IRQ for reserved pool.
I don't see why DT should be aware of this. You only need to decide at
allocation time which one is where, and plug it at the right level.
And you probably only need *one* chained interrupt that muxes
everything that cannot be allocated direct path.
> Wondering if you have any pointers here?
I don't. But this shouldn't be too hard to bolt onto the existing
framework.
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
next prev parent reply other threads:[~2023-02-20 8:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-22 8:16 [RFC PATCH 0/2] irqchip: irq-ti-sci-inta: Add IRQ affinity support Vignesh Raghavendra
2023-01-22 8:16 ` [RFC PATCH 1/2] irqchip: irq-ti-sci-inta: Don't aggregate MSI events until necessary Vignesh Raghavendra
2023-01-22 8:16 ` [RFC PATCH 2/2] irqchip: irq-ti-sci-inta: Introduce IRQ affinity support Vignesh Raghavendra
2023-01-26 14:18 ` Marc Zyngier
2023-01-27 17:53 ` Raghavendra, Vignesh
2023-02-20 8:47 ` Marc Zyngier [this message]
2023-02-22 17:07 ` Raghavendra, Vignesh
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=86h6vgyb85.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=kristo@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nm@ti.com \
--cc=ssantosh@kernel.org \
--cc=tglx@linutronix.de \
--cc=vigneshr@ti.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).