From: Geert Uytterhoeven <geert@linux-m68k.org>
To: David Gow <davidgow@google.com>
Cc: Brian Norris <briannorris@chromium.org>,
Thomas Gleixner <tglx@linutronix.de>,
Guenter Roeck <linux@roeck-us.net>,
linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com
Subject: Re: [PATCH 0/6] genirq/test: Platform/architecture fixes
Date: Thu, 21 Aug 2025 09:05:03 +0200 [thread overview]
Message-ID: <CAMuHMdVichNH4VKGEfDJWB5MTBZMFdh4HXtusb2N_-97RARrbA@mail.gmail.com> (raw)
In-Reply-To: <CABVgOSkfADJGnMekV9Zz4x_Ana2uZYMnca1SDXoJnWjvPRGv8Q@mail.gmail.com>
Hi David,
On Thu, 21 Aug 2025 at 05:45, David Gow <davidgow@google.com> wrote:
> On Thu, 21 Aug 2025 at 01:22, Brian Norris <briannorris@chromium.org> wrote:
> > On Wed, Aug 20, 2025 at 03:00:34PM +0800, David Gow wrote:
> > > Looks like __irq_alloc_descs() is returning -ENOMEM (as
> > > irq_find_free_area() is returning 200 w/ nr_irqs == 200, and
> > > CONFIG_SPARSE_IRQ=n).
> >
> > Thanks for the insight. I bothered compiling my own qemu just so I can
> > run m68k this time, and I can reproduce.
> >
> > I wonder if I should make everything (CONFIG_IRQ_KUNIT_TEST) depend on
> > CONFIG_SPARSE_IRQ, since it seems like arches like m68k can't enable
> > SPARSE_IRQ, and they can't allocate new (fake) IRQs without it. That'd
> > be a tweak to patch 4.
> >
> > Or maybe just 'depends on !M68K', since architectures with higher
> > NR_IRQS headroom may still work even without SPARSE_IRQ.
>
> I'm not an m68k expert (so I've CCed Geert), but I think different
> m68k configs do have different NR_IRQS, so it's possible there are
> working m68k setups, too. (It also seems slightly suspicious to me
> that exactly 200 IRQs are allocated here, though, so a lack of extra
> headroom may be deliberate and/or triggered by something trying to
> allocate all IRQs.)
>
> Personally, I don't have any m68k machines lying around, so disabling
> the test so my qemu scripts don't report errors is fine by me. Ideally
> the dependency would be as narrow as possible, but that may well be
> !M68K.
M68k indeed has different values of NR_IRQS, based on the system(s)
support is enabled for. These values are based on the IRQ hierarchy
of the system(s), which is rather fixed. Hence this does not take
into account any additional irqchips that are being registered by
e.g. tests...
"git grep -w NR_IRQS -- arch/*/include/" shows m68k is not the only
architecture having that limitation...
> The other option would be to try to skip the test if there aren't free
> IRQs, but maybe that'd hide real issues?
>
> Regardless, I'll defer to the IRQ and m68k experts here: as long as
> I'm not seeing errors, I'm happy. :-)
kernel/irq/irqdesc.c:
static bool irq_expand_nr_irqs(unsigned int nr)
{
if (nr > MAX_SPARSE_IRQS)
return false;
nr_irqs = nr;
return true;
}
kernel/irq/internals.h:
#ifdef CONFIG_SPARSE_IRQ
# define MAX_SPARSE_IRQS INT_MAX
#else
# define MAX_SPARSE_IRQS NR_IRQS
#endif
So probably the test should depend on SPARSE_IRQ? Increasing NR_IRQS
everywhere when IRQ_KUNIT_TEST is enabled sounds rather invasive to me.
BTW, given the test calls irq_domain_alloc_descs(), I think it should
also depend on IRQ_DOMAIN.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2025-08-21 7:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-18 19:27 [PATCH 0/6] genirq/test: Platform/architecture fixes Brian Norris
2025-08-18 19:27 ` [PATCH 1/6] genirq/test: Select IRQ_DOMAIN Brian Norris
2025-08-18 19:27 ` [PATCH 2/6] genirq/test: Factor out fake-virq setup Brian Norris
2025-08-18 19:27 ` [PATCH 3/6] genirq/test: Fail early if we can't request an IRQ Brian Norris
2025-08-18 19:27 ` [PATCH 4/6] genirq/test: Skip managed-affinity tests with !SPARSE_IRQ Brian Norris
2025-08-18 19:27 ` [PATCH 5/6] genirq/test: Drop CONFIG_GENERIC_IRQ_MIGRATION assumptions Brian Norris
2025-08-18 19:27 ` [PATCH 6/6] genirq/test: Ensure CPU 1 is online for hotplug test Brian Norris
2025-08-20 7:00 ` [PATCH 0/6] genirq/test: Platform/architecture fixes David Gow
2025-08-20 17:22 ` Brian Norris
2025-08-20 21:37 ` Guenter Roeck
2025-08-21 3:45 ` David Gow
2025-08-21 7:05 ` Geert Uytterhoeven [this message]
2025-08-21 15:32 ` Brian Norris
2025-08-21 17:02 ` Guenter Roeck
2025-08-21 19:06 ` Brian Norris
2025-08-22 18:34 ` Guenter Roeck
2025-08-22 19:01 ` Brian Norris
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=CAMuHMdVichNH4VKGEfDJWB5MTBZMFdh4HXtusb2N_-97RARrbA@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=briannorris@chromium.org \
--cc=davidgow@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--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;
as well as URLs for NNTP newsgroup(s).