All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] remove linux/hardirq.h from asm-generic/local.h
@ 2008-12-14 13:39 Russell King
  2008-12-14 17:58 ` Andrew Morton
  2008-12-14 19:53 ` Geert Uytterhoeven
  0 siblings, 2 replies; 8+ messages in thread
From: Russell King @ 2008-12-14 13:39 UTC (permalink / raw)
  To: Linux Kernel List, linux-arch, Andrew Morton

While looking at reducing the amount of architecture namespace pollution
in the generic kernel, I found that asm/irq.h is included in the vast
majority of compilations on ARM (around 650 files.)

Since asm/irq.h includes a sub-architecture include file on ARM, this
causes a negative impact on the ccache's ability to re-use the build
results from other sub-architectures, so we have a desire to reduce
the dependencies on asm/irq.h.

It turns out that a major cause of this is the needless include of
linux/hardirq.h into asm-generic/local.h.  The patch below removes this
include, resulting in some 250 to 300 files (around half) of the kernel
then omitting asm/irq.h.

My test builds still succeed, provided two ARM files are fixed
(arch/arm/kernel/traps.c and arch/arm/mm/fault.c) - so there may be
negative impacts for this on other architectures.

Note that x86 does not include asm/irq.h nor linux/hardirq.h in its
asm/local.h, so this patch can be viewed as bringing the generic version
into line with the x86 version.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h
index 33d7d04..43c0b81 100644
--- a/include/asm-generic/local.h
+++ b/include/asm-generic/local.h
@@ -2,7 +2,6 @@
 #define _ASM_GENERIC_LOCAL_H
 
 #include <linux/percpu.h>
-#include <linux/hardirq.h>
 #include <asm/atomic.h>
 #include <asm/types.h>
 

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [RFC] remove linux/hardirq.h from asm-generic/local.h
  2008-12-14 13:39 [RFC] remove linux/hardirq.h from asm-generic/local.h Russell King
@ 2008-12-14 17:58 ` Andrew Morton
  2008-12-14 19:51   ` Russell King
  2008-12-16 18:47   ` Alexey Dobriyan
  2008-12-14 19:53 ` Geert Uytterhoeven
  1 sibling, 2 replies; 8+ messages in thread
From: Andrew Morton @ 2008-12-14 17:58 UTC (permalink / raw)
  To: Russell King; +Cc: Linux Kernel List, linux-arch

On Sun, 14 Dec 2008 13:39:41 +0000 Russell King <rmk+lkml@arm.linux.org.uk> wrote:

> While looking at reducing the amount of architecture namespace pollution
> in the generic kernel, I found that asm/irq.h is included in the vast
> majority of compilations on ARM (around 650 files.)
> 
> Since asm/irq.h includes a sub-architecture include file on ARM, this
> causes a negative impact on the ccache's ability to re-use the build
> results from other sub-architectures, so we have a desire to reduce
> the dependencies on asm/irq.h.
> 
> It turns out that a major cause of this is the needless include of
> linux/hardirq.h into asm-generic/local.h.  The patch below removes this
> include, resulting in some 250 to 300 files (around half) of the kernel
> then omitting asm/irq.h.
> 
> My test builds still succeed, provided two ARM files are fixed
> (arch/arm/kernel/traps.c and arch/arm/mm/fault.c) - so there may be
> negative impacts for this on other architectures.
> 
> Note that x86 does not include asm/irq.h nor linux/hardirq.h in its
> asm/local.h, so this patch can be viewed as bringing the generic version
> into line with the x86 version.

Sure.  Includes are easy to add and hard to remove.  I'll queue it up
and see if there's fallout.

btw,

> From: Russell King <rmk+lkml@arm.linux.org.uk>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

that will result in the two rmk's getting separate akpm spam, different
Author from Signer-offer, etc.  Adding an explicit From: line would
improve things.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC] remove linux/hardirq.h from asm-generic/local.h
  2008-12-14 17:58 ` Andrew Morton
@ 2008-12-14 19:51   ` Russell King
  2008-12-17  1:42     ` Stephen Rothwell
  2008-12-16 18:47   ` Alexey Dobriyan
  1 sibling, 1 reply; 8+ messages in thread
From: Russell King @ 2008-12-14 19:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel List, linux-arch

