linux/arch/s390/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
..
vdso32 Use macros for .data.page_aligned section. 2009-09-21 06:27:08 +02:00
vdso64 Use macros for .data.page_aligned section. 2009-09-21 06:27:08 +02:00
asm-offsets.c [S390] Cleanup struct _lowcore usage and defines. 2010-02-26 22:37:31 +01:00
audit.c [S390] Get rid of a bunch of sparse warnings again. 2007-10-12 16:13:06 +02:00
audit.h [S390] Get rid of a bunch of sparse warnings again. 2007-10-12 16:13:06 +02:00
base.S [S390] Cleanup struct _lowcore usage and defines. 2010-02-26 22:37:31 +01:00
bitmap.c [S390] move EXPORT_SYMBOLs to definitions 2009-03-26 15:24:11 +01:00
compat_audit.c [S390] Get rid of a bunch of sparse warnings again. 2007-10-12 16:13:06 +02:00
compat_exec_domain.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
compat_linux.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
compat_linux.h Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6 2009-12-09 19:01:47 -08:00
compat_ptrace.h [S390] Expose a constant for the number of words representing the CRs 2009-03-26 15:24:25 +01:00
compat_signal.c [S390] 64-bit register support for 31-bit processes 2009-10-06 10:35:10 +02:00
compat_wrapper.S improve sys_newuname() for compat architectures 2010-03-12 15:52:32 -08:00
cpcmd.c [S390] convert cpcmd printks to pr_xxx macros. 2008-12-25 13:39:19 +01:00
crash.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
debug.c tree-wide: convert open calls to remove spaces to skip_spaces() lib function 2009-12-15 08:53:32 -08:00
diag.c [S390] vmur: fix diag14 exceptions with addresses > 2GB. 2007-08-22 13:51:47 +02:00
dis.c [S390] add z9-ec/z10 instruction to kernel disassembler 2010-02-26 22:37:32 +01:00
early.c [S390] codepage conversion of kernel parameter line 2010-02-26 22:37:32 +01:00
ebcdic.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
entry.h improve sys_newuname() for compat architectures 2010-03-12 15:52:32 -08:00
entry.S [S390] Cleanup struct _lowcore usage and defines. 2010-02-26 22:37:31 +01:00
entry64.S [S390] Cleanup struct _lowcore usage and defines. 2010-02-26 22:37:31 +01:00
ftrace.c Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-02-28 10:17:55 -08:00
head.S [S390] fix boot failures with compressed kernels 2010-03-24 11:49:54 +01:00
head31.S [S390] add support for compressed kernels 2010-02-26 22:37:33 +01:00
head64.S [S390] fix boot failures with compressed kernels 2010-03-24 11:49:54 +01:00
init_task.c Use new __init_task_data macro in arch init_task.c files. 2009-09-21 06:27:08 +02:00
ipl.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
irq.c [S390] Fix init irq proc build break. 2009-02-11 10:37:39 +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
machine_kexec.c [S390] smp: always reboot on cpu 0 2010-02-26 22:37:30 +01:00
Makefile [S390] add support for compressed kernels 2010-02-26 22:37:33 +01:00
mcount.S [S390] improve mcount code 2009-09-11 10:29:43 +02:00
mcount64.S [S390] improve mcount code 2009-09-11 10:29:43 +02:00
mem_detect.c [S390] s390: hibernation support for s390 2009-06-16 10:31:22 +02:00
module.c [S390] module: fix memory leak in s390 module loader 2009-10-06 10:35:06 +02:00
nmi.c [S390] merge cpu.h into cputime.h 2009-06-12 10:27:29 +02: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
processor.c [S390] Add highgprs facility to /proc/cpuinfo 2009-10-14 12:43:53 +02:00
ptrace.c Merge branch 'tracing/core' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into tracing/core 2010-02-27 10:06:10 +01:00
reipl.S [S390] Cleanup struct _lowcore usage and defines. 2010-02-26 22:37:31 +01:00
reipl64.S [S390] Cleanup struct _lowcore usage and defines. 2010-02-26 22:37:31 +01:00
relocate_kernel.S [S390] Reset infrastructure for re-IPL. 2006-12-04 15:40:26 +01:00
relocate_kernel64.S [S390] Reset infrastructure for re-IPL. 2006-12-04 15:40:26 +01:00
s390_ext.c nohz: Introduce arch_needs_cpu 2009-11-05 07:53:53 +01:00
s390_ksyms.c [S390] move EXPORT_SYMBOLs to definitions 2009-03-26 15:24:11 +01:00
sclp.S Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
setup.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
signal.c [S390] use set_current_state in sigsuspend 2010-01-27 10:12:49 +01:00
smp.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
stacktrace.c [S390] Fix stacktrace compile bug. 2008-07-17 17:22:09 +02:00
suspend.c [S390] hibernate: make sure pfn_is_nosave handles lowcore pages 2009-09-22 22:58:45 +02:00
switch_cpu.S [S390] Cleanup struct _lowcore usage and defines. 2010-02-26 22:37:31 +01:00
switch_cpu64.S [S390] Cleanup struct _lowcore usage and defines. 2010-02-26 22:37:31 +01:00
swsusp_asm64.S [S390] smp: rename and add lowcore defines 2010-02-26 22:37:30 +01:00
sys_s390.c improve sys_newuname() for compat architectures 2010-03-12 15:52:32 -08:00
syscalls.S improve sys_newuname() for compat architectures 2010-03-12 15:52:32 -08:00
sysinfo.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
time.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
topology.c [S390] Move __cpu_logical_map to smp.c 2010-01-13 20:44:45 +01:00
traps.c [S390] ptrace: dont abuse PT_PTRACED 2009-12-18 17:43:32 +01:00
vdso.c [S390] Cleanup struct _lowcore usage and defines. 2010-02-26 22:37:31 +01:00
vmlinux.lds.S [S390] Enable kmemleak on s390. 2009-10-06 10:35:06 +02:00
vtime.c nohz: Introduce arch_needs_cpu 2009-11-05 07:53:53 +01:00