Detach sched.h from mm.h
authorAlexey Dobriyan <adobriyan@gmail.com>
Sun, 20 May 2007 21:22:52 +0000 (01:22 +0400)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 21 May 2007 16:18:19 +0000 (09:18 -0700)
commite8edc6e03a5c8562dc70a6d969f732bdb355a7e7
treefc86c863655128a7041dfe613d14393d761fa7b9
parentff1be9ad61e3e17ba83702d8ed0b534e5b8ee15c
Detach sched.h from mm.h

First thing mm.h does is including sched.h solely for can_do_mlock() inline
function which has "current" dereference inside. By dealing with can_do_mlock()
mm.h can be detached from sched.h which is good. See below, why.

This patch
a) removes unconditional inclusion of sched.h from mm.h
b) makes can_do_mlock() normal function in mm/mlock.c
c) exports can_do_mlock() to not break compilation
d) adds sched.h inclusions back to files that were getting it indirectly.
e) adds less bloated headers to some files (asm/signal.h, jiffies.h) that were
   getting them indirectly

Net result is:
a) mm.h users would get less code to open, read, preprocess, parse, ... if
   they don't need sched.h
b) sched.h stops being dependency for significant number of files:
   on x86_64 allmodconfig touching sched.h results in recompile of 4083 files,
   after patch it's only 3744 (-8.3%).

Cross-compile tested on

all arm defconfigs, all mips defconfigs, all powerpc defconfigs,
alpha alpha-up
arm
i386 i386-up i386-defconfig i386-allnoconfig
ia64 ia64-up
m68k
mips
parisc parisc-up
powerpc powerpc-up
s390 s390-up
sparc sparc-up
sparc64 sparc64-up
um-x86_64
x86_64 x86_64-up x86_64-defconfig x86_64-allnoconfig

as well as my two usual configs.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
109 files changed:
arch/arm/mach-iop13xx/pci.c
arch/arm/mm/mmap.c
arch/arm/plat-iop/pci.c
arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
arch/i386/kernel/cpu/cyrix.c
arch/i386/mm/mmap.c
arch/mips/kernel/unaligned.c
arch/mips/mm/ioremap.c
arch/parisc/kernel/cache.c
arch/parisc/kernel/processor.c
arch/powerpc/mm/mmap.c
arch/x86_64/ia32/mmap32.c
arch/x86_64/kernel/reboot.c
drivers/base/dmapool.c
drivers/char/agp/frontend.c
drivers/char/agp/generic.c
drivers/char/hangcheck-timer.c
drivers/infiniband/core/cache.c
drivers/infiniband/core/device.c
drivers/infiniband/core/umem.c
drivers/infiniband/hw/mthca/mthca_cmd.c
drivers/infiniband/hw/mthca/mthca_cq.c
drivers/infiniband/hw/mthca/mthca_memfree.c
drivers/infiniband/hw/mthca/mthca_qp.c
drivers/infiniband/hw/mthca/mthca_srq.c
drivers/isdn/icn/icn.c
drivers/isdn/sc/message.c
drivers/kvm/kvm.h
drivers/kvm/kvm_main.c
drivers/kvm/svm.c
drivers/kvm/vmx.c
drivers/oprofile/buffer_sync.c
drivers/pci/hotplug/ibmphp_hpc.c
drivers/pci/pcie/aer/aerdrv.h
drivers/scsi/megaraid/megaraid_mm.c
fs/9p/vfs_addr.c
fs/9p/vfs_dentry.c
fs/9p/vfs_inode.c
fs/9p/vfs_super.c
fs/affs/inode.c
fs/affs/super.c
fs/afs/callback.c
fs/afs/cell.c
fs/afs/dir.c
fs/afs/inode.c
fs/afs/internal.h
fs/afs/main.c
fs/afs/proc.c
fs/afs/security.c
fs/afs/super.c
fs/afs/vlocation.c
fs/afs/vnode.c
fs/afs/volume.c
fs/binfmt_misc.c
fs/coda/cache.c
fs/coda/upcall.c
fs/configfs/inode.c
fs/ecryptfs/messaging.c
fs/fifo.c
fs/fuse/file.c
fs/fuse/inode.c
fs/gfs2/glock.h
fs/hfs/inode.c
fs/hfsplus/inode.c
fs/hpfs/buffer.c
fs/hpfs/namei.c
fs/hpfs/super.c
fs/minix/bitmap.c
fs/ncpfs/file.c
fs/ncpfs/ioctl.c
fs/nfs/client.c
fs/nfs/dir.c
fs/nfs/file.c
fs/nfs/inode.c
fs/nfs/pagelist.c
fs/nfsd/nfs4callback.c
fs/nfsd/nfs4recover.c
fs/nfsd/nfssvc.c
fs/ntfs/file.c
fs/ramfs/inode.c
fs/smbfs/dir.c
fs/smbfs/file.c
fs/smbfs/inode.c
fs/smbfs/request.c
fs/sysfs/inode.c
fs/udf/file.c
fs/udf/namei.c
include/asm-arm/tlbflush.h
include/asm-i386/tlbflush.h
include/asm-mips/pgalloc.h
include/asm-parisc/mmu_context.h
include/asm-parisc/tlbflush.h
include/asm-powerpc/mmu_context.h
include/asm-x86_64/calgary.h
include/asm-x86_64/tlbflush.h
include/linux/mm.h
include/linux/smb_fs.h
include/linux/task_io_accounting_ops.h
include/linux/writeback.h
include/rdma/ib_umem.h
kernel/profile.c
kernel/time/ntp.c
lib/ioremap.c
mm/filemap_xip.c
mm/madvise.c
mm/mlock.c
mm/msync.c
mm/vmstat.c
sound/sound_firmware.c