On Sun, Dec 14, 2008 at 09:58:03AM -0800, Andrew Morton wrote:
> On Sun, 14 Dec 2008 13:39:41 +0000 Russell King <rmk+lkml@arm.linux.org.uk> wrote:
> 
> > While looking at reducing the amount of architecture namespace pollution
> > in the generic kernel, I found that asm/irq.h is included in the vast
> > majority of compilations on ARM (around 650 files.)
> > 
> > Since asm/irq.h includes a sub-architecture include file on ARM, this
> > causes a negative impact on the ccache's ability to re-use the build
> > results from other sub-architectures, so we have a desire to reduce
> > the dependencies on asm/irq.h.
> > 
> > It turns out that a major cause of this is the needless include of
> > linux/hardirq.h into asm-generic/local.h.  The patch below removes this
> > include, resulting in some 250 to 300 files (around half) of the kernel
> > then omitting asm/irq.h.
> > 
> > My test builds still succeed, provided two ARM files are fixed
> > (arch/arm/kernel/traps.c and arch/arm/mm/fault.c) - so there may be
> > negative impacts for this on other architectures.
> > 
> > Note that x86 does not include asm/irq.h nor linux/hardirq.h in its
> > asm/local.h, so this patch can be viewed as bringing the generic version
> > into line with the x86 version.
> 
> Sure.  Includes are easy to add and hard to remove.  I'll queue it up
> and see if there's fallout.

Thanks, I've committed to my git tree the addition of linux/hardirq.h to
those two files I mentioned above.  I guess at some point you'll pick
those up to prevent build errors on ARM?

> > From: Russell King <rmk+lkml@arm.linux.org.uk>
> > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> 
> that will result in the two rmk's getting separate akpm spam, different
> Author from Signer-offer, etc.  Adding an explicit From: line would
> improve things.

If they're sent as the same email, it doesn't matter.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC] remove linux/hardirq.h from asm-generic/local.h
  2008-12-14 13:39 [RFC] remove linux/hardirq.h from asm-generic/local.h Russell King
  2008-12-14 17:58 ` Andrew Morton
@ 2008-12-14 19:53 ` Geert Uytterhoeven
  1 sibling, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2008-12-14 19:53 UTC (permalink / raw)
  To: Russell King; +Cc: Linux Kernel List, linux-arch, Andrew Morton

On Sun, 14 Dec 2008, Russell King wrote:
> While looking at reducing the amount of architecture namespace pollution
> in the generic kernel, I found that asm/irq.h is included in the vast
> majority of compilations on ARM (around 650 files.)
> 
> Since asm/irq.h includes a sub-architecture include file on ARM, this
> causes a negative impact on the ccache's ability to re-use the build
> results from other sub-architectures, so we have a desire to reduce
> the dependencies on asm/irq.h.
> 
> It turns out that a major cause of this is the needless include of
> linux/hardirq.h into asm-generic/local.h.  The patch below removes this
> include, resulting in some 250 to 300 files (around half) of the kernel
> then omitting asm/irq.h.
> 
> My test builds still succeed, provided two ARM files are fixed
> (arch/arm/kernel/traps.c and arch/arm/mm/fault.c) - so there may be
> negative impacts for this on other architectures.

I gave it a try on m68k/atari_defconfig, but no ill effects.

> Note that x86 does not include asm/irq.h nor linux/hardirq.h in its
> asm/local.h, so this patch can be viewed as bringing the generic version
> into line with the x86 version.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> 
> diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h
> index 33d7d04..43c0b81 100644
> --- a/include/asm-generic/local.h
> +++ b/include/asm-generic/local.h
> @@ -2,7 +2,6 @@
>  #define _ASM_GENERIC_LOCAL_H
>  
>  #include <linux/percpu.h>
> -#include <linux/hardirq.h>
>  #include <asm/atomic.h>
>  #include <asm/types.h>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC] remove linux/hardirq.h from asm-generic/local.h
  2008-12-14 17:58 ` Andrew Morton
  2008-12-14 19:51   ` Russell King
@ 2008-12-16 18:47   ` Alexey Dobriyan
  2008-12-17  2:35     ` Andrew Morton
  1 sibling, 1 reply; 8+ messages in thread
From: Alexey Dobriyan @ 2008-12-16 18:47 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Russell King, linux-kernel, linux-arch

On Sun, Dec 14, 2008 at 09:58:03AM -0800, Andrew Morton wrote:
> On Sun, 14 Dec 2008 13:39:41 +0000 Russell King <rmk+lkml@arm.linux.org.uk> wrote:

> > Note that x86 does not include asm/irq.h nor linux/hardirq.h in its
> > asm/local.h, so this patch can be viewed as bringing the generic version
> > into line with the x86 version.
> 
> Sure.  Includes are easy to add and hard to remove.  I'll queue it up
> and see if there's fallout.

