linux-stable/arch/arm/kernel
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
..
.gitignore [ARM] 5194/1: update .gitignore 2008-08-12 19:54:09 +01:00
armksyms.c ARM: unexport symbols used to implement floating point emulation 2009-12-15 16:28:22 +10:30
arthur.c [ARM] arm/kernel/arthur.c: add MODULE_LICENSE 2008-05-17 22:55:16 +01:00
asm-offsets.c ARM: dma-mapping: provide per-cpu type map/unmap functions 2010-02-15 15:22:20 +00:00
atags.c clean up atags exporting code 2008-05-30 10:33:49 +02:00
atags.h [ARM] 4736/1: Export atags to userspace and allow kexec to use customised atags 2008-02-04 13:21:03 +00:00
bios32.c resource/PCI: mark struct resource as const 2010-02-22 16:16:57 -08:00
calls.S Add generic sys_old_mmap() 2010-03-12 15:52:32 -08:00
compat.c
compat.h
crunch-bits.S [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
crunch.c ARM: Convert VFP/Crunch/XscaleCP thread_release() to exit_thread() 2009-12-18 14:53:41 +00:00
debug.S ARM: 5910/1: ARM: Add tmp register for addruart and loadsp 2010-02-12 17:27:52 +00:00
dma-isa.c ARM: dma-isa: request cascade channel after registering it 2009-12-24 18:34:08 +00:00
dma.c [ARM] dma: remove dmamode_t typedef 2009-01-02 12:34:55 +00:00
early_printk.c ARM: Add an earlyprintk debug console 2009-12-09 10:02:18 +00:00
ecard.c arm: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-06 10:44:43 -08:00
ecard.h [ARM] rpc: ecard: remove deprecated ecard_address() and relatives 2008-07-03 14:25:58 +01:00
elf.c ARM: 5883/1: Revert "disable NX support for OABI-supporting kernels" 2010-01-18 14:12:11 +00:00
entry-armv.S ARM: Fix wrong dmb 2010-01-12 18:59:16 +00:00
entry-common.S Unify sys_mmap* 2009-12-11 06:44:29 -05:00
entry-header.S ARM: 5991/1: Fix regression in restore_user_regs macro 2010-03-15 17:20:08 +00:00
etm.c ARM: 5841/1: a driver for on-chip ETM and ETB 2009-12-02 10:25:22 +00:00
fiq.c [ARM] 5421/1: ftrace: fix crash due to tracing of __naked functions 2009-03-12 21:33:03 +00:00
ftrace.c small doc fix: ftrace_dyn_arch_init is called by ftrace_init 2008-12-12 11:15:45 +01:00
head-common.S ARM: 5784/1: fix early boot machine ID mismatch error display 2009-11-08 11:58:54 +00:00
head-nommu.S ARM: convert to use __HEAD and HEAD_TEXT macros. 2009-11-23 20:33:34 +00:00
head.S ARM: convert to use __HEAD and HEAD_TEXT macros. 2009-11-23 20:33:34 +00:00
init_task.c Use new __init_task_data macro in arch init_task.c files. 2009-09-21 06:27:08 +02:00
io.c [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
irq.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
isa.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
iwmmxt.S
kgdb.c ARM: 5989/1: ARM: KGDB: add support for SMP platforms 2010-03-15 14:33:04 +00:00
kprobes-decode.c [ARM] 5221/1: fix ldm/stm emulation for kprobes 2008-09-01 12:06:33 +01:00
kprobes.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
leds.c ARM: move LED support code out of arch/arm/kernel/time.c 2010-02-15 21:39:12 +00:00
machine_kexec.c [ARM] Storage class should be before const qualifier 2009-02-10 09:59:19 +00:00
Makefile Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
module.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
perf_event.c Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/genesis-2.6 2010-03-15 14:27:06 +00:00
pmu.c ARM: 5899/2: arm: provide a mechanism to reserve performance counters 2010-02-12 17:23:43 +00:00
process.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ptrace.c arm: use generic ptrace_resume code 2010-03-12 15:52:38 -08:00
ptrace.h arm: use generic ptrace_resume code 2010-03-12 15:52:38 -08:00
relocate_kernel.S [ARM] 4736/1: Export atags to userspace and allow kexec to use customised atags 2008-02-04 13:21:03 +00:00
return_address.c [ARM] 5613/1: implement CALLER_ADDRESSx 2009-07-21 17:21:28 +01:00
setup.c Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-03-01 09:15:15 -08:00
signal.c ARM: 5793/1: ARM: Check put_user fail in do_signal when enable OABI_COMPAT 2009-11-23 17:28:23 +00:00
signal.h ARM: Fix signal restart issues with NX and OABI compat 2009-10-25 15:39:37 +00:00
smp.c ARM: Add L2 cache handling to smp boot support 2010-03-14 19:42:35 +00:00
smp_scu.c Check whether the SCU was already initialised 2009-11-05 10:10:36 +00:00
smp_twd.c ARM: Do not allow the probing of the local timer 2009-12-09 13:19:31 +00:00
stacktrace.c [ARM] 5613/1: implement CALLER_ADDRESSx 2009-07-21 17:21:28 +01:00
sys_arm.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sys_oabi-compat.c Add generic sys_ipc wrapper 2010-03-12 15:52:32 -08:00
tcm.c ARM: 5580/2: ARM TCM (Tightly-Coupled Memory) support v3 2009-09-15 22:11:05 +01:00
tcm.h ARM: 5580/2: ARM TCM (Tightly-Coupled Memory) support v3 2009-09-15 22:11:05 +01:00
thumbee.c Fix the teehbr_read function prototype 2008-11-10 14:14:11 +00:00
time.c ARM: move LED support code out of arch/arm/kernel/time.c 2010-02-15 21:39:12 +00:00
traps.c ARM: add notify_die() support 2010-02-15 21:39:14 +00:00
unwind.c ARM: 5977/1: arm: Enable backtrace printing on oops when PC is corrupted 2010-03-07 10:22:00 +00:00
vmlinux.lds.S ARM: 5880/1: arm: use generic infrastructure for early params 2010-02-15 21:39:13 +00:00
xscale-cp0.c ARM: Convert VFP/Crunch/XscaleCP thread_release() to exit_thread() 2009-12-18 14:53:41 +00:00