2009-03-28 14:49:58

by Jaswinder Singh Rajput

[permalink] [raw]
Subject: [git-pull -tip] x86: include inverse Xmas tree patches

The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
Ingo Molnar (1):
Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core

Jaswinder Singh Rajput (49):
x86: process_32.c include inverse Xmas tree effect
x86: signal.c include inverse Xmas tree effect
x86: entry_32.S include inverse Xmas tree effect
x86: traps.c include inverse Xmas tree effect
x86: irq.c include inverse Xmas tree effect
x86: irq_32.c include inverse Xmas tree effect
x86: dumpstack.c include inverse Xmas tree effect
x86: time_32.c include inverse Xmas tree effect
x86: ioport.c include inverse Xmas tree effect
x86: ldt.c include inverse Xmas tree effect
x86: dumpstack_32.c include inverse Xmas tree effect
x86: setup.c include inverse Xmas tree effect
x86: i8259.c include inverse Xmas tree effect
x86: irqinit_32.c include inverse Xmas tree effect
x86: probe_roms_32.c include inverse Xmas tree effect
x86: sys_i386_32.c include inverse Xmas tree effect
x86: i386_ksyms_32.c include inverse Xmas tree effect
x86: bootflag.c include inverse Xmas tree effect
x86: e820.c include inverse Xmas tree effect
x86: pci-dma.c include inverse Xmas tree effect
x86: quirks.c include inverse Xmas tree effect
x86: i8237.c include inverse Xmas tree effect
x86: alternative.c include inverse Xmas tree effect
x86: tsc.c include inverse Xmas tree effect
x86: process.c include inverse Xmas tree effect
x86: xsave.c include inverse Xmas tree effect
x86: ptrace.c include inverse Xmas tree effect
x86: ds.c include inverse Xmas tree effect
x86: tls.c include inverse Xmas tree effect
x86: step.c include inverse Xmas tree effect
x86: stacktrace.c include inverse Xmas tree effect
x86: reboot.c include inverse Xmas tree effect
x86: msr.c include inverse Xmas tree effect
x86: cpuid.c include inverse Xmas tree effect
x86: early-quirks.c include inverse Xmas tree effect
x86: smp.c include inverse Xmas tree effect
x86: smpboot.c include inverse Xmas tree effect
x86: tsc_sync.c include inverse Xmas tree effect
x86: setup_percpu.c include inverse Xmas tree effect
x86: trampoline_32.S include inverse Xmas tree effect
x86: mpparse.c include inverse Xmas tree effect
x86: module_32.c include inverse Xmas tree effect
x86: doublefault_32.c include inverse Xmas tree effect
x86: vm86_32.c include inverse Xmas tree effect
ix86: early_printk.c include inverse Xmas tree effect
x86: pcspeaker.c include inverse Xmas tree effect
x86: head_32.c include inverse Xmas tree effect
x86: head.c include inverse Xmas tree effect
x86: init_task.c include inverse Xmas tree effect

arch/x86/include/asm/proto.h | 2 +
arch/x86/include/asm/sigcontext32.h | 3 +-
arch/x86/include/asm/smpboot_hooks.h | 2 +
arch/x86/include/asm/topology.h | 2 +
arch/x86/kernel/alternative.c | 11 ++--
arch/x86/kernel/bootflag.c | 12 ++--
arch/x86/kernel/cpuid.c | 17 ++---
arch/x86/kernel/doublefault_32.c | 8 +-
arch/x86/kernel/ds.c | 11 +--
arch/x86/kernel/dumpstack.c | 5 +-
arch/x86/kernel/dumpstack_32.c | 5 +-
arch/x86/kernel/e820.c | 21 +++---
arch/x86/kernel/early-quirks.c | 9 ++-
arch/x86/kernel/early_printk.c | 26 ++++---
arch/x86/kernel/entry_32.S | 17 +++--
arch/x86/kernel/head.c | 2 +-
arch/x86/kernel/head_32.S | 17 +++--
arch/x86/kernel/i386_ksyms_32.c | 3 +-
arch/x86/kernel/i8237.c | 3 +-
arch/x86/kernel/i8259.c | 28 ++++----
arch/x86/kernel/init_task.c | 8 +-
arch/x86/kernel/ioport.c | 15 ++--
arch/x86/kernel/irq.c | 11 ++--
arch/x86/kernel/irq_32.c | 10 ++--
arch/x86/kernel/irqinit_32.c | 29 ++++----
arch/x86/kernel/ldt.c | 14 ++--
arch/x86/kernel/module_32.c | 7 +-
arch/x86/kernel/mpparse.c | 24 +++---
arch/x86/kernel/msr.c | 17 ++---
arch/x86/kernel/pci-dma.c | 10 ++--
arch/x86/kernel/pcspeaker.c | 2 +-
arch/x86/kernel/probe_roms_32.c | 23 +++---
arch/x86/kernel/process.c | 19 +++---
arch/x86/kernel/process_32.c | 70 +++++++++----------
arch/x86/kernel/ptrace.c | 30 ++++----
arch/x86/kernel/quirks.c | 4 +-
arch/x86/kernel/reboot.c | 30 ++++----
arch/x86/kernel/setup.c | 126 ++++++++++++++++------------------
arch/x86/kernel/setup_percpu.c | 21 +++---
arch/x86/kernel/signal.c | 33 ++++-----
arch/x86/kernel/smp.c | 16 ++--
arch/x86/kernel/smpboot.c | 33 ++++-----
arch/x86/kernel/stacktrace.c | 6 +-
arch/x86/kernel/step.c | 3 +-
arch/x86/kernel/sys_i386_32.c | 25 +++----
arch/x86/kernel/time_32.c | 7 +-
arch/x86/kernel/tls.c | 10 ++--
arch/x86/kernel/trampoline_32.S | 3 +-
arch/x86/kernel/traps.c | 34 +++------
arch/x86/kernel/tsc.c | 20 +++---
arch/x86/kernel/tsc_sync.c | 2 +-
arch/x86/kernel/vm86_32.c | 20 +++---
arch/x86/kernel/xsave.c | 5 +-
53 files changed, 437 insertions(+), 454 deletions(-)

Complete diff:
diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
index 49fb3ec..a8d63be 100644
--- a/arch/x86/include/asm/proto.h
+++ b/arch/x86/include/asm/proto.h
@@ -7,7 +7,9 @@

extern void early_idt_handler(void);

+#ifdef CONFIG_X86_64
extern void system_call(void);
+#endif
extern void syscall_init(void);

extern void ia32_syscall(void);
diff --git a/arch/x86/include/asm/sigcontext32.h b/arch/x86/include/asm/sigcontext32.h
index ad1478c..f80df2e 100644
--- a/arch/x86/include/asm/sigcontext32.h
+++ b/arch/x86/include/asm/sigcontext32.h
@@ -1,6 +1,7 @@
#ifndef _ASM_X86_SIGCONTEXT32_H
#define _ASM_X86_SIGCONTEXT32_H

+#ifdef CONFIG_IA32_EMULATION
#include <linux/types.h>

/* signal context for 32bit programs. */
@@ -73,5 +74,5 @@ struct sigcontext_ia32 {
unsigned int oldmask;
unsigned int cr2;
};
-
+#endif
#endif /* _ASM_X86_SIGCONTEXT32_H */
diff --git a/arch/x86/include/asm/smpboot_hooks.h b/arch/x86/include/asm/smpboot_hooks.h
index 1def601..dff6e11 100644
--- a/arch/x86/include/asm/smpboot_hooks.h
+++ b/arch/x86/include/asm/smpboot_hooks.h
@@ -1,6 +1,8 @@
/* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
* which needs to alter them. */