Here is some (but not everything):

arch/avr32/kernel/traps.c:63: error: implicit declaration of function 'in_interrupt'
arch/avr32/kernel/traps.c:113: error: implicit declaration of function 'nmi_enter'
arch/avr32/kernel/traps.c:124: error: implicit declaration of function 'nmi_disable'
arch/avr32/kernel/traps.c:127: error: implicit declaration of function 'nmi_exit'
arch/sh/kernel/traps_32.c:104: error: implicit declaration of function 'in_interrupt'
arch/sparc64/kernel/sysfs.c:201: error: 'cpuinfo_sparc' undeclared (first use in this function)
arch/sparc64/kernel/mdesc.c:576: error: expected ')' before '*' token


diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c
index 0d98737..d547c8d 100644
--- a/arch/avr32/kernel/traps.c
+++ b/arch/avr32/kernel/traps.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/bug.h>
+#include <linux/hardirq.h>
 #include <linux/init.h>
 #include <linux/kallsyms.h>
 #include <linux/kdebug.h>
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c
index 1e5c74e..7a2dc95 100644
--- a/arch/sh/kernel/traps_32.c
+++ b/arch/sh/kernel/traps_32.c
@@ -13,6 +13,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/ptrace.h>
+#include <linux/hardirq.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
diff --git a/arch/sparc64/kernel/mdesc.c b/arch/sparc64/kernel/mdesc.c
index dde52bc..3c539a6 100644
--- a/arch/sparc64/kernel/mdesc.c
+++ b/arch/sparc64/kernel/mdesc.c
@@ -11,6 +11,7 @@
 #include <linux/mm.h>
 #include <linux/miscdevice.h>
 
+#include <asm/cpudata.h>
 #include <asm/hypervisor.h>
 #include <asm/mdesc.h>
 #include <asm/prom.h>
diff --git a/arch/sparc64/kernel/sysfs.c b/arch/sparc64/kernel/sysfs.c
index 84e5ce1..d28f496 100644
--- a/arch/sparc64/kernel/sysfs.c
+++ b/arch/sparc64/kernel/sysfs.c
@@ -8,6 +8,7 @@
 #include <linux/percpu.h>
 #include <linux/init.h>
 
+#include <asm/cpudata.h>
 #include <asm/hypervisor.h>
 #include <asm/spitfire.h>
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [RFC] remove linux/hardirq.h from asm-generic/local.h
  2008-12-14 19:51   ` Russell King
@ 2008-12-17  1:42     ` Stephen Rothwell
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Rothwell @ 2008-12-17  1:42 UTC (permalink / raw)
  To: Russell King; +Cc: Andrew Morton, Linux Kernel List, linux-arch

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

Hi Russell,

On Sun, 14 Dec 2008 19:51:16 +0000 Russell King <rmk+lkml@arm.linux.org.uk> wrote:
>
> Thanks, I've committed to my git tree the addition of linux/hardirq.h to
> those two files I mentioned above.  I guess at some point you'll pick
> those up to prevent build errors on ARM?

