From: Thomas Gleixner <tglx@linutronix.de>
To: Marcelo Schmitt <marcelo.schmitt1@gmail.com>,
linux-kernel@vger.kernel.org
Cc: lars@metafoo.de
Subject: Re: [RFC] genirq: prevent allocated_irqs from being smaller than NR_IRQS
Date: Thu, 02 Apr 2020 21:17:40 +0200 [thread overview]
Message-ID: <87k12xn1d7.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20200402150820.GB5886@smtp.gmail.com>
Marcelo,
Marcelo Schmitt <marcelo.schmitt1@gmail.com> writes:
> #ifdef CONFIG_SPARSE_IRQ
> # define IRQ_BITMAP_BITS (NR_IRQS + 8196)
> #else
> # define IRQ_BITMAP_BITS NR_IRQS
> #endif
>
> The thing I'm troubled about is that BITS_TO_LONGS divides
> IRQ_BITMAP_BITS by sizeof(long) * 8, which makes it possible for the
> size of allocated_irqs to be smaller than NR_IRQS.
No. It calculates the number of longs which are required to store
IRQ_BITMAP_BITS bits. And it does not only divide, it also takes the
reminder into account.
One byte fits 8 bits. Multiplied with sizeof(long) tells you how many
bits fit into a long: Unsurprisingly that 32 on 32bit and 64 on 64bit
systems.
> By the way, is there any mailing list for IRQ related discussions?
> I couldn't find one at vger.kernel.org.
The MAINTAINERS file tells you:
IRQ SUBSYSTEM
L: linux-kernel@vger.kernel.org
So you picked the right one.
Thanks,
tglx
next prev parent reply other threads:[~2020-04-02 19:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-02 15:08 [RFC] genirq: prevent allocated_irqs from being smaller than NR_IRQS Marcelo Schmitt
2020-04-02 15:16 ` Lars-Peter Clausen
2020-04-02 17:25 ` Marcelo Schmitt
2020-04-02 19:17 ` Thomas Gleixner [this message]
2020-04-02 23:23 ` Marcelo Schmitt
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=87k12xn1d7.fsf@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.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