+#include <asm/tlbflush.h>
+
static inline void smpboot_clear_io_apic_irqs(void)
{
#ifdef CONFIG_X86_IO_APIC
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index 77cfb2c..1f23e58 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -194,10 +194,12 @@ extern int __node_distance(int, int);

#else /* !CONFIG_NUMA */

+#if 0
static inline int numa_node_id(void)
{
return 0;
}
+#endif

static inline int cpu_to_node(int cpu)
{
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 4c80f15..51fb5c5 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -1,17 +1,18 @@
+#include <linux/kprobes.h>
+#include <linux/vmalloc.h>
#include <linux/module.h>
-#include <linux/sched.h>
#include <linux/mutex.h>
+#include <linux/sched.h>
#include <linux/list.h>
-#include <linux/kprobes.h>
#include <linux/mm.h>
-#include <linux/vmalloc.h>
+
#include <asm/alternative.h>
+#include <asm/cacheflush.h>
#include <asm/sections.h>
+#include <asm/vsyscall.h>
#include <asm/pgtable.h>
#include <asm/mce.h>
#include <asm/nmi.h>
-#include <asm/vsyscall.h>
-#include <asm/cacheflush.h>
#include <asm/io.h>

#define MAX_PATCH_LEN (255-1)
diff --git a/arch/x86/kernel/bootflag.c b/arch/x86/kernel/bootflag.c
index 30f25a7..3cbb632 100644
--- a/arch/x86/kernel/bootflag.c
+++ b/arch/x86/kernel/bootflag.c
@@ -1,17 +1,17 @@
/*
* Implement 'Simple Boot Flag Specification 2.0'
*/
-#include <linux/types.h>
+
+#include <linux/mc146818rtc.h>
+#include <linux/spinlock.h>
#include <linux/kernel.h>
-#include <linux/init.h>
#include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/spinlock.h>
+#include <linux/types.h>
#include <linux/acpi.h>
+#include <linux/init.h>
+#include <linux/slab.h>
#include <asm/io.h>

-#include <linux/mc146818rtc.h>
-
#define SBF_RESERVED (0x78)
#define SBF_PNPOS (1<<0)
#define SBF_BOOTING (1<<1)
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 2ac1f0c..7e5caa6 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -25,25 +25,24 @@
* an SMP box will direct the access to CPU %d.
*/

+#include <linux/notifier.h>
+#include <linux/smp_lock.h>
+#include <linux/uaccess.h>
+#include <linux/device.h>
#include <linux/module.h>
-
-#include <linux/types.h>
#include <linux/errno.h>
#include <linux/fcntl.h>
+#include <linux/major.h>
+#include <linux/types.h>
#include <linux/init.h>
#include <linux/poll.h>
+#include <linux/cpu.h>
#include <linux/smp.h>
-#include <linux/smp_lock.h>
-#include <linux/major.h>
#include <linux/fs.h>
-#include <linux/device.h>
-#include <linux/cpu.h>
-#include <linux/notifier.h>
-#include <linux/uaccess.h>

#include <asm/processor.h>
-#include <asm/msr.h>
#include <asm/system.h>
+#include <asm/msr.h>

static struct class *cpuid_class;

diff --git a/arch/x86/kernel/doublefault_32.c b/arch/x86/kernel/doublefault_32.c
index b4f14c6..2d1f7b7 100644
--- a/arch/x86/kernel/doublefault_32.c
+++ b/arch/x86/kernel/doublefault_32.c
@@ -1,12 +1,12 @@
-#include <linux/mm.h>
+#include <linux/init_task.h>
#include <linux/sched.h>
#include <linux/init.h>
-#include <linux/init_task.h>
#include <linux/fs.h>
+#include <linux/mm.h>

-#include <asm/uaccess.h>
-#include <asm/pgtable.h>
#include <asm/processor.h>
+#include <asm/pgtable.h>
+#include <asm/uaccess.h>
#include <asm/desc.h>

#define DOUBLEFAULT_STACKSIZE (1024)
diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c
index 87b67e3..fa9b42c 100644
--- a/arch/x86/kernel/ds.c
+++ b/arch/x86/kernel/ds.c
@@ -19,16 +19,13 @@
* Markus Metzger <[email protected]>, 2007-2009
*/

-
-#include <asm/ds.h>
-
-#include <linux/errno.h>
+#include <linux/kernel.h>
#include <linux/string.h>
-#include <linux/slab.h>
+#include <linux/errno.h>
#include <linux/sched.h>
+#include <linux/slab.h>
#include <linux/mm.h>
-#include <linux/kernel.h>
-
+#include <asm/ds.h>

/*
* The configuration for a particular DS hardware implementation.
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 87d103d..9c4da7e 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -2,18 +2,19 @@
* Copyright (C) 1991, 1992 Linus Torvalds
* Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs
*/
+
#include <linux/kallsyms.h>
#include <linux/kprobes.h>
+#include <linux/hardirq.h>
#include <linux/uaccess.h>
#include <linux/utsname.h>
-#include <linux/hardirq.h>
#include <linux/kdebug.h>
#include <linux/module.h>
#include <linux/ptrace.h>
#include <linux/kexec.h>
+#include <linux/sysfs.h>
#include <linux/bug.h>
#include <linux/nmi.h>
-#include <linux/sysfs.h>

#include <asm/stacktrace.h>

diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index d593cd1..f967111 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -2,18 +2,19 @@
* Copyright (C) 1991, 1992 Linus Torvalds
* Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs
*/
+
#include <linux/kallsyms.h>
+#include <linux/hardirq.h>
#include <linux/kprobes.h>
#include <linux/uaccess.h>
#include <linux/utsname.h>
-#include <linux/hardirq.h>
#include <linux/kdebug.h>
#include <linux/module.h>
#include <linux/ptrace.h>
#include <linux/kexec.h>
+#include <linux/sysfs.h>
#include <linux/bug.h>
#include <linux/nmi.h>
-#include <linux/sysfs.h>

#include <asm/stacktrace.h>

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index fb638d9..8232b2b 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -8,25 +8,26 @@
* Venkatesh Pallipadi <[email protected]>
*
*/
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/init.h>
+
+#include <linux/firmware-map.h>
#include <linux/bootmem.h>
+#include <linux/suspend.h>
#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
#include <linux/string.h>
#include <linux/kexec.h>
-#include <linux/module.h>
-#include <linux/mm.h>
+#include <linux/types.h>
+#include <linux/init.h>
#include <linux/pfn.h>
-#include <linux/suspend.h>
-#include <linux/firmware-map.h>
+#include <linux/mm.h>

+#include <asm/trampoline.h>
#include <asm/pgtable.h>
-#include <asm/page.h>
-#include <asm/e820.h>
#include <asm/proto.h>
#include <asm/setup.h>
-#include <asm/trampoline.h>
+#include <asm/e820.h>
+#include <asm/page.h>

/*
* The e820 map is the map that gets modified e.g. with command line parameters
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 76b8cd9..c4acdfd 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -9,15 +9,16 @@
Mainboard specific bugs should be handled by DMI entries.
CPU specific bugs in setup.c */

-#include <linux/pci.h>
-#include <linux/acpi.h>
#include <linux/pci_ids.h>
+#include <linux/acpi.h>
+#include <linux/pci.h>
+
#include <asm/pci-direct.h>
-#include <asm/dma.h>
#include <asm/io_apic.h>
-#include <asm/apic.h>
#include <asm/iommu.h>
+#include <asm/apic.h>
#include <asm/gart.h>
+#include <asm/dma.h>

static void __init fix_hypertransport_config(int num, int slot, int func)
{
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index 335f049..57a1ab3 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -1,21 +1,25 @@
-#include <linux/console.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/string.h>
+#include <linux/spinlock_types.h>
#include <linux/screen_info.h>
-#include <linux/usb/ch9.h>
#include <linux/pci_regs.h>
+#include <linux/console.h>
#include <linux/pci_ids.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
#include <linux/errno.h>
-#include <asm/io.h>
-#include <asm/processor.h>
-#include <asm/fcntl.h>
-#include <asm/setup.h>
+#include <linux/init.h>
+
+#include <linux/usb/ehci_def.h>
+#include <linux/usb/ch9.h>
+
#include <xen/hvc-console.h>
+
#include <asm/pci-direct.h>
-#include <asm/fixmap.h>
+#include <asm/processor.h>
#include <asm/pgtable.h>
-#include <linux/usb/ehci_def.h>
+#include <asm/fixmap.h>
+#include <asm/fcntl.h>
+#include <asm/setup.h>
+#include <asm/io.h>

/* Simple VGA output */
#define VGABASE (__ISA_IO_base + 0xb8000)
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index c929add..5f1c934 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -42,21 +42,22 @@
*/

#include <linux/linkage.h>
+#include <linux/elf-em.h>
+
+#include <asm/processor-flags.h>
+#include <asm/irq_vectors.h>
#include <asm/thread_info.h>
+#include <asm/page_types.h>
#include <asm/irqflags.h>
-#include <asm/errno.h>
#include <asm/segment.h>
-#include <asm/smp.h>
-#include <asm/page_types.h>
-#include <asm/desc.h>
-#include <asm/percpu.h>
#include <asm/dwarf2.h>
-#include <asm/processor-flags.h>
#include <asm/ftrace.h>
-#include <asm/irq_vectors.h>
+#include <asm/percpu.h>
+#include <asm/errno.h>
+#include <asm/desc.h>
+#include <asm/smp.h>

/* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */
-#include <linux/elf-em.h>
#define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)
#define __AUDIT_ARCH_LE 0x40000000

diff --git a/arch/x86/kernel/head.c b/arch/x86/kernel/head.c
index 3e66bd3..685811a 100644
--- a/arch/x86/kernel/head.c
+++ b/arch/x86/kernel/head.c
@@ -1,8 +1,8 @@
#include <linux/kernel.h>
#include <linux/init.h>

-#include <asm/setup.h>
#include <asm/bios_ebda.h>
+#include <asm/setup.h>

#define BIOS_LOWMEM_KILOBYTES 0x413

diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 3068388..3dd22b3 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -7,19 +7,20 @@
*/

.text
+#include <linux/linkage.h>
#include <linux/threads.h>
#include <linux/init.h>
-#include <linux/linkage.h>
-#include <asm/segment.h>
-#include <asm/page_types.h>
+
+#include <asm/processor-flags.h>
#include <asm/pgtable_types.h>
-#include <asm/desc.h>
-#include <asm/cache.h>
-#include <asm/thread_info.h>
#include <asm/asm-offsets.h>
-#include <asm/setup.h>
-#include <asm/processor-flags.h>
+#include <asm/thread_info.h>
+#include <asm/page_types.h>
+#include <asm/segment.h>
#include <asm/percpu.h>
+#include <asm/cache.h>
+#include <asm/setup.h>
+#include <asm/desc.h>

/* Physical address */
#define pa(X) ((X) - __PAGE_OFFSET)
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
index 43cec6b..87616ff 100644
--- a/arch/x86/kernel/i386_ksyms_32.c
+++ b/arch/x86/kernel/i386_ksyms_32.c
@@ -1,9 +1,8 @@
#include <linux/module.h>
-
#include <asm/checksum.h>
#include <asm/pgtable.h>
-#include <asm/desc.h>
#include <asm/ftrace.h>
+#include <asm/desc.h>

#ifdef CONFIG_FUNCTION_TRACER
/* mcount is defined in assembly */
diff --git a/arch/x86/kernel/i8237.c b/arch/x86/kernel/i8237.c
index b42ca69..bc043f7 100644
--- a/arch/x86/kernel/i8237.c
+++ b/arch/x86/kernel/i8237.c
@@ -9,9 +9,8 @@
* your option) any later version.
*/

-#include <linux/init.h>
#include <linux/sysdev.h>
-
+#include <linux/init.h>
#include <asm/dma.h>

/*
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
index df89102..e9e6df1 100644
--- a/arch/x86/kernel/i8259.c
+++ b/arch/x86/kernel/i8259.c
@@ -1,28 +1,28 @@
+#include <linux/kernel_stat.h>
+#include <linux/interrupt.h>
#include <linux/linkage.h>
-#include <linux/errno.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
+#include <linux/bitops.h>
#include <linux/ioport.h>
-#include <linux/interrupt.h>
-#include <linux/timex.h>
-#include <linux/slab.h>
#include <linux/random.h>
-#include <linux/init.h>
-#include <linux/kernel_stat.h>
+#include <linux/signal.h>
#include <linux/sysdev.h>
-#include <linux/bitops.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/timex.h>
#include <linux/acpi.h>
+#include <linux/init.h>
+#include <linux/slab.h>
#include <linux/io.h>
-#include <linux/delay.h>

+#include <asm/pgtable.h>
#include <asm/atomic.h>
+#include <asm/hw_irq.h>
#include <asm/system.h>
+#include <asm/i8259.h>
#include <asm/timer.h>
-#include <asm/hw_irq.h>
-#include <asm/pgtable.h>
-#include <asm/desc.h>
#include <asm/apic.h>
-#include <asm/i8259.h>
+#include <asm/desc.h>

/*
* This is the 'legacy' 8259A Programmable Interrupt Controller,
diff --git a/arch/x86/kernel/init_task.c b/arch/x86/kernel/init_task.c
index df3bf26..c53d699 100644
--- a/arch/x86/kernel/init_task.c
+++ b/arch/x86/kernel/init_task.c
@@ -1,13 +1,13 @@
-#include <linux/mm.h>
+#include <linux/init_task.h>
#include <linux/module.h>
+#include <linux/mqueue.h>
#include <linux/sched.h>
#include <linux/init.h>
-#include <linux/init_task.h>
#include <linux/fs.h>
-#include <linux/mqueue.h>
+#include <linux/mm.h>

-#include <asm/uaccess.h>
#include <asm/pgtable.h>
+#include <asm/uaccess.h>
#include <asm/desc.h>

static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c
index 99c4d30..fb498da 100644
--- a/arch/x86/kernel/ioport.c
+++ b/arch/x86/kernel/ioport.c
@@ -3,17 +3,18 @@
* by Linus. 32/64 bits code unification by Miguel Botón.
*/

-#include <linux/sched.h>
-#include <linux/kernel.h>
+#include <linux/thread_info.h>
#include <linux/capability.h>
-#include <linux/errno.h>
-#include <linux/types.h>
+#include <linux/syscalls.h>
#include <linux/ioport.h>
-#include <linux/smp.h>
+#include <linux/kernel.h>
#include <linux/stddef.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/types.h>
#include <linux/slab.h>
-#include <linux/thread_info.h>
-#include <linux/syscalls.h>
+#include <linux/smp.h>
+
#include <asm/syscalls.h>

/* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index b8ac3b6..c1c484f 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -1,17 +1,18 @@
/*
* Common interrupt code for 32 and 64 bit
*/
-#include <linux/cpu.h>
-#include <linux/interrupt.h>
+
#include <linux/kernel_stat.h>
+#include <linux/interrupt.h>
#include <linux/seq_file.h>
-#include <linux/smp.h>
#include <linux/ftrace.h>
+#include <linux/cpu.h>
+#include <linux/smp.h>

-#include <asm/apic.h>
#include <asm/io_apic.h>
-#include <asm/irq.h>
#include <asm/idle.h>
+#include <asm/apic.h>
+#include <asm/irq.h>

atomic_t irq_err_count;

diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
index 3b09634..08bde3c 100644
--- a/arch/x86/kernel/irq_32.c
+++ b/arch/x86/kernel/irq_32.c
@@ -8,15 +8,15 @@
* io_apic.c.)
*/

-#include <linux/module.h>
-#include <linux/seq_file.h>
-#include <linux/interrupt.h>
#include <linux/kernel_stat.h>
+#include <linux/interrupt.h>
#include <linux/notifier.h>
-#include <linux/cpu.h>
-#include <linux/delay.h>
+#include <linux/seq_file.h>
#include <linux/uaccess.h>
+#include <linux/module.h>
#include <linux/percpu.h>
+#include <linux/delay.h>
+#include <linux/cpu.h>

#include <asm/apic.h>

diff --git a/arch/x86/kernel/irqinit_32.c b/arch/x86/kernel/irqinit_32.c
index bc13261..fcb54ac 100644
--- a/arch/x86/kernel/irqinit_32.c
+++ b/arch/x86/kernel/irqinit_32.c
@@ -1,27 +1,26 @@
-#include <linux/errno.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
+#include <linux/kernel_stat.h>
#include <linux/interrupt.h>
-#include <linux/slab.h>
+#include <linux/bitops.h>
+#include <linux/ioport.h>
#include <linux/random.h>
-#include <linux/init.h>
-#include <linux/kernel_stat.h>
+#include <linux/signal.h>
#include <linux/sysdev.h>
-#include <linux/bitops.h>
-#include <linux/io.h>
#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/io.h>

+#include <asm/pgtable.h>
#include <asm/atomic.h>
#include <asm/system.h>
-#include <asm/timer.h>
-#include <asm/pgtable.h>
-#include <asm/desc.h>
-#include <asm/apic.h>
-#include <asm/setup.h>
#include <asm/i8259.h>
+#include <asm/setup.h>
+#include <asm/timer.h>
#include <asm/traps.h>
-
+#include <asm/apic.h>
+#include <asm/desc.h>

/*
* Note that on a 486, we don't want to do a SIGFPE on an irq13
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c
index 71f1d99..08ad4c5 100644
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
@@ -6,19 +6,19 @@
* This handles calls from both 32bit and 64bit mode.
*/

+#include <linux/uaccess.h>
+#include <linux/vmalloc.h>
+#include <linux/string.h>
#include <linux/errno.h>
#include <linux/sched.h>
-#include <linux/string.h>
-#include <linux/mm.h>
#include <linux/smp.h>
-#include <linux/vmalloc.h>
-#include <linux/uaccess.h>
+#include <linux/mm.h>

-#include <asm/system.h>
-#include <asm/ldt.h>
-#include <asm/desc.h>
#include <asm/mmu_context.h>
#include <asm/syscalls.h>
+#include <asm/system.h>
+#include <asm/desc.h>
+#include <asm/ldt.h>

#ifdef CONFIG_SMP
static void flush_ldt(void *current_mm)
diff --git a/arch/x86/kernel/module_32.c b/arch/x86/kernel/module_32.c
index 0edd819..0f8dede 100644
--- a/arch/x86/kernel/module_32.c
+++ b/arch/x86/kernel/module_32.c
@@ -15,13 +15,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
#include <linux/moduleloader.h>
-#include <linux/elf.h>
#include <linux/vmalloc.h>
-#include <linux/fs.h>
-#include <linux/string.h>
#include <linux/kernel.h>
+#include <linux/string.h>
#include <linux/bug.h>
+#include <linux/elf.h>
+#include <linux/fs.h>

#if 0
#define DEBUGP printk
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index dce99dc..f604897 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -7,29 +7,29 @@
* (c) 2008 Alexey Starikovskiy <[email protected]>
*/

-#include <linux/mm.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/bootmem.h>
#include <linux/kernel_stat.h>
#include <linux/mc146818rtc.h>
+#include <linux/bootmem.h>
#include <linux/bitops.h>
-#include <linux/acpi.h>
#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/acpi.h>
+#include <linux/init.h>
#include <linux/smp.h>
+#include <linux/mm.h>

-#include <asm/mtrr.h>
-#include <asm/mpspec.h>
-#include <asm/pgalloc.h>
+#include <asm/trampoline.h>
+#include <asm/bios_ebda.h>
#include <asm/io_apic.h>
+#include <asm/pgalloc.h>
+#include <asm/mpspec.h>
#include <asm/proto.h>
-#include <asm/bios_ebda.h>
-#include <asm/e820.h>
-#include <asm/trampoline.h>
#include <asm/setup.h>
+#include <asm/apic.h>
+#include <asm/e820.h>
+#include <asm/mtrr.h>
#include <asm/smp.h>

-#include <asm/apic.h>
/*
* Checksum an MP configuration block.
*/
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 3cf3413..1828fe0 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -21,25 +21,24 @@
* an SMP box will direct the access to CPU %d.
*/

+#include <linux/notifier.h>
+#include <linux/smp_lock.h>
+#include <linux/uaccess.h>
+#include <linux/device.h>
#include <linux/module.h>
-
-#include <linux/types.h>
#include <linux/errno.h>
#include <linux/fcntl.h>
+#include <linux/major.h>
+#include <linux/types.h>
#include <linux/init.h>
#include <linux/poll.h>
+#include <linux/cpu.h>
#include <linux/smp.h>
-#include <linux/smp_lock.h>
-#include <linux/major.h>
#include <linux/fs.h>
-#include <linux/device.h>
-#include <linux/cpu.h>
-#include <linux/notifier.h>
-#include <linux/uaccess.h>

#include <asm/processor.h>
-#include <asm/msr.h>
#include <asm/system.h>
+#include <asm/msr.h>

static struct class *msr_class;

diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index b254285..b4a3a61 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -1,14 +1,14 @@
#include <linux/dma-mapping.h>
-#include <linux/dmar.h>
#include <linux/bootmem.h>
+#include <linux/dmar.h>
#include <linux/pci.h>

-#include <asm/proto.h>
-#include <asm/dma.h>
+#include <asm/amd_iommu.h>
+#include <asm/calgary.h>
#include <asm/iommu.h>
+#include <asm/proto.h>
#include <asm/gart.h>
-#include <asm/calgary.h>
-#include <asm/amd_iommu.h>
+#include <asm/dma.h>

static int forbid_dac __read_mostly;

diff --git a/arch/x86/kernel/pcspeaker.c b/arch/x86/kernel/pcspeaker.c
index a311ffc..d5047ca 100644
--- a/arch/x86/kernel/pcspeaker.c
+++ b/arch/x86/kernel/pcspeaker.c
@@ -1,6 +1,6 @@
#include <linux/platform_device.h>
-#include <linux/err.h>
#include <linux/init.h>
+#include <linux/err.h>

static __init int add_pcspkr(void)
{
diff --git a/arch/x86/kernel/probe_roms_32.c b/arch/x86/kernel/probe_roms_32.c
index 071e7fe..9ddad2a 100644
--- a/arch/x86/kernel/probe_roms_32.c
+++ b/arch/x86/kernel/probe_roms_32.c
@@ -1,24 +1,23 @@
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/uaccess.h>
-#include <linux/mmzone.h>
-#include <linux/ioport.h>
#include <linux/seq_file.h>
#include <linux/console.h>
+#include <linux/uaccess.h>
+#include <linux/ioport.h>
+#include <linux/mmzone.h>
+#include <linux/sched.h>
#include <linux/init.h>
-#include <linux/edd.h>
#include <linux/dmi.h>
-#include <linux/pfn.h>
+#include <linux/edd.h>
#include <linux/pci.h>
-#include <asm/pci-direct.h>
-
+#include <linux/pfn.h>
+#include <linux/mm.h>

-#include <asm/e820.h>
+#include <asm/pci-direct.h>
+#include <asm/setup_arch.h>
+#include <asm/sections.h>
#include <asm/mmzone.h>
#include <asm/setup.h>
-#include <asm/sections.h>
+#include <asm/e820.h>
#include <asm/io.h>
-#include <asm/setup_arch.h>

static struct resource system_rom_resource = {
.name = "System ROM",
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 156f875..e508d97 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -1,19 +1,20 @@
-#include <linux/errno.h>
+#include <linux/clockchips.h>
+#include <linux/ftrace.h>
#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
+#include <linux/module.h>
+#include <linux/errno.h>
#include <linux/prctl.h>
-#include <linux/slab.h>
#include <linux/sched.h>
-#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/smp.h>
+#include <linux/mm.h>
#include <linux/pm.h>
-#include <linux/clockchips.h>
-#include <linux/ftrace.h>
+
+#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/apic.h>
-#include <asm/idle.h>
-#include <asm/uaccess.h>
#include <asm/i387.h>
+#include <asm/idle.h>

unsigned long idle_halt;
EXPORT_SYMBOL(idle_halt);
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 14014d7..6822436 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -9,59 +9,55 @@
* This file handles the architecture-dependent parts of process handling..
*/

-#include <stdarg.h>
-
#include <linux/stackprotector.h>
-#include <linux/cpu.h>
-#include <linux/errno.h>
-#include <linux/sched.h>
-#include <linux/fs.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/elfcore.h>
-#include <linux/smp.h>
-#include <linux/stddef.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
-#include <linux/user.h>
+#include <linux/mc146818rtc.h>
+#include <linux/personality.h>
#include <linux/interrupt.h>
+#include <linux/kallsyms.h>
+#include <linux/elfcore.h>
+#include <linux/uaccess.h>
#include <linux/utsname.h>
-#include <linux/delay.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/mc146818rtc.h>
+#include <linux/vmalloc.h>
+#include <linux/ftrace.h>
+#include <linux/kdebug.h>
+#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/kallsyms.h>
+#include <linux/percpu.h>
#include <linux/ptrace.h>
#include <linux/random.h>
-#include <linux/personality.h>
-#include <linux/tick.h>
-#include <linux/percpu.h>
+#include <linux/reboot.h>
+#include <linux/stddef.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
#include <linux/prctl.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/tick.h>
+#include <linux/user.h>
+#include <linux/cpu.h>
#include <linux/dmi.h>
-#include <linux/ftrace.h>
-#include <linux/uaccess.h>
+#include <linux/err.h>
+#include <linux/smp.h>
+#include <linux/fs.h>
#include <linux/io.h>
-#include <linux/kdebug.h>
+#include <linux/mm.h>

-#include <asm/pgtable.h>
-#include <asm/system.h>
-#include <asm/ldt.h>
#include <asm/processor.h>
-#include <asm/i387.h>
-#include <asm/desc.h>
-#ifdef CONFIG_MATH_EMULATION
#include <asm/math_emu.h>
-#endif
-
-#include <linux/err.h>
-
+#include <asm/syscalls.h>
#include <asm/tlbflush.h>
-#include <asm/cpu.h>
+#include <asm/pgtable.h>
+#include <asm/system.h>
+#include <asm/desc.h>
+#include <asm/i387.h>
#include <asm/idle.h>
-#include <asm/syscalls.h>
+#include <asm/cpu.h>
+#include <asm/ldt.h>
#include <asm/ds.h>

+#include <stdarg.h>
+
asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");

DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task;
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 1937871..8a33d61 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -7,31 +7,31 @@
* Markus Metzger <[email protected]>, Dec 2007
*/

+#include <linux/tracehook.h>
+#include <linux/security.h>
+#include <linux/seccomp.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
-#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/regset.h>
-#include <linux/tracehook.h>
+#include <linux/signal.h>
+#include <linux/audit.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
#include <linux/user.h>
#include <linux/elf.h>
-#include <linux/security.h>
-#include <linux/audit.h>
-#include <linux/seccomp.h>
-#include <linux/signal.h>
+#include <linux/smp.h>
+#include <linux/mm.h>

-#include <asm/uaccess.h>
-#include <asm/pgtable.h>
-#include <asm/system.h>
#include <asm/processor.h>
-#include <asm/i387.h>
#include <asm/debugreg.h>
-#include <asm/ldt.h>
-#include <asm/desc.h>
+#include <asm/pgtable.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
#include <asm/prctl.h>
#include <asm/proto.h>
+#include <asm/desc.h>
+#include <asm/i387.h>
+#include <asm/ldt.h>
#include <asm/ds.h>

#include "tls.h"
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index 6a5a297..303c6d3 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -1,9 +1,9 @@
/*
* This file contains work-arounds for x86 and x86_64 platform bugs.
*/
-#include <linux/pci.h>
-#include <linux/irq.h>

+#include <linux/irq.h>
+#include <linux/pci.h>
#include <asm/hpet.h>

#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI)
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 2aef36d..fbe594b 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -1,28 +1,26 @@
+#include <linux/mc146818rtc.h>
#include <linux/module.h>
#include <linux/reboot.h>
+#include <linux/ctype.h>
#include <linux/init.h>
-#include <linux/pm.h>
+#include <linux/dmi.h>
#include <linux/efi.h>
+#include <linux/pm.h>
+
#include <acpi/reboot.h>
-#include <asm/io.h>
-#include <asm/apic.h>
-#include <asm/desc.h>
-#include <asm/hpet.h>
-#include <asm/pgtable.h>
-#include <asm/proto.h>
+
#include <asm/reboot_fixups.h>
-#include <asm/reboot.h>
#include <asm/pci_x86.h>
+#include <asm/pgtable.h>
#include <asm/virtext.h>
+#include <asm/reboot.h>
+#include <asm/iommu.h>
+#include <asm/proto.h>
+#include <asm/apic.h>
+#include <asm/desc.h>
+#include <asm/hpet.h>
#include <asm/cpu.h>
-
-#ifdef CONFIG_X86_32
-# include <linux/dmi.h>
-# include <linux/ctype.h>
-# include <linux/mc146818rtc.h>
-#else
-# include <asm/iommu.h>
-#endif
+#include <asm/io.h>

/*
* Power off function, if any
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index a0d2623..5693f1e 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -21,92 +21,84 @@
* This file handles the architecture-dependent parts of initialization
*/

-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/mmzone.h>
+#include <linux/init_ohci1394_dma.h>
+#include <linux/dma-mapping.h>
#include <linux/screen_info.h>
-#include <linux/ioport.h>
-#include <linux/acpi.h>
+#include <linux/crash_dump.h>
+#include <linux/iscsi_ibft.h>
#include <linux/apm_bios.h>
-#include <linux/initrd.h>
-#include <linux/bootmem.h>
+#include <linux/kallsyms.h>
+#include <linux/kvm_para.h>
+#include <linux/nodemask.h>
+#include <linux/root_dev.h>
#include <linux/seq_file.h>
+#include <linux/bootmem.h>
#include <linux/console.h>
-#include <linux/mca.h>
-#include <linux/root_dev.h>
+#include <linux/cpufreq.h>
#include <linux/highmem.h>
-#include <linux/module.h>
-#include <linux/efi.h>
-#include <linux/init.h>
-#include <linux/edd.h>
-#include <linux/iscsi_ibft.h>
-#include <linux/nodemask.h>
-#include <linux/kexec.h>
-#include <linux/dmi.h>
-#include <linux/pfn.h>
-#include <linux/pci.h>
-#include <asm/pci-direct.h>
-#include <linux/init_ohci1394_dma.h>
-#include <linux/kvm_para.h>
-
-#include <linux/errno.h>
+#include <linux/uaccess.h>
+#include <linux/ioport.h>
+#include <linux/initrd.h>
#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/mmzone.h>
+#include <linux/percpu.h>
+#include <linux/ptrace.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
-#include <linux/ptrace.h>
+#include <linux/ctype.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/kexec.h>
+#include <linux/sched.h>
+#include <linux/acpi.h>
+#include <linux/init.h>
#include <linux/slab.h>
#include <linux/user.h>
-#include <linux/delay.h>
-
-#include <linux/kallsyms.h>
-#include <linux/cpufreq.h>
-#include <linux/dma-mapping.h>
-#include <linux/ctype.h>
-#include <linux/uaccess.h>
-
-#include <linux/percpu.h>
-#include <linux/crash_dump.h>
+#include <linux/edd.h>
+#include <linux/efi.h>
+#include <linux/dmi.h>
+#include <linux/pci.h>
+#include <linux/pfn.h>
+#include <linux/mca.h>
+#include <linux/mm.h>

#include <video/edid.h>

-#include <asm/mtrr.h>
-#include <asm/apic.h>
-#include <asm/e820.h>
-#include <asm/mpspec.h>
-#include <asm/setup.h>
-#include <asm/efi.h>
-#include <asm/timer.h>
-#include <asm/i8259.h>
-#include <asm/sections.h>
-#include <asm/dmi.h>
-#include <asm/io_apic.h>
-#include <asm/ist.h>
-#include <asm/vmi.h>
+#include <asm/mmu_context.h>
+#include <asm/cacheflush.h>
+#include <asm/hypervisor.h>
+#include <asm/pci-direct.h>
#include <asm/setup_arch.h>
#include <asm/bios_ebda.h>
-#include <asm/cacheflush.h>
#include <asm/processor.h>
-#include <asm/bugs.h>
-
-#include <asm/system.h>
-#include <asm/vsyscall.h>
-#include <asm/cpu.h>
-#include <asm/desc.h>
-#include <asm/dma.h>
-#include <asm/iommu.h>
-#include <asm/gart.h>
-#include <asm/mmu_context.h>
-#include <asm/proto.h>
-
#include <asm/paravirt.h>
-#include <asm/hypervisor.h>
-
-#include <asm/percpu.h>
+#include <asm/sections.h>
#include <asm/topology.h>
+#include <asm/vsyscall.h>
#include <asm/apicdef.h>
-#ifdef CONFIG_X86_64
-#include <asm/numa_64.h>
-#endif
+#include <asm/io_apic.h>
+#include <asm/mpspec.h>
+#include <asm/percpu.h>
+#include <asm/system.h>
+#include <asm/i8259.h>
+#include <asm/iommu.h>
+#include <asm/proto.h>
+#include <asm/setup.h>
+#include <asm/timer.h>
+#include <asm/apic.h>
+#include <asm/bugs.h>
+#include <asm/desc.h>
+#include <asm/e820.h>
+#include <asm/gart.h>
+#include <asm/mtrr.h>
+#include <asm/numa.h>
+#include <asm/cpu.h>
+#include <asm/dma.h>
+#include <asm/dmi.h>
+#include <asm/efi.h>
+#include <asm/ist.h>
+#include <asm/vmi.h>

#ifndef ARCH_SETUP
#define ARCH_SETUP
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 400331b..85e84b4 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -1,23 +1,24 @@
+#include <linux/crash_dump.h>
+#include <linux/topology.h>
+#include <linux/bootmem.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/bootmem.h>
#include <linux/percpu.h>
#include <linux/kexec.h>
-#include <linux/crash_dump.h>
-#include <linux/smp.h>
-#include <linux/topology.h>
+#include <linux/init.h>
#include <linux/pfn.h>
-#include <asm/sections.h>
+#include <linux/smp.h>
+
+#include <asm/stackprotector.h>
#include <asm/processor.h>
-#include <asm/setup.h>
-#include <asm/mpspec.h>
+#include <asm/sections.h>
#include <asm/apicdef.h>
+#include <asm/cpumask.h>
#include <asm/highmem.h>
+#include <asm/mpspec.h>
#include <asm/proto.h>
-#include <asm/cpumask.h>
+#include <asm/setup.h>
#include <asm/cpu.h>
-#include <asm/stackprotector.h>

#ifdef CONFIG_DEBUG_PER_CPU_MAPS
# define DBG(x...) printk(KERN_DEBUG x)
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index dfcc74a..e12975d 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -7,35 +7,30 @@
* 2000-2002 x86-64 support by Andi Kleen
*/

-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
+#include <linux/personality.h>
+#include <linux/tracehook.h>
+#include <linux/uaccess.h>
#include <linux/kernel.h>
+#include <linux/ptrace.h>
#include <linux/signal.h>
+#include <linux/stddef.h>
+#include <linux/unistd.h>
#include <linux/errno.h>
+#include <linux/sched.h>
#include <linux/wait.h>
-#include <linux/ptrace.h>
-#include <linux/tracehook.h>
-#include <linux/unistd.h>
-#include <linux/stddef.h>
-#include <linux/personality.h>
-#include <linux/uaccess.h>
+#include <linux/smp.h>
+#include <linux/mm.h>

+#include <asm/ia32_unistd.h>
#include <asm/processor.h>
+#include <asm/sigframe.h>
+#include <asm/syscalls.h>
#include <asm/ucontext.h>
+#include <asm/syscall.h>
+#include <asm/proto.h>
#include <asm/i387.h>
#include <asm/vdso.h>
-
-#ifdef CONFIG_X86_64
-#include <asm/proto.h>
-#include <asm/ia32_unistd.h>
#include <asm/mce.h>
-#endif /* CONFIG_X86_64 */
-
-#include <asm/syscall.h>
-#include <asm/syscalls.h>
-
-#include <asm/sigframe.h>

#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))

diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 13f33ea..d881655 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -11,22 +11,22 @@
* later.
*/

-#include <linux/init.h>
-
-#include <linux/mm.h>
-#include <linux/delay.h>
-#include <linux/spinlock.h>
#include <linux/kernel_stat.h>
#include <linux/mc146818rtc.h>
-#include <linux/cache.h>
#include <linux/interrupt.h>
+#include <linux/spinlock.h>
+#include <linux/cache.h>
+#include <linux/delay.h>
+#include <linux/init.h>
#include <linux/cpu.h>
+#include <linux/mm.h>

-#include <asm/mtrr.h>
-#include <asm/tlbflush.h>
#include <asm/mmu_context.h>
+#include <asm/tlbflush.h>
#include <asm/proto.h>
#include <asm/apic.h>
+#include <asm/mtrr.h>
+
/*
* Some notes on x86 processor bugs affecting SMP operation:
*
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index ef7d101..60f6dde 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -39,33 +39,32 @@
* Glauber Costa : i386 and x86_64 integration
*/

-#include <linux/init.h>
-#include <linux/smp.h>
+#include <linux/mc146818rtc.h>
+#include <linux/bootmem.h>
#include <linux/module.h>
-#include <linux/sched.h>
#include <linux/percpu.h>
-#include <linux/bootmem.h>
+#include <linux/sched.h>
+#include <linux/init.h>
#include <linux/err.h>
#include <linux/nmi.h>
+#include <linux/smp.h>

+#include <asm/smpboot_hooks.h>
+#include <asm/trampoline.h>
+#include <asm/tlbflush.h>
+#include <asm/pgtable.h>
+#include <asm/setup.h>
+#include <asm/uv/uv.h>
#include <asm/acpi.h>
+#include <asm/apic.h>
#include <asm/desc.h>
-#include <asm/nmi.h>
-#include <asm/irq.h>
#include <asm/idle.h>
-#include <asm/trampoline.h>
-#include <asm/cpu.h>
-#include <asm/numa.h>
-#include <asm/pgtable.h>
-#include <asm/tlbflush.h>
#include <asm/mtrr.h>
+#include <asm/numa.h>
+#include <asm/cpu.h>
+#include <asm/irq.h>
+#include <asm/nmi.h>
#include <asm/vmi.h>
-#include <asm/apic.h>
-#include <asm/setup.h>
-#include <asm/uv/uv.h>
-#include <linux/mc146818rtc.h>
-
-#include <asm/smpboot_hooks.h>

#ifdef CONFIG_X86_32
u8 apicid_2_node[MAX_APICID];
diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c
index f7bddc2..397eb1f 100644
--- a/arch/x86/kernel/stacktrace.c
+++ b/arch/x86/kernel/stacktrace.c
@@ -3,10 +3,12 @@
*
* Copyright (C) 2006-2009 Red Hat, Inc., Ingo Molnar <[email protected]>
*/
-#include <linux/sched.h>
+
#include <linux/stacktrace.h>
-#include <linux/module.h>
#include <linux/uaccess.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+
#include <asm/stacktrace.h>

static void save_stack_warning(void *data, char *msg)
diff --git a/arch/x86/kernel/step.c b/arch/x86/kernel/step.c
index e8b9863..caa27d3 100644
--- a/arch/x86/kernel/step.c
+++ b/arch/x86/kernel/step.c
@@ -1,9 +1,10 @@
/*
* x86 single-step support code, common to 32-bit and 64-bit.
*/
+
+#include <linux/ptrace.h>
#include <linux/sched.h>
#include <linux/mm.h>
-#include <linux/ptrace.h>

unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs)
{
diff --git a/arch/x86/kernel/sys_i386_32.c b/arch/x86/kernel/sys_i386_32.c
index 1884a8d..287fa4b 100644
--- a/arch/x86/kernel/sys_i386_32.c
+++ b/arch/x86/kernel/sys_i386_32.c
@@ -4,23 +4,22 @@
* platform.
*/

+#include <linux/syscalls.h>
+#include <linux/uaccess.h>
+#include <linux/utsname.h>
+#include <linux/unistd.h>
#include <linux/errno.h>
#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/fs.h>
-#include <linux/smp.h>
-#include <linux/sem.h>
-#include <linux/msg.h>
-#include <linux/shm.h>
-#include <linux/stat.h>
-#include <linux/syscalls.h>
-#include <linux/mman.h>
#include <linux/file.h>
-#include <linux/utsname.h>
+#include <linux/mman.h>
+#include <linux/stat.h>
#include <linux/ipc.h>
-
-#include <linux/uaccess.h>
-#include <linux/unistd.h>
+#include <linux/msg.h>
+#include <linux/sem.h>
+#include <linux/shm.h>
+#include <linux/smp.h>
+#include <linux/fs.h>
+#include <linux/mm.h>

#include <asm/syscalls.h>

diff --git a/arch/x86/kernel/time_32.c b/arch/x86/kernel/time_32.c
index 5c5d87f..5ce14b9 100644
--- a/arch/x86/kernel/time_32.c
+++ b/arch/x86/kernel/time_32.c
@@ -28,17 +28,16 @@
* serialize accesses to xtime/lost_ticks).
*/

-#include <linux/init.h>
#include <linux/interrupt.h>
+#include <linux/init.h>
#include <linux/time.h>
#include <linux/mca.h>

+#include <asm/do_timer.h>
#include <asm/setup.h>
+#include <asm/timer.h>
#include <asm/hpet.h>
#include <asm/time.h>
-#include <asm/timer.h>
-
-#include <asm/do_timer.h>

int timer_ack;

diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c
index 6bb7b85..944b8ed 100644
--- a/arch/x86/kernel/tls.c
+++ b/arch/x86/kernel/tls.c
@@ -1,16 +1,16 @@
#include <linux/kernel.h>
+#include <linux/regset.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/user.h>
-#include <linux/regset.h>

+#include <asm/processor.h>
+#include <asm/syscalls.h>
#include <asm/uaccess.h>
-#include <asm/desc.h>
#include <asm/system.h>
-#include <asm/ldt.h>
-#include <asm/processor.h>
#include <asm/proto.h>
-#include <asm/syscalls.h>
+#include <asm/desc.h>
+#include <asm/ldt.h>

#include "tls.h"

diff --git a/arch/x86/kernel/trampoline_32.S b/arch/x86/kernel/trampoline_32.S
index 66d874e..9fa45df 100644
--- a/arch/x86/kernel/trampoline_32.S
+++ b/arch/x86/kernel/trampoline_32.S
@@ -28,8 +28,9 @@
*/

#include <linux/linkage.h>
-#include <asm/segment.h>
+
#include <asm/page_types.h>
+#include <asm/segment.h>

/* We can free up trampoline after bootup if cpu hotplug is not supported. */
#ifndef CONFIG_HOTPLUG_CPU
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index a1d2883..4f1e6cf 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -15,6 +15,7 @@
#include <linux/kprobes.h>
#include <linux/uaccess.h>
#include <linux/utsname.h>
+#include <linux/ioport.h>
#include <linux/kdebug.h>
#include <linux/kernel.h>
#include <linux/module.h>
@@ -25,47 +26,34 @@
#include <linux/kexec.h>
#include <linux/sched.h>
#include <linux/timer.h>
+#include <linux/edac.h>
+#include <linux/eisa.h>
#include <linux/init.h>
#include <linux/bug.h>
+#include <linux/mca.h>
#include <linux/nmi.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/io.h>

-#ifdef CONFIG_EISA
-#include <linux/ioport.h>
-#include <linux/eisa.h>
-#endif
-
-#ifdef CONFIG_MCA
-#include <linux/mca.h>
-#endif
-
-#if defined(CONFIG_EDAC)
-#include <linux/edac.h>
-#endif
-
+#include <asm/processor-flags.h>
+#include <asm/mach_traps.h>
#include <asm/stacktrace.h>
#include <asm/processor.h>
#include <asm/debugreg.h>
+#include <asm/pgalloc.h>
#include <asm/atomic.h>
#include <asm/system.h>
-#include <asm/traps.h>
-#include <asm/desc.h>
-#include <asm/i387.h>
-
-#include <asm/mach_traps.h>
-
-#ifdef CONFIG_X86_64
-#include <asm/pgalloc.h>
#include <asm/proto.h>
-#else
-#include <asm/processor-flags.h>
#include <asm/setup.h>
#include <asm/traps.h>
+#include <asm/desc.h>
+#include <asm/i387.h>

#include "cpu/mcheck/mce.h"

+#ifndef CONFIG_X86_64
+
asmlinkage int system_call(void);

/* Do we ignore FPU interrupts ? */
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 462b9ba..6598ef0 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1,21 +1,21 @@
+#include <linux/clocksource.h>
+#include <linux/acpi_pmtmr.h>
+#include <linux/cpufreq.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/init.h>
#include <linux/module.h>
+#include <linux/percpu.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
#include <linux/timer.h>
-#include <linux/acpi_pmtmr.h>
-#include <linux/cpufreq.h>
+#include <linux/init.h>
#include <linux/dmi.h>
-#include <linux/delay.h>
-#include <linux/clocksource.h>
-#include <linux/percpu.h>

-#include <asm/hpet.h>
+#include <asm/hypervisor.h>
+#include <asm/delay.h>
#include <asm/timer.h>
#include <asm/vgtod.h>
+#include <asm/hpet.h>
#include <asm/time.h>
-#include <asm/delay.h>
-#include <asm/hypervisor.h>

unsigned int cpu_khz; /* TSC clocks / usec, not used here */
EXPORT_SYMBOL(cpu_khz);
diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c
index bf36328..0bac99f 100644
--- a/arch/x86/kernel/tsc_sync.c
+++ b/arch/x86/kernel/tsc_sync.c
@@ -17,8 +17,8 @@
#include <linux/spinlock.h>
#include <linux/kernel.h>
#include <linux/init.h>
-#include <linux/smp.h>
#include <linux/nmi.h>
+#include <linux/smp.h>
#include <asm/tsc.h>

/*
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
index d7ac84e..c05a2c1 100644
--- a/arch/x86/kernel/vm86_32.c
+++ b/arch/x86/kernel/vm86_32.c
@@ -29,24 +29,24 @@
*/

#include <linux/capability.h>
-#include <linux/errno.h>
#include <linux/interrupt.h>
-#include <linux/sched.h>
+#include <linux/highmem.h>
#include <linux/kernel.h>
+#include <linux/ptrace.h>
#include <linux/signal.h>
+#include <linux/stddef.h>
#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
-#include <linux/highmem.h>
-#include <linux/ptrace.h>
#include <linux/audit.h>
-#include <linux/stddef.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/smp.h>
+#include <linux/mm.h>

-#include <asm/uaccess.h>
-#include <asm/io.h>
+#include <asm/syscalls.h>
#include <asm/tlbflush.h>
+#include <asm/uaccess.h>
#include <asm/irq.h>
-#include <asm/syscalls.h>
+#include <asm/io.h>

/*
* Known problems:
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 2b54fe0..778ed67 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -3,12 +3,11 @@
*
* Author: Suresh Siddha <[email protected]>
*/
+
+#include <asm/sigcontext32.h>
#include <linux/bootmem.h>
#include <linux/compat.h>
#include <asm/i387.h>
-#ifdef CONFIG_IA32_EMULATION
-#include <asm/sigcontext32.h>
-#endif
#include <asm/xcr.h>

/*


2009-03-28 15:00:31

by Alexey Dobriyan

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sat, Mar 28, 2009 at 08:18:50PM +0530, Jaswinder Singh Rajput wrote:
> The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
> Ingo Molnar (1):
> Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core
>
> Jaswinder Singh Rajput (49):
> x86: process_32.c include inverse Xmas tree effect

What the heck is this?

> x86: signal.c include inverse Xmas tree effect
> x86: entry_32.S include inverse Xmas tree effect
> x86: traps.c include inverse Xmas tree effect
> x86: irq.c include inverse Xmas tree effect
> x86: irq_32.c include inverse Xmas tree effect
> x86: dumpstack.c include inverse Xmas tree effect
> x86: time_32.c include inverse Xmas tree effect
> x86: ioport.c include inverse Xmas tree effect
> x86: ldt.c include inverse Xmas tree effect
> x86: dumpstack_32.c include inverse Xmas tree effect
> x86: setup.c include inverse Xmas tree effect
> x86: i8259.c include inverse Xmas tree effect
> x86: irqinit_32.c include inverse Xmas tree effect
> x86: probe_roms_32.c include inverse Xmas tree effect
> x86: sys_i386_32.c include inverse Xmas tree effect
> x86: i386_ksyms_32.c include inverse Xmas tree effect
> x86: bootflag.c include inverse Xmas tree effect
> x86: e820.c include inverse Xmas tree effect
> x86: pci-dma.c include inverse Xmas tree effect
> x86: quirks.c include inverse Xmas tree effect
> x86: i8237.c include inverse Xmas tree effect
> x86: alternative.c include inverse Xmas tree effect
> x86: tsc.c include inverse Xmas tree effect
> x86: process.c include inverse Xmas tree effect
> x86: xsave.c include inverse Xmas tree effect
> x86: ptrace.c include inverse Xmas tree effect
> x86: ds.c include inverse Xmas tree effect
> x86: tls.c include inverse Xmas tree effect
> x86: step.c include inverse Xmas tree effect
> x86: stacktrace.c include inverse Xmas tree effect
> x86: reboot.c include inverse Xmas tree effect
> x86: msr.c include inverse Xmas tree effect
> x86: cpuid.c include inverse Xmas tree effect
> x86: early-quirks.c include inverse Xmas tree effect
> x86: smp.c include inverse Xmas tree effect
> x86: smpboot.c include inverse Xmas tree effect
> x86: tsc_sync.c include inverse Xmas tree effect
> x86: setup_percpu.c include inverse Xmas tree effect
> x86: trampoline_32.S include inverse Xmas tree effect
> x86: mpparse.c include inverse Xmas tree effect
> x86: module_32.c include inverse Xmas tree effect
> x86: doublefault_32.c include inverse Xmas tree effect
> x86: vm86_32.c include inverse Xmas tree effect
> ix86: early_printk.c include inverse Xmas tree effect
> x86: pcspeaker.c include inverse Xmas tree effect
> x86: head_32.c include inverse Xmas tree effect
> x86: head.c include inverse Xmas tree effect
> x86: init_task.c include inverse Xmas tree effect
>
> arch/x86/include/asm/proto.h | 2 +
> arch/x86/include/asm/sigcontext32.h | 3 +-
> arch/x86/include/asm/smpboot_hooks.h | 2 +
> arch/x86/include/asm/topology.h | 2 +
> arch/x86/kernel/alternative.c | 11 ++--
> arch/x86/kernel/bootflag.c | 12 ++--
> arch/x86/kernel/cpuid.c | 17 ++---
> arch/x86/kernel/doublefault_32.c | 8 +-
> arch/x86/kernel/ds.c | 11 +--
> arch/x86/kernel/dumpstack.c | 5 +-
> arch/x86/kernel/dumpstack_32.c | 5 +-
> arch/x86/kernel/e820.c | 21 +++---
> arch/x86/kernel/early-quirks.c | 9 ++-
> arch/x86/kernel/early_printk.c | 26 ++++---
> arch/x86/kernel/entry_32.S | 17 +++--
> arch/x86/kernel/head.c | 2 +-
> arch/x86/kernel/head_32.S | 17 +++--
> arch/x86/kernel/i386_ksyms_32.c | 3 +-
> arch/x86/kernel/i8237.c | 3 +-
> arch/x86/kernel/i8259.c | 28 ++++----
> arch/x86/kernel/init_task.c | 8 +-
> arch/x86/kernel/ioport.c | 15 ++--
> arch/x86/kernel/irq.c | 11 ++--
> arch/x86/kernel/irq_32.c | 10 ++--
> arch/x86/kernel/irqinit_32.c | 29 ++++----
> arch/x86/kernel/ldt.c | 14 ++--
> arch/x86/kernel/module_32.c | 7 +-
> arch/x86/kernel/mpparse.c | 24 +++---
> arch/x86/kernel/msr.c | 17 ++---
> arch/x86/kernel/pci-dma.c | 10 ++--
> arch/x86/kernel/pcspeaker.c | 2 +-
> arch/x86/kernel/probe_roms_32.c | 23 +++---
> arch/x86/kernel/process.c | 19 +++---
> arch/x86/kernel/process_32.c | 70 +++++++++----------
> arch/x86/kernel/ptrace.c | 30 ++++----
> arch/x86/kernel/quirks.c | 4 +-
> arch/x86/kernel/reboot.c | 30 ++++----
> arch/x86/kernel/setup.c | 126 ++++++++++++++++------------------
> arch/x86/kernel/setup_percpu.c | 21 +++---
> arch/x86/kernel/signal.c | 33 ++++-----
> arch/x86/kernel/smp.c | 16 ++--
> arch/x86/kernel/smpboot.c | 33 ++++-----
> arch/x86/kernel/stacktrace.c | 6 +-
> arch/x86/kernel/step.c | 3 +-
> arch/x86/kernel/sys_i386_32.c | 25 +++----
> arch/x86/kernel/time_32.c | 7 +-
> arch/x86/kernel/tls.c | 10 ++--
> arch/x86/kernel/trampoline_32.S | 3 +-
> arch/x86/kernel/traps.c | 34 +++------
> arch/x86/kernel/tsc.c | 20 +++---
> arch/x86/kernel/tsc_sync.c | 2 +-
> arch/x86/kernel/vm86_32.c | 20 +++---
> arch/x86/kernel/xsave.c | 5 +-
> 53 files changed, 437 insertions(+), 454 deletions(-)
>
> Complete diff:
> diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
> index 49fb3ec..a8d63be 100644
> --- a/arch/x86/include/asm/proto.h
> +++ b/arch/x86/include/asm/proto.h
> @@ -7,7 +7,9 @@
>
> extern void early_idt_handler(void);
>
> +#ifdef CONFIG_X86_64
> extern void system_call(void);
> +#endif
> extern void syscall_init(void);
>
> extern void ia32_syscall(void);
> diff --git a/arch/x86/include/asm/sigcontext32.h b/arch/x86/include/asm/sigcontext32.h
> index ad1478c..f80df2e 100644
> --- a/arch/x86/include/asm/sigcontext32.h
> +++ b/arch/x86/include/asm/sigcontext32.h
> @@ -1,6 +1,7 @@
> #ifndef _ASM_X86_SIGCONTEXT32_H
> #define _ASM_X86_SIGCONTEXT32_H
>
> +#ifdef CONFIG_IA32_EMULATION
> #include <linux/types.h>
>
> /* signal context for 32bit programs. */
> @@ -73,5 +74,5 @@ struct sigcontext_ia32 {
> unsigned int oldmask;
> unsigned int cr2;
> };
> -
> +#endif
> #endif /* _ASM_X86_SIGCONTEXT32_H */
> diff --git a/arch/x86/include/asm/smpboot_hooks.h b/arch/x86/include/asm/smpboot_hooks.h
> index 1def601..dff6e11 100644
> --- a/arch/x86/include/asm/smpboot_hooks.h
> +++ b/arch/x86/include/asm/smpboot_hooks.h
> @@ -1,6 +1,8 @@
> /* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
> * which needs to alter them. */
>
> +#include <asm/tlbflush.h>
> +
> static inline void smpboot_clear_io_apic_irqs(void)
> {
> #ifdef CONFIG_X86_IO_APIC
> diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
> index 77cfb2c..1f23e58 100644
> --- a/arch/x86/include/asm/topology.h
> +++ b/arch/x86/include/asm/topology.h
> @@ -194,10 +194,12 @@ extern int __node_distance(int, int);
>
> #else /* !CONFIG_NUMA */
>
> +#if 0
> static inline int numa_node_id(void)
> {
> return 0;
> }
> +#endif
>
> static inline int cpu_to_node(int cpu)
> {
> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> index 4c80f15..51fb5c5 100644
> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -1,17 +1,18 @@
> +#include <linux/kprobes.h>
> +#include <linux/vmalloc.h>
> #include <linux/module.h>
> -#include <linux/sched.h>

2009-03-28 15:08:00

by Joerg Roedel

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sat, Mar 28, 2009 at 08:18:50PM +0530, Jaswinder Singh Rajput wrote:
> The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
> Ingo Molnar (1):
> Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core
>
> Jaswinder Singh Rajput (49):
> x86: process_32.c include inverse Xmas tree effect
> x86: signal.c include inverse Xmas tree effect
> x86: entry_32.S include inverse Xmas tree effect
> x86: traps.c include inverse Xmas tree effect
> x86: irq.c include inverse Xmas tree effect
> x86: irq_32.c include inverse Xmas tree effect
> x86: dumpstack.c include inverse Xmas tree effect
> x86: time_32.c include inverse Xmas tree effect
> x86: ioport.c include inverse Xmas tree effect
> x86: ldt.c include inverse Xmas tree effect
> x86: dumpstack_32.c include inverse Xmas tree effect
> x86: setup.c include inverse Xmas tree effect
> x86: i8259.c include inverse Xmas tree effect
> x86: irqinit_32.c include inverse Xmas tree effect
> x86: probe_roms_32.c include inverse Xmas tree effect
> x86: sys_i386_32.c include inverse Xmas tree effect
> x86: i386_ksyms_32.c include inverse Xmas tree effect
> x86: bootflag.c include inverse Xmas tree effect
> x86: e820.c include inverse Xmas tree effect
> x86: pci-dma.c include inverse Xmas tree effect
> x86: quirks.c include inverse Xmas tree effect
> x86: i8237.c include inverse Xmas tree effect
> x86: alternative.c include inverse Xmas tree effect
> x86: tsc.c include inverse Xmas tree effect
> x86: process.c include inverse Xmas tree effect
> x86: xsave.c include inverse Xmas tree effect
> x86: ptrace.c include inverse Xmas tree effect
> x86: ds.c include inverse Xmas tree effect
> x86: tls.c include inverse Xmas tree effect
> x86: step.c include inverse Xmas tree effect
> x86: stacktrace.c include inverse Xmas tree effect
> x86: reboot.c include inverse Xmas tree effect
> x86: msr.c include inverse Xmas tree effect
> x86: cpuid.c include inverse Xmas tree effect
> x86: early-quirks.c include inverse Xmas tree effect
> x86: smp.c include inverse Xmas tree effect
> x86: smpboot.c include inverse Xmas tree effect
> x86: tsc_sync.c include inverse Xmas tree effect
> x86: setup_percpu.c include inverse Xmas tree effect
> x86: trampoline_32.S include inverse Xmas tree effect
> x86: mpparse.c include inverse Xmas tree effect
> x86: module_32.c include inverse Xmas tree effect
> x86: doublefault_32.c include inverse Xmas tree effect
> x86: vm86_32.c include inverse Xmas tree effect
> ix86: early_printk.c include inverse Xmas tree effect
> x86: pcspeaker.c include inverse Xmas tree effect
> x86: head_32.c include inverse Xmas tree effect
> x86: head.c include inverse Xmas tree effect
> x86: init_task.c include inverse Xmas tree effect

Where have you sent these patches for review?

> Complete diff:

No. Complete diffs are not easy to review. At least not in this size.

> diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
> index 49fb3ec..a8d63be 100644
> --- a/arch/x86/include/asm/proto.h
> +++ b/arch/x86/include/asm/proto.h
> @@ -7,7 +7,9 @@
>
> extern void early_idt_handler(void);
>
> +#ifdef CONFIG_X86_64
> extern void system_call(void);
> +#endif
> extern void syscall_init(void);
>
> extern void ia32_syscall(void);
> diff --git a/arch/x86/include/asm/sigcontext32.h b/arch/x86/include/asm/sigcontext32.h
> index ad1478c..f80df2e 100644
> --- a/arch/x86/include/asm/sigcontext32.h
> +++ b/arch/x86/include/asm/sigcontext32.h
> @@ -1,6 +1,7 @@
> #ifndef _ASM_X86_SIGCONTEXT32_H
> #define _ASM_X86_SIGCONTEXT32_H
>
> +#ifdef CONFIG_IA32_EMULATION
> #include <linux/types.h>
>
> /* signal context for 32bit programs. */
> @@ -73,5 +74,5 @@ struct sigcontext_ia32 {
> unsigned int oldmask;
> unsigned int cr2;
> };
> -
> +#endif
> #endif /* _ASM_X86_SIGCONTEXT32_H */

This doesn't seem to be related to your header include rearangements.

> diff --git a/arch/x86/include/asm/smpboot_hooks.h b/arch/x86/include/asm/smpboot_hooks.h
> index 1def601..dff6e11 100644
> --- a/arch/x86/include/asm/smpboot_hooks.h
> +++ b/arch/x86/include/asm/smpboot_hooks.h
> @@ -1,6 +1,8 @@
> /* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
> * which needs to alter them. */
>
> +#include <asm/tlbflush.h>
> +
> static inline void smpboot_clear_io_apic_irqs(void)
> {
> #ifdef CONFIG_X86_IO_APIC
> diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
> index 77cfb2c..1f23e58 100644
> --- a/arch/x86/include/asm/topology.h
> +++ b/arch/x86/include/asm/topology.h
> @@ -194,10 +194,12 @@ extern int __node_distance(int, int);
>
> #else /* !CONFIG_NUMA */
>
> +#if 0
> static inline int numa_node_id(void)
> {
> return 0;
> }
> +#endif

"#if 0" ???

2009-03-28 15:17:20

by Hugh Dickins

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sat, 28 Mar 2009, Jaswinder Singh Rajput wrote:
> The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
> Ingo Molnar (1):
> Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core
>
> Jaswinder Singh Rajput (49):
> x86: process_32.c include inverse Xmas tree effect
> x86: signal.c include inverse Xmas tree effect
> x86: entry_32.S include inverse Xmas tree effect
> x86: traps.c include inverse Xmas tree effect
> x86: irq.c include inverse Xmas tree effect
> x86: irq_32.c include inverse Xmas tree effect
> x86: dumpstack.c include inverse Xmas tree effect
> x86: time_32.c include inverse Xmas tree effect
> x86: ioport.c include inverse Xmas tree effect
> x86: ldt.c include inverse Xmas tree effect
> x86: dumpstack_32.c include inverse Xmas tree effect
> x86: setup.c include inverse Xmas tree effect
> x86: i8259.c include inverse Xmas tree effect
> x86: irqinit_32.c include inverse Xmas tree effect
> x86: probe_roms_32.c include inverse Xmas tree effect
> x86: sys_i386_32.c include inverse Xmas tree effect
> x86: i386_ksyms_32.c include inverse Xmas tree effect
> x86: bootflag.c include inverse Xmas tree effect
> x86: e820.c include inverse Xmas tree effect
> x86: pci-dma.c include inverse Xmas tree effect
> x86: quirks.c include inverse Xmas tree effect
> x86: i8237.c include inverse Xmas tree effect
> x86: alternative.c include inverse Xmas tree effect
> x86: tsc.c include inverse Xmas tree effect
> x86: process.c include inverse Xmas tree effect
> x86: xsave.c include inverse Xmas tree effect
> x86: ptrace.c include inverse Xmas tree effect
> x86: ds.c include inverse Xmas tree effect
> x86: tls.c include inverse Xmas tree effect
> x86: step.c include inverse Xmas tree effect
> x86: stacktrace.c include inverse Xmas tree effect
> x86: reboot.c include inverse Xmas tree effect
> x86: msr.c include inverse Xmas tree effect
> x86: cpuid.c include inverse Xmas tree effect
> x86: early-quirks.c include inverse Xmas tree effect
> x86: smp.c include inverse Xmas tree effect
> x86: smpboot.c include inverse Xmas tree effect
> x86: tsc_sync.c include inverse Xmas tree effect
> x86: setup_percpu.c include inverse Xmas tree effect
> x86: trampoline_32.S include inverse Xmas tree effect
> x86: mpparse.c include inverse Xmas tree effect
> x86: module_32.c include inverse Xmas tree effect
> x86: doublefault_32.c include inverse Xmas tree effect
> x86: vm86_32.c include inverse Xmas tree effect
> ix86: early_printk.c include inverse Xmas tree effect
> x86: pcspeaker.c include inverse Xmas tree effect
> x86: head_32.c include inverse Xmas tree effect
> x86: head.c include inverse Xmas tree effect
> x86: init_task.c include inverse Xmas tree effect

Gasp.

Please find a better use for your time.

Imagine, there might be developers out there with real work
to do in these files: all you are doing is throwing silly
little obstacles in their way.

IMHO
Hugh

[snip most of it to leave one example]

> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -1,17 +1,18 @@
> +#include <linux/kprobes.h>
> +#include <linux/vmalloc.h>
> #include <linux/module.h>
> -#include <linux/sched.h>
> #include <linux/mutex.h>
> +#include <linux/sched.h>
> #include <linux/list.h>
> -#include <linux/kprobes.h>
> #include <linux/mm.h>
> -#include <linux/vmalloc.h>
> +
> #include <asm/alternative.h>
> +#include <asm/cacheflush.h>
> #include <asm/sections.h>
> +#include <asm/vsyscall.h>
> #include <asm/pgtable.h>
> #include <asm/mce.h>
> #include <asm/nmi.h>
> -#include <asm/vsyscall.h>
> -#include <asm/cacheflush.h>
> #include <asm/io.h>
>
> #define MAX_PATCH_LEN (255-1)

2009-03-28 15:51:24

by Alexey Dobriyan

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sat, Mar 28, 2009 at 03:55:49PM +0000, Alan Cox wrote:
> > kenel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core
> > >
> > > Jaswinder Singh Rajput (49):
> > > x86: process_32.c include inverse Xmas tree effect
> >
> > What the heck is this?
>
> Does inverse christmas tree effect not translate well. It could perhaps
> have been more clearly explained.
>
> Getting the includes under control is a good thing and saves everyone
> time.

Moving #includes up and down is not getting them under control.

2009-03-28 15:57:36

by Alan

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

> > Getting the includes under control is a good thing and saves everyone
> > time.
>
> Moving #includes up and down is not getting them under control.

Look a bit deeper and youĺl see what is going on (or tell your gcc to log
the include calls and it will become very apparent)

2009-03-28 16:13:15

by Jaswinder Singh Rajput

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sat, 2009-03-28 at 18:58 +0300, Alexey Dobriyan wrote:
> On Sat, Mar 28, 2009 at 03:55:49PM +0000, Alan Cox wrote:
> > > kenel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core
> > > >
> > > > Jaswinder Singh Rajput (49):
> > > > x86: process_32.c include inverse Xmas tree effect
> > >
> > > What the heck is this?
> >
> > Does inverse christmas tree effect not translate well. It could perhaps
> > have been more clearly explained.
> >
> > Getting the includes under control is a good thing and saves everyone
> > time.
>
> Moving #includes up and down is not getting them under control.

Here is Ingo's response about this effect:

On Sun, 2009-03-15 at 05:54 +0100, Ingo Molnar wrote:
> * Li Zefan <[email protected]> wrote:
>
> > > #include <linux/debugfs.h>
> > > #include <linux/uaccess.h>
> > > -#include <linux/stat.h>
> > > +#include <linux/module.h>
> > > #include <linux/init.h>
> > > +#include <linux/stat.h>
> > > #include <linux/io.h>
> > > #include <linux/mm.h>
> > > -#include <linux/module.h>
> > >
> >
> > Just curious about the rule to sort those includes, and why they need
> > to be rearranged.
>
> Such includes (the 'reverse christmas tree'):
>
> #include <linux/interrupt.h>
> #include <linux/mmiotrace.h>
> #include <linux/bootmem.h>
> #include <linux/compiler.h>
> #include <linux/highmem.h>
> #include <linux/kprobes.h>
> #include <linux/uaccess.h>
> #include <linux/vmalloc.h>
> #include <linux/vt_kern.h>
> #include <linux/signal.h>
> #include <linux/kernel.h>
> #include <linux/ptrace.h>
> #include <linux/string.h>
> #include <linux/module.h>
> #include <linux/kdebug.h>
> #include <linux/errno.h>
> #include <linux/magic.h>
> #include <linux/sched.h>
> #include <linux/types.h>
> #include <linux/init.h>
> #include <linux/mman.h>
> #include <linux/tty.h>
> #include <linux/smp.h>
> #include <linux/mm.h>
>
> #include <asm/kmemcheck.h>
> #include <asm/tlbflush.h>
> #include <asm/pgalloc.h>
> #include <asm/segment.h>
> #include <asm/system.h>
> #include <asm/proto.h>
> #include <asm/traps.h>
> #include <asm/desc.h>
>
> are used by x86 architecture code (and some other subsystems) to
> reduce the likelyhood of patch conflicts in commonly modified
> kernel files.
>
> Without such ordering developers typically append to the
> existing list of include files when introducing a new header -
> creating an almost certain patch conflict. Via the above
> ordering, new headers get distributed roughly evenly amongst the
> full range - and thus the chance of patch conflicts is much
> smaller.
>
> This way it also looks a bit more structured and bit less messy.
> It looks unprofessional and sloppy if a .c file starts with a
> big block of thrown-together include files.
>
> Ingo

2009-03-28 16:24:25

by Alan

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

> kenel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core
> >
> > Jaswinder Singh Rajput (49):
> > x86: process_32.c include inverse Xmas tree effect
>
> What the heck is this?

Does inverse christmas tree effect not translate well. It could perhaps
have been more clearly explained.

Getting the includes under control is a good thing and saves everyone
time.

Alan

2009-03-28 16:49:16

by Jaswinder Singh Rajput

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sat, 2009-03-28 at 16:07 +0100, Joerg Roedel wrote:
> On Sat, Mar 28, 2009 at 08:18:50PM +0530, Jaswinder Singh Rajput wrote:
> > The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
> > Ingo Molnar (1):
> > Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core
> >
> > are available in the git repository at:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core
> >
> > Jaswinder Singh Rajput (49):
> > x86: process_32.c include inverse Xmas tree effect
> > x86: signal.c include inverse Xmas tree effect
> > x86: entry_32.S include inverse Xmas tree effect
> > x86: traps.c include inverse Xmas tree effect
> > x86: irq.c include inverse Xmas tree effect
> > x86: irq_32.c include inverse Xmas tree effect
> > x86: dumpstack.c include inverse Xmas tree effect
> > x86: time_32.c include inverse Xmas tree effect
> > x86: ioport.c include inverse Xmas tree effect
> > x86: ldt.c include inverse Xmas tree effect
> > x86: dumpstack_32.c include inverse Xmas tree effect
> > x86: setup.c include inverse Xmas tree effect
> > x86: i8259.c include inverse Xmas tree effect
> > x86: irqinit_32.c include inverse Xmas tree effect
> > x86: probe_roms_32.c include inverse Xmas tree effect
> > x86: sys_i386_32.c include inverse Xmas tree effect
> > x86: i386_ksyms_32.c include inverse Xmas tree effect
> > x86: bootflag.c include inverse Xmas tree effect
> > x86: e820.c include inverse Xmas tree effect
> > x86: pci-dma.c include inverse Xmas tree effect
> > x86: quirks.c include inverse Xmas tree effect
> > x86: i8237.c include inverse Xmas tree effect
> > x86: alternative.c include inverse Xmas tree effect
> > x86: tsc.c include inverse Xmas tree effect
> > x86: process.c include inverse Xmas tree effect
> > x86: xsave.c include inverse Xmas tree effect
> > x86: ptrace.c include inverse Xmas tree effect
> > x86: ds.c include inverse Xmas tree effect
> > x86: tls.c include inverse Xmas tree effect
> > x86: step.c include inverse Xmas tree effect
> > x86: stacktrace.c include inverse Xmas tree effect
> > x86: reboot.c include inverse Xmas tree effect
> > x86: msr.c include inverse Xmas tree effect
> > x86: cpuid.c include inverse Xmas tree effect
> > x86: early-quirks.c include inverse Xmas tree effect
> > x86: smp.c include inverse Xmas tree effect
> > x86: smpboot.c include inverse Xmas tree effect
> > x86: tsc_sync.c include inverse Xmas tree effect
> > x86: setup_percpu.c include inverse Xmas tree effect
> > x86: trampoline_32.S include inverse Xmas tree effect
> > x86: mpparse.c include inverse Xmas tree effect
> > x86: module_32.c include inverse Xmas tree effect
> > x86: doublefault_32.c include inverse Xmas tree effect
> > x86: vm86_32.c include inverse Xmas tree effect
> > ix86: early_printk.c include inverse Xmas tree effect
> > x86: pcspeaker.c include inverse Xmas tree effect
> > x86: head_32.c include inverse Xmas tree effect
> > x86: head.c include inverse Xmas tree effect
> > x86: init_task.c include inverse Xmas tree effect
>
> Where have you sent these patches for review?
>

-tip's master.

> > Complete diff:
>
> No. Complete diffs are not easy to review. At least not in this size.

46 of 49 are clean patches, and only 3 are doubtful which you pointed. I
am attaching those patches for feedback.

>
> > diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
> > index 49fb3ec..a8d63be 100644
> > --- a/arch/x86/include/asm/proto.h
> > +++ b/arch/x86/include/asm/proto.h
> > @@ -7,7 +7,9 @@
> >
> > extern void early_idt_handler(void);
> >
> > +#ifdef CONFIG_X86_64
> > extern void system_call(void);
> > +#endif
> > extern void syscall_init(void);
> >
> > extern void ia32_syscall(void);
> > diff --git a/arch/x86/include/asm/sigcontext32.h b/arch/x86/include/asm/sigcontext32.h
> > index ad1478c..f80df2e 100644
> > --- a/arch/x86/include/asm/sigcontext32.h
> > +++ b/arch/x86/include/asm/sigcontext32.h
> > @@ -1,6 +1,7 @@
> > #ifndef _ASM_X86_SIGCONTEXT32_H
> > #define _ASM_X86_SIGCONTEXT32_H
> >
> > +#ifdef CONFIG_IA32_EMULATION
> > #include <linux/types.h>
> >
> > /* signal context for 32bit programs. */
> > @@ -73,5 +74,5 @@ struct sigcontext_ia32 {
> > unsigned int oldmask;
> > unsigned int cr2;
> > };
> > -
> > +#endif
> > #endif /* _ASM_X86_SIGCONTEXT32_H */
>
> This doesn't seem to be related to your header include rearangements.
>

Please check this patch then you will find the relation:

From: Jaswinder Singh Rajput <[email protected]>
Date: Sat, 28 Mar 2009 16:02:42 +0530
Subject: [PATCH] x86: xsave.c include inverse Xmas tree effect

Impact: Xmas tree effect

Signed-off-by: Jaswinder Singh Rajput <[email protected]>
---
arch/x86/include/asm/sigcontext32.h | 3 ++-
arch/x86/kernel/xsave.c | 5 ++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/sigcontext32.h b/arch/x86/include/asm/sigcontext32.h
index ad1478c..f80df2e 100644
--- a/arch/x86/include/asm/sigcontext32.h
+++ b/arch/x86/include/asm/sigcontext32.h
@@ -1,6 +1,7 @@
#ifndef _ASM_X86_SIGCONTEXT32_H
#define _ASM_X86_SIGCONTEXT32_H

+#ifdef CONFIG_IA32_EMULATION
#include <linux/types.h>

/* signal context for 32bit programs. */
@@ -73,5 +74,5 @@ struct sigcontext_ia32 {
unsigned int oldmask;
unsigned int cr2;
};
-
+#endif
#endif /* _ASM_X86_SIGCONTEXT32_H */
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 2b54fe0..778ed67 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -3,12 +3,11 @@
*
* Author: Suresh Siddha <[email protected]>
*/
+
+#include <asm/sigcontext32.h>
#include <linux/bootmem.h>
#include <linux/compat.h>
#include <asm/i387.h>
-#ifdef CONFIG_IA32_EMULATION
-#include <asm/sigcontext32.h>
-#endif
#include <asm/xcr.h>

/*
--
1.6.0.6



> > diff --git a/arch/x86/include/asm/smpboot_hooks.h b/arch/x86/include/asm/smpboot_hooks.h
> > index 1def601..dff6e11 100644
> > --- a/arch/x86/include/asm/smpboot_hooks.h
> > +++ b/arch/x86/include/asm/smpboot_hooks.h
> > @@ -1,6 +1,8 @@
> > /* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
> > * which needs to alter them. */
> >
> > +#include <asm/tlbflush.h>
> > +
> > static inline void smpboot_clear_io_apic_irqs(void)
> > {
> > #ifdef CONFIG_X86_IO_APIC

From: Jaswinder Singh Rajput <[email protected]>
Date: Sat, 28 Mar 2009 16:46:42 +0530
Subject: [PATCH] x86: smpboot.c include inverse Xmas tree effect

Impact: Xmas tree effect

Signed-off-by: Jaswinder Singh Rajput <[email protected]>
---
arch/x86/include/asm/smpboot_hooks.h | 2 ++
arch/x86/kernel/smpboot.c | 33 ++++++++++++++++-----------------
2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/arch/x86/include/asm/smpboot_hooks.h b/arch/x86/include/asm/smpboot_hooks.h
index 1def601..dff6e11 100644
--- a/arch/x86/include/asm/smpboot_hooks.h
+++ b/arch/x86/include/asm/smpboot_hooks.h
@@ -1,6 +1,8 @@
/* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
* which needs to alter them. */

+#include <asm/tlbflush.h>
+
static inline void smpboot_clear_io_apic_irqs(void)
{
#ifdef CONFIG_X86_IO_APIC
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index ef7d101..60f6dde 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -39,33 +39,32 @@
* Glauber Costa : i386 and x86_64 integration
*/

-#include <linux/init.h>
-#include <linux/smp.h>
+#include <linux/mc146818rtc.h>
+#include <linux/bootmem.h>
#include <linux/module.h>
-#include <linux/sched.h>
#include <linux/percpu.h>
-#include <linux/bootmem.h>
+#include <linux/sched.h>
+#include <linux/init.h>
#include <linux/err.h>
#include <linux/nmi.h>
+#include <linux/smp.h>

+#include <asm/smpboot_hooks.h>
+#include <asm/trampoline.h>
+#include <asm/tlbflush.h>
+#include <asm/pgtable.h>
+#include <asm/setup.h>
+#include <asm/uv/uv.h>
#include <asm/acpi.h>
+#include <asm/apic.h>
#include <asm/desc.h>
-#include <asm/nmi.h>
-#include <asm/irq.h>
#include <asm/idle.h>
-#include <asm/trampoline.h>
-#include <asm/cpu.h>
-#include <asm/numa.h>
-#include <asm/pgtable.h>
-#include <asm/tlbflush.h>
#include <asm/mtrr.h>
+#include <asm/numa.h>
+#include <asm/cpu.h>
+#include <asm/irq.h>
+#include <asm/nmi.h>
#include <asm/vmi.h>
-#include <asm/apic.h>
-#include <asm/setup.h>
-#include <asm/uv/uv.h>
-#include <linux/mc146818rtc.h>
-
-#include <asm/smpboot_hooks.h>

#ifdef CONFIG_X86_32
u8 apicid_2_node[MAX_APICID];
--
1.6.0.6


> > diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
> > index 77cfb2c..1f23e58 100644
> > --- a/arch/x86/include/asm/topology.h
> > +++ b/arch/x86/include/asm/topology.h
> > @@ -194,10 +194,12 @@ extern int __node_distance(int, int);
> >
> > #else /* !CONFIG_NUMA */
> >
> > +#if 0
> > static inline int numa_node_id(void)
> > {
> > return 0;
> > }
> > +#endif
>
> "#if 0" ???
>

Hmm, this is really funny and doubtful. numa_node_id is already defined.
Rusty :-)

From: Jaswinder Singh Rajput <[email protected]>
Date: Sat, 28 Mar 2009 17:11:43 +0530
Subject: [PATCH] x86: setup_percpu.c include inverse Xmas tree effect

Impact: Xmas tree effect

Signed-off-by: Jaswinder Singh Rajput <[email protected]>
---
arch/x86/include/asm/topology.h | 2 ++
arch/x86/kernel/setup_percpu.c | 21 +++++++++++----------
2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index 77cfb2c..1f23e58 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -194,10 +194,12 @@ extern int __node_distance(int, int);

#else /* !CONFIG_NUMA */

+#if 0
static inline int numa_node_id(void)
{
return 0;
}
+#endif

static inline int cpu_to_node(int cpu)
{
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 400331b..85e84b4 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -1,23 +1,24 @@
+#include <linux/crash_dump.h>
+#include <linux/topology.h>
+#include <linux/bootmem.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/bootmem.h>
#include <linux/percpu.h>
#include <linux/kexec.h>
-#include <linux/crash_dump.h>
-#include <linux/smp.h>
-#include <linux/topology.h>
+#include <linux/init.h>
#include <linux/pfn.h>
-#include <asm/sections.h>
+#include <linux/smp.h>
+
+#include <asm/stackprotector.h>
#include <asm/processor.h>
-#include <asm/setup.h>
-#include <asm/mpspec.h>
+#include <asm/sections.h>
#include <asm/apicdef.h>
+#include <asm/cpumask.h>
#include <asm/highmem.h>
+#include <asm/mpspec.h>
#include <asm/proto.h>
-#include <asm/cpumask.h>
+#include <asm/setup.h>
#include <asm/cpu.h>
-#include <asm/stackprotector.h>

#ifdef CONFIG_DEBUG_PER_CPU_MAPS
# define DBG(x...) printk(KERN_DEBUG x)
--
1.6.0.6

--
JSR

2009-03-28 17:17:20

by Jaswinder Singh Rajput

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sat, 2009-03-28 at 22:18 +0530, Jaswinder Singh Rajput wrote:
> On Sat, 2009-03-28 at 16:07 +0100, Joerg Roedel wrote:
> > On Sat, Mar 28, 2009 at 08:18:50PM +0530, Jaswinder Singh Rajput wrote:
> > > The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
> > > Ingo Molnar (1):
> > > Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core
> > >
> > > are available in the git repository at:
> > >
> > > git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core
> > >
> > > Jaswinder Singh Rajput (49):
> > > x86: process_32.c include inverse Xmas tree effect
> > > x86: signal.c include inverse Xmas tree effect
> > > x86: entry_32.S include inverse Xmas tree effect
> > > x86: traps.c include inverse Xmas tree effect
> > > x86: irq.c include inverse Xmas tree effect
> > > x86: irq_32.c include inverse Xmas tree effect
> > > x86: dumpstack.c include inverse Xmas tree effect
> > > x86: time_32.c include inverse Xmas tree effect
> > > x86: ioport.c include inverse Xmas tree effect
> > > x86: ldt.c include inverse Xmas tree effect
> > > x86: dumpstack_32.c include inverse Xmas tree effect
> > > x86: setup.c include inverse Xmas tree effect
> > > x86: i8259.c include inverse Xmas tree effect
> > > x86: irqinit_32.c include inverse Xmas tree effect
> > > x86: probe_roms_32.c include inverse Xmas tree effect
> > > x86: sys_i386_32.c include inverse Xmas tree effect
> > > x86: i386_ksyms_32.c include inverse Xmas tree effect
> > > x86: bootflag.c include inverse Xmas tree effect
> > > x86: e820.c include inverse Xmas tree effect
> > > x86: pci-dma.c include inverse Xmas tree effect
> > > x86: quirks.c include inverse Xmas tree effect
> > > x86: i8237.c include inverse Xmas tree effect
> > > x86: alternative.c include inverse Xmas tree effect
> > > x86: tsc.c include inverse Xmas tree effect
> > > x86: process.c include inverse Xmas tree effect
> > > x86: xsave.c include inverse Xmas tree effect
> > > x86: ptrace.c include inverse Xmas tree effect
> > > x86: ds.c include inverse Xmas tree effect
> > > x86: tls.c include inverse Xmas tree effect
> > > x86: step.c include inverse Xmas tree effect
> > > x86: stacktrace.c include inverse Xmas tree effect
> > > x86: reboot.c include inverse Xmas tree effect
> > > x86: msr.c include inverse Xmas tree effect
> > > x86: cpuid.c include inverse Xmas tree effect
> > > x86: early-quirks.c include inverse Xmas tree effect
> > > x86: smp.c include inverse Xmas tree effect
> > > x86: smpboot.c include inverse Xmas tree effect
> > > x86: tsc_sync.c include inverse Xmas tree effect
> > > x86: setup_percpu.c include inverse Xmas tree effect
> > > x86: trampoline_32.S include inverse Xmas tree effect
> > > x86: mpparse.c include inverse Xmas tree effect
> > > x86: module_32.c include inverse Xmas tree effect
> > > x86: doublefault_32.c include inverse Xmas tree effect
> > > x86: vm86_32.c include inverse Xmas tree effect
> > > ix86: early_printk.c include inverse Xmas tree effect
> > > x86: pcspeaker.c include inverse Xmas tree effect
> > > x86: head_32.c include inverse Xmas tree effect
> > > x86: head.c include inverse Xmas tree effect
> > > x86: init_task.c include inverse Xmas tree effect
> >
> > Where have you sent these patches for review?
> >
>
> -tip's master.
>
> > > Complete diff:
> >
> > No. Complete diffs are not easy to review. At least not in this size.
>
> 46 of 49 are clean patches, and only 3 are doubtful which you pointed. I
> am attaching those patches for feedback.
>

Ahh here is one more:

> >
> > > diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
> > > index 49fb3ec..a8d63be 100644
> > > --- a/arch/x86/include/asm/proto.h
> > > +++ b/arch/x86/include/asm/proto.h
> > > @@ -7,7 +7,9 @@
> > >
> > > extern void early_idt_handler(void);
> > >
> > > +#ifdef CONFIG_X86_64
> > > extern void system_call(void);
> > > +#endif
> > > extern void syscall_init(void);
> > >
> > > extern void ia32_syscall(void);

From: Jaswinder Singh Rajput <[email protected]>
Date: Sat, 28 Mar 2009 14:12:34 +0530
Subject: [PATCH] x86: traps.c include inverse Xmas tree effect

Impact: Xmas tree effect

Signed-off-by: Jaswinder Singh Rajput <[email protected]>
---
arch/x86/include/asm/proto.h | 2 ++
arch/x86/kernel/traps.c | 34 +++++++++++-----------------------
2 files changed, 13 insertions(+), 23 deletions(-)

diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
index 49fb3ec..a8d63be 100644
--- a/arch/x86/include/asm/proto.h
+++ b/arch/x86/include/asm/proto.h
@@ -7,7 +7,9 @@

extern void early_idt_handler(void);

+#ifdef CONFIG_X86_64
extern void system_call(void);
+#endif
extern void syscall_init(void);

extern void ia32_syscall(void);
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index a1d2883..4f1e6cf 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -15,6 +15,7 @@
#include <linux/kprobes.h>
#include <linux/uaccess.h>
#include <linux/utsname.h>
+#include <linux/ioport.h>
#include <linux/kdebug.h>
#include <linux/kernel.h>
#include <linux/module.h>
@@ -25,47 +26,34 @@
#include <linux/kexec.h>
#include <linux/sched.h>
#include <linux/timer.h>
+#include <linux/edac.h>
+#include <linux/eisa.h>
#include <linux/init.h>
#include <linux/bug.h>
+#include <linux/mca.h>
#include <linux/nmi.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/io.h>

-#ifdef CONFIG_EISA
-#include <linux/ioport.h>
-#include <linux/eisa.h>
-#endif
-
-#ifdef CONFIG_MCA
-#include <linux/mca.h>
-#endif
-
-#if defined(CONFIG_EDAC)
-#include <linux/edac.h>
-#endif
-
+#include <asm/processor-flags.h>
+#include <asm/mach_traps.h>
#include <asm/stacktrace.h>
#include <asm/processor.h>
#include <asm/debugreg.h>
+#include <asm/pgalloc.h>
#include <asm/atomic.h>
#include <asm/system.h>
-#include <asm/traps.h>
-#include <asm/desc.h>
-#include <asm/i387.h>
-
-#include <asm/mach_traps.h>
-
-#ifdef CONFIG_X86_64
-#include <asm/pgalloc.h>
#include <asm/proto.h>
-#else
-#include <asm/processor-flags.h>
#include <asm/setup.h>
#include <asm/traps.h>
+#include <asm/desc.h>
+#include <asm/i387.h>

#include "cpu/mcheck/mce.h"

+#ifndef CONFIG_X86_64
+
asmlinkage int system_call(void);

/* Do we ignore FPU interrupts ? */
--
1.6.0.6


> > > diff --git a/arch/x86/include/asm/sigcontext32.h b/arch/x86/include/asm/sigcontext32.h
> > > index ad1478c..f80df2e 100644
> > > --- a/arch/x86/include/asm/sigcontext32.h
> > > +++ b/arch/x86/include/asm/sigcontext32.h
> > > @@ -1,6 +1,7 @@
> > > #ifndef _ASM_X86_SIGCONTEXT32_H
> > > #define _ASM_X86_SIGCONTEXT32_H
> > >
> > > +#ifdef CONFIG_IA32_EMULATION
> > > #include <linux/types.h>
> > >
> > > /* signal context for 32bit programs. */
> > > @@ -73,5 +74,5 @@ struct sigcontext_ia32 {
> > > unsigned int oldmask;
> > > unsigned int cr2;
> > > };
> > > -
> > > +#endif
> > > #endif /* _ASM_X86_SIGCONTEXT32_H */
> >
> > This doesn't seem to be related to your header include rearangements.
> >
>
> Please check this patch then you will find the relation:
>
> From: Jaswinder Singh Rajput <[email protected]>
> Date: Sat, 28 Mar 2009 16:02:42 +0530
> Subject: [PATCH] x86: xsave.c include inverse Xmas tree effect
>
> Impact: Xmas tree effect
>
> Signed-off-by: Jaswinder Singh Rajput <[email protected]>
> ---
> arch/x86/include/asm/sigcontext32.h | 3 ++-
> arch/x86/kernel/xsave.c | 5 ++---
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/include/asm/sigcontext32.h b/arch/x86/include/asm/sigcontext32.h
> index ad1478c..f80df2e 100644
> --- a/arch/x86/include/asm/sigcontext32.h
> +++ b/arch/x86/include/asm/sigcontext32.h
> @@ -1,6 +1,7 @@
> #ifndef _ASM_X86_SIGCONTEXT32_H
> #define _ASM_X86_SIGCONTEXT32_H
>
> +#ifdef CONFIG_IA32_EMULATION
> #include <linux/types.h>
>
> /* signal context for 32bit programs. */
> @@ -73,5 +74,5 @@ struct sigcontext_ia32 {
> unsigned int oldmask;
> unsigned int cr2;
> };
> -
> +#endif
> #endif /* _ASM_X86_SIGCONTEXT32_H */
> diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
> index 2b54fe0..778ed67 100644
> --- a/arch/x86/kernel/xsave.c
> +++ b/arch/x86/kernel/xsave.c
> @@ -3,12 +3,11 @@
> *
> * Author: Suresh Siddha <[email protected]>
> */
> +
> +#include <asm/sigcontext32.h>
> #include <linux/bootmem.h>
> #include <linux/compat.h>
> #include <asm/i387.h>
> -#ifdef CONFIG_IA32_EMULATION
> -#include <asm/sigcontext32.h>
> -#endif
> #include <asm/xcr.h>
>
> /*
> --
> 1.6.0.6

this one looks much better:

From: Jaswinder Singh Rajput <[email protected]>
Date: Sat, 28 Mar 2009 16:02:42 +0530
Subject: [PATCH] x86: xsave.c include inverse Xmas tree effect

Impact: Xmas tree effect

Signed-off-by: Jaswinder Singh Rajput <[email protected]>
---
arch/x86/include/asm/sigcontext32.h | 3 ++-
arch/x86/kernel/xsave.c | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/sigcontext32.h b/arch/x86/include/asm/sigcontext32.h
index ad1478c..f80df2e 100644
--- a/arch/x86/include/asm/sigcontext32.h
+++ b/arch/x86/include/asm/sigcontext32.h
@@ -1,6 +1,7 @@
#ifndef _ASM_X86_SIGCONTEXT32_H
#define _ASM_X86_SIGCONTEXT32_H

+#ifdef CONFIG_IA32_EMULATION
#include <linux/types.h>

/* signal context for 32bit programs. */
@@ -73,5 +74,5 @@ struct sigcontext_ia32 {
unsigned int oldmask;
unsigned int cr2;
};
-
+#endif
#endif /* _ASM_X86_SIGCONTEXT32_H */
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 2b54fe0..f3ce183 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -3,12 +3,12 @@
*
* Author: Suresh Siddha <[email protected]>
*/
+
#include <linux/bootmem.h>
#include <linux/compat.h>
-#include <asm/i387.h>
-#ifdef CONFIG_IA32_EMULATION
+
#include <asm/sigcontext32.h>
-#endif
+#include <asm/i387.h>
#include <asm/xcr.h>

/*
--
1.6.0.6


2009-03-28 19:02:00

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sat, Mar 28, 2009 at 06:07:46PM +0300, Alexey Dobriyan wrote:
> On Sat, Mar 28, 2009 at 08:18:50PM +0530, Jaswinder Singh Rajput wrote:
> > The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
> > Ingo Molnar (1):
> > Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core
> >
> > are available in the git repository at:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core
> >
> > Jaswinder Singh Rajput (49):
> > x86: process_32.c include inverse Xmas tree effect
>
> What the heck is this?

Ordering include based on length of line minimize the
risk of merge conflicts.
If people just add new includes in the bottom of the list you
are certain that a merge conflit happens.

This scheme is starting to be used in several places with the
primary advocates being David Miller and Ingo.

It is getting used both for includes _and_ for local variables.

Sam

2009-03-28 22:26:49

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

Sam Ravnborg wrote:
>
> Ordering include based on length of line minimize the
> risk of merge conflicts.
> If people just add new includes in the bottom of the list you
> are certain that a merge conflit happens.
>
> This scheme is starting to be used in several places with the
> primary advocates being David Miller and Ingo.
>
> It is getting used both for includes _and_ for local variables.
>

Personally I'd prefer alphabetic order, sorting based on length isn't a
complete ordering. Nearly all editors can sort alphabetically at the
push of a key.

-hpa

2009-03-28 22:38:27

by Al Viro

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sat, Mar 28, 2009 at 03:25:17PM -0700, H. Peter Anvin wrote:
> Sam Ravnborg wrote:
> >
> > Ordering include based on length of line minimize the
> > risk of merge conflicts.
> > If people just add new includes in the bottom of the list you
> > are certain that a merge conflit happens.
> >
> > This scheme is starting to be used in several places with the
> > primary advocates being David Miller and Ingo.
> >
> > It is getting used both for includes _and_ for local variables.
> >
>
> Personally I'd prefer alphabetic order, sorting based on length isn't a
> complete ordering. Nearly all editors can sort alphabetically at the
> push of a key.

*shrug*

FWIW, the real problem is that we have far too many includes in a typical
file; the ordering wouldn't matter if there would be 4-5 #include in
foo.c. Inventing elaborate policies to cope with that crap instead of
addressing the root cause (namely, cut'n'paste approach to includes) is
rather pointless...

2009-03-28 23:35:25

by Ingo Molnar

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches


* Thomas Gleixner <[email protected]> wrote:

> > Personally I'd prefer alphabetic order, sorting based on length
> > isn't a complete ordering. Nearly all editors can sort
> > alphabetically at the push of a key.
>
> I'd prefer if somebody would sit down and write a tool to analyse
> the include hell instead of manually shuffling crap around to
> avoid trivial merge conflicts. I have cleaned up enough stuff in
> the x86 merger myself where I was able to cut the number of
> includes at least in half just by staring at the gcc intermediate
> files. We could do better and automate the analysis so we get down
> to a handful of includes instead of including the world and more.

I do not disagree with include file cleanups (we've done many of
them in this cycle and in previous cycles), but note that the
reduction in include files at the top of .c files actually increases
the chance of patch conflicts: when a new include file is added by
two patches to the same .c file.

Ingo

2009-03-28 23:36:04

by Ingo Molnar

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches


* Jaswinder Singh Rajput <[email protected]> wrote:

> The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
> Ingo Molnar (1):
> Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core
>
> Jaswinder Singh Rajput (49):

Looks nice.

Have you written a script for this? If yes, would you mind to share
it with us? Thanks,

Ingo

2009-03-28 23:37:51

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sat, 28 Mar 2009, H. Peter Anvin wrote:
> Sam Ravnborg wrote:
> >
> > Ordering include based on length of line minimize the
> > risk of merge conflicts.
> > If people just add new includes in the bottom of the list you
> > are certain that a merge conflit happens.
> >
> > This scheme is starting to be used in several places with the
> > primary advocates being David Miller and Ingo.
> >
> > It is getting used both for includes _and_ for local variables.
> >
>
> Personally I'd prefer alphabetic order, sorting based on length isn't a
> complete ordering. Nearly all editors can sort alphabetically at the
> push of a key.

I'd prefer if somebody would sit down and write a tool to analyse the
include hell instead of manually shuffling crap around to avoid
trivial merge conflicts. I have cleaned up enough stuff in the x86
merger myself where I was able to cut the number of includes at least
in half just by staring at the gcc intermediate files. We could do
better and automate the analysis so we get down to a handful of
includes instead of including the world and more.

Also there are lots of occasions where includes in header files can be
avoided completely by a single line forward declaration of struct foo
instead of adding the include, which drags in another five.

Thanks,

tglx

2009-03-28 23:40:34

by Ingo Molnar

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches


* Hugh Dickins <[email protected]> wrote:

> On Sat, 28 Mar 2009, Jaswinder Singh Rajput wrote:
> > The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
> > Ingo Molnar (1):
> > Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core
> >
> > are available in the git repository at:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core
> >
> > Jaswinder Singh Rajput (49):
> > x86: process_32.c include inverse Xmas tree effect
> > x86: signal.c include inverse Xmas tree effect
> > x86: entry_32.S include inverse Xmas tree effect
> > x86: traps.c include inverse Xmas tree effect
> > x86: irq.c include inverse Xmas tree effect
> > x86: irq_32.c include inverse Xmas tree effect
> > x86: dumpstack.c include inverse Xmas tree effect
> > x86: time_32.c include inverse Xmas tree effect
> > x86: ioport.c include inverse Xmas tree effect
> > x86: ldt.c include inverse Xmas tree effect
> > x86: dumpstack_32.c include inverse Xmas tree effect
> > x86: setup.c include inverse Xmas tree effect
> > x86: i8259.c include inverse Xmas tree effect
> > x86: irqinit_32.c include inverse Xmas tree effect
> > x86: probe_roms_32.c include inverse Xmas tree effect
> > x86: sys_i386_32.c include inverse Xmas tree effect
> > x86: i386_ksyms_32.c include inverse Xmas tree effect
> > x86: bootflag.c include inverse Xmas tree effect
> > x86: e820.c include inverse Xmas tree effect
> > x86: pci-dma.c include inverse Xmas tree effect
> > x86: quirks.c include inverse Xmas tree effect
> > x86: i8237.c include inverse Xmas tree effect
> > x86: alternative.c include inverse Xmas tree effect
> > x86: tsc.c include inverse Xmas tree effect
> > x86: process.c include inverse Xmas tree effect
> > x86: xsave.c include inverse Xmas tree effect
> > x86: ptrace.c include inverse Xmas tree effect
> > x86: ds.c include inverse Xmas tree effect
> > x86: tls.c include inverse Xmas tree effect
> > x86: step.c include inverse Xmas tree effect
> > x86: stacktrace.c include inverse Xmas tree effect
> > x86: reboot.c include inverse Xmas tree effect
> > x86: msr.c include inverse Xmas tree effect
> > x86: cpuid.c include inverse Xmas tree effect
> > x86: early-quirks.c include inverse Xmas tree effect
> > x86: smp.c include inverse Xmas tree effect
> > x86: smpboot.c include inverse Xmas tree effect
> > x86: tsc_sync.c include inverse Xmas tree effect
> > x86: setup_percpu.c include inverse Xmas tree effect
> > x86: trampoline_32.S include inverse Xmas tree effect
> > x86: mpparse.c include inverse Xmas tree effect
> > x86: module_32.c include inverse Xmas tree effect
> > x86: doublefault_32.c include inverse Xmas tree effect
> > x86: vm86_32.c include inverse Xmas tree effect
> > ix86: early_printk.c include inverse Xmas tree effect
> > x86: pcspeaker.c include inverse Xmas tree effect
> > x86: head_32.c include inverse Xmas tree effect
> > x86: head.c include inverse Xmas tree effect
> > x86: init_task.c include inverse Xmas tree effect
>
> Gasp.
>
> Please find a better use for your time.
>
> Imagine, there might be developers out there with real work
> to do in these files: all you are doing is throwing silly
> little obstacles in their way.

Actually, now is the right time to do such changes as we've just
pushed all pending x86 changes upstream. And since these changes
reduce the chance of future patch conflicts, they do help
development. (in a small way)

Nevertheless i'd suggest to make this a single commit, to not
clobber the shortlog with it.

Ingo

2009-03-28 23:46:16

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sun, 29 Mar 2009, Ingo Molnar wrote:
> * Thomas Gleixner <[email protected]> wrote:
>
> > > Personally I'd prefer alphabetic order, sorting based on length
> > > isn't a complete ordering. Nearly all editors can sort
> > > alphabetically at the push of a key.
> >
> > I'd prefer if somebody would sit down and write a tool to analyse
> > the include hell instead of manually shuffling crap around to
> > avoid trivial merge conflicts. I have cleaned up enough stuff in
> > the x86 merger myself where I was able to cut the number of
> > includes at least in half just by staring at the gcc intermediate
> > files. We could do better and automate the analysis so we get down
> > to a handful of includes instead of including the world and more.
>
> I do not disagree with include file cleanups (we've done many of
> them in this cycle and in previous cycles), but note that the
> reduction in include files at the top of .c files actually increases
> the chance of patch conflicts: when a new include file is added by
> two patches to the same .c file.

Those conflicts are trivial and if we have a mechanism to anlyse
include dependencies then we can avoid such conflicts often at all.

Go through some of the include madness and watch the compiler reading
the same header file ten times for a single source file compile.

Thanks,

tglx

2009-03-29 00:01:06

by Ingo Molnar

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches


* Thomas Gleixner <[email protected]> wrote:

> On Sun, 29 Mar 2009, Ingo Molnar wrote:
> > * Thomas Gleixner <[email protected]> wrote:
> >
> > > > Personally I'd prefer alphabetic order, sorting based on length
> > > > isn't a complete ordering. Nearly all editors can sort
> > > > alphabetically at the push of a key.
> > >
> > > I'd prefer if somebody would sit down and write a tool to analyse
> > > the include hell instead of manually shuffling crap around to
> > > avoid trivial merge conflicts. I have cleaned up enough stuff in
> > > the x86 merger myself where I was able to cut the number of
> > > includes at least in half just by staring at the gcc intermediate
> > > files. We could do better and automate the analysis so we get down
> > > to a handful of includes instead of including the world and more.
> >
> > I do not disagree with include file cleanups (we've done many of
> > them in this cycle and in previous cycles), but note that the
> > reduction in include files at the top of .c files actually increases
> > the chance of patch conflicts: when a new include file is added by
> > two patches to the same .c file.
>
> Those conflicts are trivial and if we have a mechanism to anlyse
> include dependencies then we can avoid such conflicts often at
> all.

Yeah, i agree that least 50% of the existing #include's are not
needed.

That's not the point though. When two new files both append to the
#include file section, they'll clash. Those _new_ includes tend to
be justified - people dont add #includes needlessly - it's years
long bitrot that causes #includes to bloat up slowly.

> Go through some of the include madness and watch the compiler
> reading the same header file ten times for a single source file
> compile.

Yes, we need both efforts. That section needs to look professional
(unordered lines look amateurishly random, arbitrary and confusing),
and it needs to be minimalized as well.

And the xmas-tree helps the minimizing effort - as it trivially
eliminates duplicate #includes (which do happen frequently as well),
and they eliminate related includes as well because they get moved
together and get noticed.

Most importantly, such code needs to look like as if someone
actually cared about it. If code looks tidy, people assume that it's
supposed to be perfect, and will notice and fix more subtle
imperfections in it. If code looks totally messy on the other hand,
_nobody_ will care because it's visibly broken. So these changes are
a small step forward.

Ingo

2009-03-29 00:24:36

by Al Viro

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sun, Mar 29, 2009 at 01:00:26AM +0100, Ingo Molnar wrote:

> Yes, we need both efforts. That section needs to look professional
> (unordered lines look amateurishly random, arbitrary and confusing),
> and it needs to be minimalized as well.

You are _begging_ for basic training jokes, along the lines of "every
blade of grass shall be painted regulation green"...

2009-03-29 00:29:52

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sun, 29 Mar 2009, Thomas Gleixner wrote:

> On Sun, 29 Mar 2009, Ingo Molnar wrote:
> > * Thomas Gleixner <[email protected]> wrote:
> >
> > > > Personally I'd prefer alphabetic order, sorting based on length
> > > > isn't a complete ordering. Nearly all editors can sort
> > > > alphabetically at the push of a key.
> > >
> > > I'd prefer if somebody would sit down and write a tool to analyse
> > > the include hell instead of manually shuffling crap around to
> > > avoid trivial merge conflicts. I have cleaned up enough stuff in
> > > the x86 merger myself where I was able to cut the number of
> > > includes at least in half just by staring at the gcc intermediate
> > > files. We could do better and automate the analysis so we get down
> > > to a handful of includes instead of including the world and more.
> >
> > I do not disagree with include file cleanups (we've done many of
> > them in this cycle and in previous cycles), but note that the
> > reduction in include files at the top of .c files actually increases
> > the chance of patch conflicts: when a new include file is added by
> > two patches to the same .c file.
>
> Those conflicts are trivial and if we have a mechanism to anlyse
> include dependencies then we can avoid such conflicts often at all.
>
> Go through some of the include madness and watch the compiler reading
> the same header file ten times for a single source file compile.

I'm not against sorting the headers at all. I personally have no
preference whether it's alphabetical or length, but...

I just run the following on current git:

# FS=`find -type f`; for F in $FS; do grep -c "#include" $F; done | sort -n | uniq -c

The top 5 are:

lib/locking-selftest.c: 108 (justified as this includes all the test cases)
fs/compat_ioctl.c 88 (maybe ok as it is the all in one kitchen sink)
arch/x86/kernel/setup.c: 76 (completely nuts)
init/main.c: 62 (needs to be looked at)
security/selinux/hooks.c 61 (needs to be looked at, spotted at least 5 which can be removed)

1400 files have more than 20 includes. 5375 more than 10.

I think it's well justified to sit down and work on a tool which helps
us analyse and distangle that mess.

Thanks,

tglx

2009-03-29 01:58:34

by Ingo Molnar

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches


* Thomas Gleixner <[email protected]> wrote:

> I just run the following on current git:
>
> # FS=`find -type f`; for F in $FS; do grep -c "#include" $F; done | sort -n | uniq -c
>
> The top 5 are:
>
> lib/locking-selftest.c: 108 (justified as this includes all the test cases)
> fs/compat_ioctl.c 88 (maybe ok as it is the all in one kitchen sink)
> arch/x86/kernel/setup.c: 76 (completely nuts)

[yep]

> init/main.c: 62 (needs to be looked at)
> security/selinux/hooks.c 61 (needs to be looked at, spotted at least 5 which can be removed)
>
> 1400 files have more than 20 includes. 5375 more than 10.
>
> I think it's well justified to sit down and work on a tool which
> helps us analyse and distangle that mess.

yeah.

Ingo

2009-03-29 05:54:55

by Jaswinder Singh Rajput

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sun, 2009-03-29 at 00:35 +0100, Ingo Molnar wrote:
> * Jaswinder Singh Rajput <[email protected]> wrote:
>
> > The following changes since commit 29219683c46cb89edf5c58418b5305b14646d030:
> > Ingo Molnar (1):
> > Merge branches 'x86/apic', 'x86/cleanups', 'x86/mm', 'x86/pat', 'x86/setup' and 'x86/signal'; commit 'v2.6.29' into x86/core
> >
> > are available in the git repository at:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-Xmas.git x86/core
> >
> > Jaswinder Singh Rajput (49):
>
> Looks nice.
>
> Have you written a script for this? If yes, would you mind to share
> it with us? Thanks,

I have done this manually.

Scripts can be helpful in ordering but will not be useful in many cases
like:
1. Duplication of asm files (include/linux/xyz.h call asm/xyz.h file
without any case or this case is always true in that file)
2. Remove unwanted files
3. Handle various ifdefs in include file
4. handling errors which can be generated by this ordering
5. do some more beautification where required
6. ordering of variables
7. and many more issues which I have not faced so far ..

So because of above cases even you made scripts with AI, they will fail
in many cases.

--
JSR

2009-03-29 06:39:59

by Jaswinder Singh Rajput

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sun, 2009-03-29 at 00:40 +0100, Ingo Molnar wrote:
> * Hugh Dickins <[email protected]> wrote:
> >
> > Please find a better use for your time.
> >
> > Imagine, there might be developers out there with real work
> > to do in these files: all you are doing is throwing silly
> > little obstacles in their way.
>
> Actually, now is the right time to do such changes as we've just
> pushed all pending x86 changes upstream. And since these changes
> reduce the chance of future patch conflicts, they do help
> development. (in a small way)
>
> Nevertheless i'd suggest to make this a single commit, to not
> clobber the shortlog with it.
>

I think individual patches will be better option, in case of unavoidable
situation we can simply revert that particular patch.

--
JSR

2009-03-29 07:58:43

by Jaswinder Singh Rajput

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sat, 2009-03-28 at 15:25 -0700, H. Peter Anvin wrote:
> Sam Ravnborg wrote:
> >
> > Ordering include based on length of line minimize the
> > risk of merge conflicts.
> > If people just add new includes in the bottom of the list you
> > are certain that a merge conflit happens.
> >
> > This scheme is starting to be used in several places with the
> > primary advocates being David Miller and Ingo.
> >
> > It is getting used both for includes _and_ for local variables.
> >
>
> Personally I'd prefer alphabetic order, sorting based on length isn't a
> complete ordering. Nearly all editors can sort alphabetically at the
> push of a key.
>

This sorting is based on Length + alphabetic.

--
JSR

2009-03-29 10:18:32

by Alexey Dobriyan

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sun, Mar 29, 2009 at 01:00:26AM +0100, Ingo Molnar wrote:
>
> * Thomas Gleixner <[email protected]> wrote:
>
> > On Sun, 29 Mar 2009, Ingo Molnar wrote:
> > > * Thomas Gleixner <[email protected]> wrote:
> > >
> > > > > Personally I'd prefer alphabetic order, sorting based on length
> > > > > isn't a complete ordering. Nearly all editors can sort
> > > > > alphabetically at the push of a key.
> > > >
> > > > I'd prefer if somebody would sit down and write a tool to analyse
> > > > the include hell instead of manually shuffling crap around to
> > > > avoid trivial merge conflicts. I have cleaned up enough stuff in
> > > > the x86 merger myself where I was able to cut the number of
> > > > includes at least in half just by staring at the gcc intermediate
> > > > files. We could do better and automate the analysis so we get down
> > > > to a handful of includes instead of including the world and more.
> > >
> > > I do not disagree with include file cleanups (we've done many of
> > > them in this cycle and in previous cycles), but note that the
> > > reduction in include files at the top of .c files actually increases
> > > the chance of patch conflicts: when a new include file is added by
> > > two patches to the same .c file.
> >
> > Those conflicts are trivial and if we have a mechanism to anlyse
> > include dependencies then we can avoid such conflicts often at
> > all.
>
> Yeah, i agree that least 50% of the existing #include's are not
> needed.
>
> That's not the point though. When two new files both append to the
> #include file section, they'll clash. Those _new_ includes tend to
> be justified - people dont add #includes needlessly - it's years
> long bitrot that causes #includes to bloat up slowly.
>
> > Go through some of the include madness and watch the compiler
> > reading the same header file ten times for a single source file
> > compile.

Care to read strace(1) output? Include file is not even opened second
time.

[reads strace(1) output himself]

Correction!

Except, e. g., <asm/atomic.h> because i386/x86_64 unification dropped
ifndef guards in the right place and added them in the wrong one.

> Yes, we need both efforts. That section needs to look professional
> (unordered lines look amateurishly random, arbitrary and confusing),
> and it needs to be minimalized as well.

These are #include directives, how else should they look like.
As for confusing, as if you're looking for the first time at C code.

> And the xmas-tree helps the minimizing effort - as it trivially
> eliminates duplicate #includes (which do happen frequently as well),

yes, 5-10-20 for the whole tree per release and people periodically
removing them regardless of -tip, Xmas and so on.

> and they eliminate related includes as well because they get moved
> together and get noticed.

I'll answer on this later.

> Most importantly, such code needs to look like as if someone
> actually cared about it.

Reminder, this is include directives, not real code.

> If code looks tidy, people assume that it's
> supposed to be perfect, and will notice and fix more subtle
> imperfections in it. If code looks totally messy on the other hand,
> _nobody_ will care because it's visibly broken. So these changes are
> a small step forward.

People probably forgot the real problem with includes and start
inventing new non-problems with all the consequences.



So here is my countersuggestion for small and useful improvements:

1. Plug ifndef guargs back on x86.
Check with strace(1) for past behaviour re non-opened includes.
Remove current ifdef guards (need much more thinking for consequences)

2. Do #1 for other arches which exercised similar transformation
(sparc/sparc64?)

3. For headers with small and let's say bounded area like <asm/unistd.h>,
go check for every file including them and remove it if header genuinely
unneeded.

In case of <asm/unistd.h> this would check for copy_from_user/copy_to_user,
put_user/get_user, clear_user and not much more.

This will reduce compile time _and_ size of DEBUG_INFO=y kernels.

2009-03-29 11:48:20

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sun, 29 Mar 2009, Jaswinder Singh Rajput wrote:
> On Sun, 2009-03-29 at 00:40 +0100, Ingo Molnar wrote:
> > * Hugh Dickins <[email protected]> wrote:
> > >
> > > Please find a better use for your time.
> > >
> > > Imagine, there might be developers out there with real work
> > > to do in these files: all you are doing is throwing silly
> > > little obstacles in their way.
> >
> > Actually, now is the right time to do such changes as we've just
> > pushed all pending x86 changes upstream. And since these changes
> > reduce the chance of future patch conflicts, they do help
> > development. (in a small way)
> >
> > Nevertheless i'd suggest to make this a single commit, to not
> > clobber the shortlog with it.
> >
>
> I think individual patches will be better option, in case of unavoidable
> situation we can simply revert that particular patch.

What unavoidable situation ? That you broke stuff with your changes ?
If you are so unsure about the quality of your changes, then the best
option is to not pull that stuff at all.

Thanks,

tglx

2009-03-29 14:39:36

by Jaswinder Singh Rajput

[permalink] [raw]
Subject: Re: [git-pull -tip] x86: include inverse Xmas tree patches

On Sun, 2009-03-29 at 13:46 +0200, Thomas Gleixner wrote:
> On Sun, 29 Mar 2009, Jaswinder Singh Rajput wrote:
> > On Sun, 2009-03-29 at 00:40 +0100, Ingo Molnar wrote:
> > > * Hugh Dickins <[email protected]> wrote:
> > > >
> > > > Please find a better use for your time.
> > > >
> > > > Imagine, there might be developers out there with real work
> > > > to do in these files: all you are doing is throwing silly
> > > > little obstacles in their way.
> > >
> > > Actually, now is the right time to do such changes as we've just
> > > pushed all pending x86 changes upstream. And since these changes
> > > reduce the chance of future patch conflicts, they do help
> > > development. (in a small way)
> > >
> > > Nevertheless i'd suggest to make this a single commit, to not
> > > clobber the shortlog with it.
> > >
> >
> > I think individual patches will be better option, in case of unavoidable
> > situation we can simply revert that particular patch.
>
> What unavoidable situation ? That you broke stuff with your changes ?
> If you are so unsure about the quality of your changes, then the best
> option is to not pull that stuff at all.
>

OK. Tree deleted, thanks for your advice.

--
JSR