Andrew will (presumably) get these through linux-next (which he bases the
mm trees on).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC] remove linux/hardirq.h from asm-generic/local.h
  2008-12-16 18:47   ` Alexey Dobriyan
@ 2008-12-17  2:35     ` Andrew Morton
  2008-12-17  5:45       ` Sam Ravnborg
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2008-12-17  2:35 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Russell King, linux-kernel, linux-arch

On Tue, 16 Dec 2008 21:47:04 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:

> On Sun, Dec 14, 2008 at 09:58:03AM -0800, Andrew Morton wrote:
> > On Sun, 14 Dec 2008 13:39:41 +0000 Russell King <rmk+lkml@arm.linux.org.uk> wrote:
> 
> > > Note that x86 does not include asm/irq.h nor linux/hardirq.h in its
> > > asm/local.h, so this patch can be viewed as bringing the generic version
> > > into line with the x86 version.
> > 
> > Sure.  Includes are easy to add and hard to remove.  I'll queue it up
> > and see if there's fallout.
> 
> Here is some (but not everything):
> 
> arch/avr32/kernel/traps.c:63: error: implicit declaration of function 'in_interrupt'
> arch/avr32/kernel/traps.c:113: error: implicit declaration of function 'nmi_enter'
> arch/avr32/kernel/traps.c:124: error: implicit declaration of function 'nmi_disable'
> arch/avr32/kernel/traps.c:127: error: implicit declaration of function 'nmi_exit'
> arch/sh/kernel/traps_32.c:104: error: implicit declaration of function 'in_interrupt'
> arch/sparc64/kernel/sysfs.c:201: error: 'cpuinfo_sparc' undeclared (first use in this function)
> arch/sparc64/kernel/mdesc.c:576: error: expected ')' before '*' token
> 
> 
> diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c
> index 0d98737..d547c8d 100644
> --- a/arch/avr32/kernel/traps.c
> +++ b/arch/avr32/kernel/traps.c
> @@ -7,6 +7,7 @@
>   */
>  
>  #include <linux/bug.h>
> +#include <linux/hardirq.h>
>  #include <linux/init.h>
>  #include <linux/kallsyms.h>
>  #include <linux/kdebug.h>
> diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c
> index 1e5c74e..7a2dc95 100644
> --- a/arch/sh/kernel/traps_32.c
> +++ b/arch/sh/kernel/traps_32.c
> @@ -13,6 +13,7 @@
>   */
>  #include <linux/kernel.h>
>  #include <linux/ptrace.h>
> +#include <linux/hardirq.h>
>  #include <linux/init.h>
>  #include <linux/spinlock.h>
>  #include <linux/module.h>
> diff --git a/arch/sparc64/kernel/mdesc.c b/arch/sparc64/kernel/mdesc.c
> index dde52bc..3c539a6 100644
> --- a/arch/sparc64/kernel/mdesc.c
> +++ b/arch/sparc64/kernel/mdesc.c
> @@ -11,6 +11,7 @@
>  #include <linux/mm.h>
>  #include <linux/miscdevice.h>
>  
> +#include <asm/cpudata.h>
>  #include <asm/hypervisor.h>
>  #include <asm/mdesc.h>
>  #include <asm/prom.h>
> diff --git a/arch/sparc64/kernel/sysfs.c b/arch/sparc64/kernel/sysfs.c
> index 84e5ce1..d28f496 100644
> --- a/arch/sparc64/kernel/sysfs.c
> +++ b/arch/sparc64/kernel/sysfs.c
> @@ -8,6 +8,7 @@
>  #include <linux/percpu.h>
>  #include <linux/init.h>
>  
> +#include <asm/cpudata.h>
>  #include <asm/hypervisor.h>
>  #include <asm/spitfire.h>

hm, the two sparc64 files have just magically disappeared from linux-next.

Oh well, I'll do sparc and sparc64 crossbuilds soon.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC] remove linux/hardirq.h from asm-generic/local.h
  2008-12-17  2:35     ` Andrew Morton
@ 2008-12-17  5:45       ` Sam Ravnborg
  0 siblings, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2008-12-17  5:45 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Alexey Dobriyan, Russell King, linux-kernel, linux-arch

> > +++ b/arch/sparc64/kernel/mdesc.c
> > @@ -11,6 +11,7 @@
> >  #include <linux/mm.h>
> >  #include <linux/miscdevice.h>
> >  
> > +#include <asm/cpudata.h>
> >  #include <asm/hypervisor.h>
> >  #include <asm/mdesc.h>
> >  #include <asm/prom.h>
> > diff --git a/arch/sparc64/kernel/sysfs.c b/arch/sparc64/kernel/sysfs.c
> > index 84e5ce1..d28f496 100644
> > --- a/arch/sparc64/kernel/sysfs.c
> > +++ b/arch/sparc64/kernel/sysfs.c
> > @@ -8,6 +8,7 @@
> >  #include <linux/percpu.h>
> >  #include <linux/init.h>
> >  
> > +#include <asm/cpudata.h>
> >  #include <asm/hypervisor.h>
> >  #include <asm/spitfire.h>
> 
> hm, the two sparc64 files have just magically disappeared from linux-next.

s/magically/by hard work/ ;-)

We have unified sparc and sparc64 so all files lives in
arch/sparc/* these days.
Feed the sparc64 bits to davem and he will take care.
Or I can do it if you like.

	Sam

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-12-17  5:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-14 13:39 [RFC] remove linux/hardirq.h from asm-generic/local.h Russell King
2008-12-14 17:58 ` Andrew Morton
2008-12-14 19:51   ` Russell King
2008-12-17  1:42     ` Stephen Rothwell
2008-12-16 18:47   ` Alexey Dobriyan
2008-12-17  2:35     ` Andrew Morton
2008-12-17  5:45       ` Sam Ravnborg
2008-12-14 19:53 ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.