[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200906132318.19208.arnd@arndb.de>
Date: Sat, 13 Jun 2009 23:18:18 +0200
From: Arnd Bergmann <arnd@...db.de>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Mike Frysinger <vapier@...too.org>, linux-kernel@...r.kernel.org,
Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH] asm-generic: hard_irqs: handle NR_IRQS > 256 automatically
On Saturday 13 June 2009, H. Peter Anvin wrote:
> Mike Frysinger wrote:
> > If we're going to automatically set HARDIRQ_BITS for the arch, might as
> > well be a little bit smart about it and set it to 9 automatically if
> > NR_IRQS is larger than 8 bits.
> >
>
> Why would the only possible values be 8 or 9?
All architectures that define this either set it to 8 or 9, I chose
8 because it is the more common constant, but I now realized that
we also have (in include/linux/hardirq.h, last touched by Steven):
#define MAX_HARDIRQ_BITS 10
#ifndef HARDIRQ_BITS
# define HARDIRQ_BITS MAX_HARDIRQ_BITS
#endif
#if HARDIRQ_BITS > MAX_HARDIRQ_BITS
#error HARDIRQ_BITS too high!
#endif
Not sure why we even need to make this overridable from the architecture,
10 still seems like a reasonable default that should always work.
I'd suggest we either drop the definition for HARDIRQ_BITS from
asm-generic/hardirq.h, or we use
#ifndef HARDIRQ_BITS
-#define HARDIRQ_BITS 8
+# if NR_IRQS > 255
+# define HARDIRQ_BITS 9
+# elif NR_IRQS > 511
+# define HARDIRQ_BITS 10
+# elif NR_IRQS > 1023
+# warning too many interrupts for HARDIRQ_BITS
+# endif
#endif
Arnd <><
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists