diff options
author | Tejun Heo <tj@kernel.org> | 2010-03-24 17:04:11 +0900 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-03-30 22:02:32 +0900 |
commit | 5a0e3ad6af8660be21ca98a971cd00f331318c05 (patch) | |
tree | 5bfb7be11a03176a87296a43ac6647975c00a1d1 /arch/s390 | |
parent | ed391f4ebf8f701d3566423ce8f17e614cde9806 (diff) |
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>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/appldata/appldata_mem.c | 1 | ||||
-rw-r--r-- | arch/s390/appldata/appldata_net_sum.c | 1 | ||||
-rw-r--r-- | arch/s390/crypto/prng.c | 1 | ||||
-rw-r--r-- | arch/s390/hypfs/hypfs_diag.c | 1 | ||||
-rw-r--r-- | arch/s390/hypfs/inode.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/compat_linux.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/ipl.c | 1 | ||||
-rw-r--r-- | arch/s390/kernel/kprobes.c | 1 | ||||
-rw-r--r-- | arch/s390/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 1 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 1 | ||||
-rw-r--r-- | arch/s390/kernel/sysinfo.c | 1 | ||||
-rw-r--r-- | arch/s390/kernel/time.c | 1 | ||||
-rw-r--r-- | arch/s390/kvm/interrupt.c | 1 | ||||
-rw-r--r-- | arch/s390/kvm/priv.c | 1 | ||||
-rw-r--r-- | arch/s390/kvm/sigp.c | 1 | ||||
-rw-r--r-- | arch/s390/mm/cmm.c | 1 | ||||
-rw-r--r-- | arch/s390/mm/init.c | 1 | ||||
-rw-r--r-- | arch/s390/mm/page-states.c | 1 | ||||
-rw-r--r-- | arch/s390/mm/pgtable.c | 2 | ||||
-rw-r--r-- | arch/s390/mm/vmem.c | 1 |
21 files changed, 17 insertions, 8 deletions
diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c index 4188cbe63a54..e43fe7537031 100644 --- a/arch/s390/appldata/appldata_mem.c +++ b/arch/s390/appldata/appldata_mem.c @@ -11,7 +11,6 @@ #include <linux/module.h> #include <linux/init.h> -#include <linux/slab.h> #include <linux/errno.h> #include <linux/kernel_stat.h> #include <linux/pagemap.h> diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c index 4ce7fa95880f..9a9586f4103f 100644 --- a/arch/s390/appldata/appldata_net_sum.c +++ b/arch/s390/appldata/appldata_net_sum.c @@ -12,7 +12,6 @@ #include <linux/module.h> #include <linux/init.h> -#include <linux/slab.h> #include <linux/errno.h> #include <linux/kernel_stat.h> #include <linux/netdevice.h> diff --git a/arch/s390/crypto/prng.c b/arch/s390/crypto/prng.c index a3209906739e..aa819dac2360 100644 --- a/arch/s390/crypto/prng.c +++ b/arch/s390/crypto/prng.c @@ -10,6 +10,7 @@ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/random.h> +#include <linux/slab.h> #include <asm/debug.h> #include <asm/uaccess.h> diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c index 87cf523192e9..5b1acdba6495 100644 --- a/arch/s390/hypfs/hypfs_diag.c +++ b/arch/s390/hypfs/hypfs_diag.c @@ -12,7 +12,6 @@ #include <linux/types.h> #include <linux/errno.h> -#include <linux/gfp.h> #include <linux/slab.h> #include <linux/string.h> #include <linux/vmalloc.h> diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index cd128b07beda..c53f8ac825ca 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c @@ -14,8 +14,8 @@ #include <linux/fs.h> #include <linux/namei.h> #include <linux/vfs.h> +#include <linux/slab.h> #include <linux/pagemap.h> -#include <linux/gfp.h> #include <linux/time.h> #include <linux/parser.h> #include <linux/sysfs.h> diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 11c3aba664ea..73b624ed9cd8 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c @@ -29,7 +29,6 @@ #include <linux/sem.h> #include <linux/msg.h> #include <linux/shm.h> -#include <linux/slab.h> #include <linux/uio.h> #include <linux/quota.h> #include <linux/module.h> @@ -52,6 +51,7 @@ #include <linux/ptrace.h> #include <linux/fadvise.h> #include <linux/ipc.h> +#include <linux/slab.h> #include <asm/types.h> #include <asm/uaccess.h> diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index 7eedbbcb54aa..72c8b0d070c8 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c @@ -15,6 +15,7 @@ #include <linux/reboot.h> #include <linux/ctype.h> #include <linux/fs.h> +#include <linux/gfp.h> #include <asm/ipl.h> #include <asm/smp.h> #include <asm/setup.h> diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index 86783efa24ee..3d34eef5a2c3 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c @@ -29,6 +29,7 @@ #include <asm/cacheflush.h> #include <asm/sections.h> #include <linux/module.h> +#include <linux/slab.h> DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 00b6d1d292f2..1039fdea15b5 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -16,9 +16,9 @@ #include <linux/fs.h> #include <linux/smp.h> #include <linux/stddef.h> +#include <linux/slab.h> #include <linux/unistd.h> #include <linux/ptrace.h> -#include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/user.h> #include <linux/interrupt.h> diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index ba363d99de43..91625f759ccd 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -25,7 +25,6 @@ #include <linux/stddef.h> #include <linux/unistd.h> #include <linux/ptrace.h> -#include <linux/slab.h> #include <linux/user.h> #include <linux/tty.h> #include <linux/ioport.h> diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index d7d24fc3d6b7..e4d98de83dd8 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -36,6 +36,7 @@ #include <linux/cpu.h> #include <linux/timex.h> #include <linux/bootmem.h> +#include <linux/slab.h> #include <asm/asm-offsets.h> #include <asm/ipl.h> #include <asm/setup.h> diff --git a/arch/s390/kernel/sysinfo.c b/arch/s390/kernel/sysinfo.c index b5e75e1061c8..a0ffc7717ed6 100644 --- a/arch/s390/kernel/sysinfo.c +++ b/arch/s390/kernel/sysinfo.c @@ -11,6 +11,7 @@ #include <linux/init.h> #include <linux/delay.h> #include <linux/module.h> +#include <linux/slab.h> #include <asm/ebcdic.h> #include <asm/sysinfo.h> #include <asm/cpcmd.h> diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index aa2483e460f3..fba6dec156bf 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -36,6 +36,7 @@ #include <linux/notifier.h> #include <linux/clocksource.h> #include <linux/clockchips.h> +#include <linux/gfp.h> #include <asm/uaccess.h> #include <asm/delay.h> #include <asm/s390_ext.h> diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index 834774d8d5f3..35c21bf910c5 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c @@ -14,6 +14,7 @@ #include <linux/kvm_host.h> #include <linux/hrtimer.h> #include <linux/signal.h> +#include <linux/slab.h> #include <asm/asm-offsets.h> #include <asm/uaccess.h> #include "kvm-s390.h" diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c index 28c55677eb39..44205507717c 100644 --- a/arch/s390/kvm/priv.c +++ b/arch/s390/kvm/priv.c @@ -12,6 +12,7 @@ */ #include <linux/kvm.h> +#include <linux/gfp.h> #include <linux/errno.h> #include <asm/current.h> #include <asm/debug.h> diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c index 241a48459b66..eff3c5989b46 100644 --- a/arch/s390/kvm/sigp.c +++ b/arch/s390/kvm/sigp.c @@ -14,6 +14,7 @@ #include <linux/kvm.h> #include <linux/kvm_host.h> +#include <linux/slab.h> #include "gaccess.h" #include "kvm-s390.h" diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index f16bd04e39e9..f87b34731e1d 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c @@ -12,6 +12,7 @@ #include <linux/fs.h> #include <linux/init.h> #include <linux/module.h> +#include <linux/gfp.h> #include <linux/sched.h> #include <linux/sysctl.h> #include <linux/ctype.h> diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index d5865e4024ce..acc91c75bc94 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c @@ -26,6 +26,7 @@ #include <linux/pfn.h> #include <linux/poison.h> #include <linux/initrd.h> +#include <linux/gfp.h> #include <asm/processor.h> #include <asm/system.h> #include <asm/uaccess.h> diff --git a/arch/s390/mm/page-states.c b/arch/s390/mm/page-states.c index 098923ae458f..a90d45e9dfb0 100644 --- a/arch/s390/mm/page-states.c +++ b/arch/s390/mm/page-states.c @@ -10,6 +10,7 @@ #include <linux/errno.h> #include <linux/types.h> #include <linux/mm.h> +#include <linux/gfp.h> #include <linux/init.h> #define ESSA_SET_STABLE 1 diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index ad621e06ada3..8d999249d357 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c @@ -6,11 +6,11 @@ #include <linux/sched.h> #include <linux/kernel.h> #include <linux/errno.h> +#include <linux/gfp.h> #include <linux/mm.h> #include <linux/swap.h> #include <linux/smp.h> #include <linux/highmem.h> -#include <linux/slab.h> #include <linux/pagemap.h> #include <linux/spinlock.h> #include <linux/module.h> diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index 300ab012b0fd..8ea3144b45b8 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c @@ -11,6 +11,7 @@ #include <linux/module.h> #include <linux/list.h> #include <linux/hugetlb.h> +#include <linux/slab.h> #include <asm/pgalloc.h> #include <asm/pgtable.h> #include <asm/setup.h> |