Skip to contentSkip to conversation

headers: detach sched.h and mm_types.h

PATCH New Alexey Dobriyan 1 participant 1 message Mar 11, 2010

Subsystems (44)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 headers: detach sched.h and mm_types.h

* remove mm_types.h inclusion and the rest of mm stuff from sched.h to make sched.h inclusion cheaper.
* move stuff to linux/mm.h
* move init_mm declaration to mm_types.h to overcome interdependencies on sparc64
* remove linux/aio.h inclusion, it wasn't needed in sched.h, no need to move it.

Patch not exactly well compiled tested as I'd like, still survived many configs across 10 arches and even UML.

---

 arch/blackfin/include/asm/mmu_context.h      |    1 
 arch/blackfin/kernel/flat.c                  |    1 
 arch/s390/hypfs/inode.c                      |    1 
 arch/sparc/include/asm/pgtable_64.h          |    1 
 arch/sparc/kernel/asm-offsets.c              |    2 
 arch/um/kernel/exec.c                        |    1 
 arch/um/kernel/reboot.c                      |    1 
 arch/um/kernel/skas/process.c                |    1 
 arch/um/sys-x86_64/syscalls.c                |    2 
 block/scsi_ioctl.c                           |    1 
 drivers/char/random.c                        |    1 
 drivers/infiniband/hw/ipath/ipath_file_ops.c |    1 
 drivers/lguest/lguest_user.c                 |    1 
 drivers/media/video/soc_camera.c             |    1 
 drivers/scsi/sg.c                            |    1 
 drivers/usb/gadget/inode.c                   |    1 
 fs/afs/write.c                               |    1 
 fs/block_dev.c                               |    1 
 fs/direct-io.c                               |    1 
 fs/ecryptfs/file.c                           |    1 
 fs/ext2/inode.c                              |    1 
 fs/ext3/inode.c                              |    1 
 fs/ext4/file.c                               |    1 
 fs/ext4/inode.c                              |    1 
 fs/fat/inode.c                               |    1 
 fs/fuse/dev.c                                |    1 
 fs/fuse/file.c                               |    1 
 fs/gfs2/aops.c                               |    1 
 fs/gfs2/file.c                               |    1 
 fs/hfs/inode.c                               |    1 
 fs/hfsplus/inode.c                           |    1 
 fs/jfs/inode.c                               |    1 
 fs/nilfs2/inode.c                            |    1 
 fs/ntfs/file.c                               |    1 
 fs/ocfs2/aops.h                              |    1 
 fs/ocfs2/inode.h                             |    2 
 fs/pipe.c                                    |    1 
 fs/read_write.c                              |    1 
 fs/reiserfs/inode.c                          |    1 
 fs/sysfs/file.c                              |    1 
 fs/ubifs/file.c                              |    1 
 fs/xfs/linux-2.6/xfs_aops.c                  |    1 
 fs/xfs/linux-2.6/xfs_file.c                  |    1 
 include/linux/cgroup.h                       |    1 
 include/linux/kvm_host.h                     |    1 
 include/linux/memcontrol.h                   |    4 
 include/linux/mm.h                           |  106 +++++++++++++++++++++++++
 include/linux/mm_types.h                     |    1 
 include/linux/sched.h                        |  114 ---------------------------
 include/linux/user_namespace.h               |    1 
 include/net/sock.h                           |    1 
 kernel/cgroup.c                              |    1 
 kernel/fork.c                                |    1 
 kernel/ptrace.c                              |    1 
 lib/debugobjects.c                           |    1 
 lib/is_single_threaded.c                     |    1 
 mm/shmem.c                                   |    1 
 security/keys/gc.c                           |    1 
 sound/core/pcm_native.c                      |    1 
 59 files changed, 167 insertions(+), 116 deletions(-)
arch/blackfin/include/asm/mmu_context.h +1 -0
@@ -8,6 +8,7 @@
 #define __BLACKFIN_MMU_CONTEXT_H__
 
 #include <linux/gfp.h>
+#include <linux/mm.h>
 #include <linux/sched.h>
 #include <asm/setup.h>
 #include <asm/page.h>
arch/blackfin/kernel/flat.c +1 -0
@@ -4,6 +4,7 @@
  * Licensed under the GPL-2.
  */
 
+#include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/flat.h>
arch/s390/hypfs/inode.c +1 -0
@@ -9,6 +9,7 @@
 #define KMSG_COMPONENT "hypfs"
 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
 
+#include <linux/aio.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
arch/sparc/include/asm/pgtable_64.h +1 -0
@@ -76,6 +76,7 @@
 
 #ifndef __ASSEMBLY__
 
+#include <linux/mm_types.h>
 #include <linux/sched.h>
 
 /* Entries per page directory level. */
arch/sparc/kernel/asm-offsets.c +1 -1
@@ -11,7 +11,7 @@
  */
 
 #include <linux/sched.h>
-// #include <linux/mm.h>
+#include <linux/mm_types.h>
 #include <linux/kbuild.h>
 
 #ifdef CONFIG_SPARC32
arch/um/kernel/exec.c +1 -0
@@ -5,6 +5,7 @@
 
 #include "linux/stddef.h"
 #include "linux/fs.h"
+#include "linux/mm.h"
 #include "linux/smp_lock.h"
 #include "linux/ptrace.h"
 #include "linux/sched.h"
arch/um/kernel/reboot.c +1 -0
@@ -3,6 +3,7 @@
  * Licensed under the GPL
  */
 
+#include "linux/mm.h"
 #include "linux/sched.h"
 #include "kern_util.h"
 #include "os.h"
arch/um/kernel/skas/process.c +1 -0
@@ -4,6 +4,7 @@
  */
 
 #include "linux/init.h"
+#include "linux/mm.h"
 #include "linux/sched.h"
 #include "as-layout.h"
 #include "kern.h"
arch/um/sys-x86_64/syscalls.c +2 -0
@@ -6,7 +6,9 @@
  */
 
 #include "linux/linkage.h"
+#include "linux/mm.h"
 #include "linux/personality.h"
+#include "linux/sched.h"
 #include "linux/utsname.h"
 #include "asm/prctl.h" /* XXX This should get the constants from libc */
 #include "asm/uaccess.h"
block/scsi_ioctl.c +1 -0
@@ -26,6 +26,7 @@
 #include <linux/cdrom.h>
 #include <linux/slab.h>
 #include <linux/times.h>
+#include <linux/uio.h>
 #include <asm/uaccess.h>
 
 #include <scsi/scsi.h>
drivers/char/random.c +1 -0
@@ -241,6 +241,7 @@
 #include <linux/percpu.h>
 #include <linux/cryptohash.h>
 #include <linux/fips.h>
+#include <linux/workqueue.h>
 
 #ifdef CONFIG_GENERIC_HARDIRQS
 # include <linux/irq.h>
drivers/infiniband/hw/ipath/ipath_file_ops.c +1 -0
@@ -31,6 +31,7 @@
  * SOFTWARE.
  */
 
+#include <linux/aio.h>
 #include <linux/pci.h>
 #include <linux/poll.h>
 #include <linux/cdev.h>
drivers/lguest/lguest_user.c +1 -0
@@ -6,6 +6,7 @@
 :*/
 #include <linux/uaccess.h>
 #include <linux/miscdevice.h>
+#include <linux/mm.h>
 #include <linux/fs.h>
 #include <linux/sched.h>
 #include <linux/eventfd.h>
drivers/media/video/soc_camera.c +1 -0
@@ -21,6 +21,7 @@
 #include <linux/i2c.h>
 #include <linux/init.h>
 #include <linux/list.h>
+#include <linux/mm.h>
 #include <linux/mutex.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
drivers/scsi/sg.c +1 -0
@@ -49,6 +49,7 @@ static int sg_version_num = 30534;	/* 2 digits for each component */
 #include <linux/delay.h>
 #include <linux/blktrace_api.h>
 #include <linux/smp_lock.h>
+#include <linux/uio.h>
 
 #include "scsi.h"
 #include <scsi/scsi_dbg.h>
drivers/usb/gadget/inode.c +1 -0
@@ -22,6 +22,7 @@
 
 /* #define VERBOSE_DEBUG */
 
+#include <linux/aio.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/fs.h>
fs/afs/write.c +1 -0
@@ -8,6 +8,7 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
+#include <linux/aio.h>
 #include <linux/backing-dev.h>
 #include <linux/slab.h>
 #include <linux/fs.h>
fs/block_dev.c +1 -0
@@ -5,6 +5,7 @@
  *  Copyright (C) 2001  Andrea Arcangeli <[email protected]> SuSE
  */
 
+#include <linux/aio.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/fcntl.h>
fs/direct-io.c +1 -0
@@ -19,6 +19,7 @@
  *		added IO completion notifier.
  */
 
+#include <linux/aio.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/types.h>
fs/ecryptfs/file.c +1 -0
@@ -23,6 +23,7 @@
  * 02111-1307, USA.
  */
 
+#include <linux/aio.h>
 #include <linux/file.h>
 #include <linux/poll.h>
 #include <linux/mount.h>
fs/ext2/inode.c +1 -0
@@ -22,6 +22,7 @@
  *  Assorted race fixes, rewrite of ext2_get_block() by Al Viro, 2000
  */
 
+#include <linux/aio.h>
 #include <linux/smp_lock.h>
 #include <linux/time.h>
 #include <linux/highuid.h>
fs/ext3/inode.c +1 -0
@@ -22,6 +22,7 @@
  *  Assorted race fixes, rewrite of ext3_get_block() by Al Viro, 2000
  */
 
+#include <linux/aio.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/time.h>
fs/ext4/file.c +1 -0
@@ -18,6 +18,7 @@
  *	([email protected])
  */
 
+#include <linux/aio.h>
 #include <linux/time.h>
 #include <linux/fs.h>
 #include <linux/jbd2.h>
fs/ext4/inode.c +1 -0
@@ -22,6 +22,7 @@
  *  Assorted race fixes, rewrite of ext4_get_block() by Al Viro, 2000
  */
 
+#include <linux/aio.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/time.h>
fs/fat/inode.c +1 -0
@@ -10,6 +10,7 @@
  *	Max Cohan: Fixed invalid FSINFO offset when info_sector is 0
  */
 
+#include <linux/aio.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/time.h>
fs/fuse/dev.c +1 -0
@@ -8,6 +8,7 @@
 
 #include "fuse_i.h"
 
+#include <linux/aio.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/poll.h>
fs/fuse/file.c +1 -0
@@ -8,6 +8,7 @@
 
 #include "fuse_i.h"
 
+#include <linux/aio.h>
 #include <linux/pagemap.h>
 #include <linux/slab.h>
 #include <linux/kernel.h>
fs/gfs2/aops.c +1 -0
@@ -7,6 +7,7 @@
  * of the GNU General Public License version 2.
  */
 
+#include <linux/aio.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
fs/gfs2/file.c +1 -0
@@ -7,6 +7,7 @@
  * of the GNU General Public License version 2.
  */
 
+#include <linux/aio.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/completion.h>
fs/hfs/inode.c +1 -0
@@ -11,6 +11,7 @@
  * Based on the minix file system code, (C) 1991, 1992 by Linus Torvalds
  */
 
+#include <linux/aio.h>
 #include <linux/pagemap.h>
 #include <linux/mpage.h>
 #include <linux/sched.h>
fs/hfsplus/inode.c +1 -0
@@ -8,6 +8,7 @@
  * Inode handling routines
  */
 
+#include <linux/aio.h>
 #include <linux/mm.h>
 #include <linux/fs.h>
 #include <linux/pagemap.h>
fs/jfs/inode.c +1 -0
@@ -17,6 +17,7 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
+#include <linux/aio.h>
 #include <linux/fs.h>
 #include <linux/mpage.h>
 #include <linux/buffer_head.h>
fs/nilfs2/inode.c +1 -0
@@ -21,6 +21,7 @@
  *
  */
 
+#include <linux/aio.h>
 #include <linux/buffer_head.h>
 #include <linux/mpage.h>
 #include <linux/writeback.h>
fs/ntfs/file.c +1 -0
@@ -19,6 +19,7 @@
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <linux/aio.h>
 #include <linux/buffer_head.h>
 #include <linux/pagemap.h>
 #include <linux/pagevec.h>
fs/ocfs2/aops.h +1 -0
@@ -21,6 +21,7 @@
 
 #ifndef OCFS2_AOPS_H
 #define OCFS2_AOPS_H
+#include <linux/aio.h>
 
 int ocfs2_prepare_write_nolock(struct inode *inode, struct page *page,
 			       unsigned from, unsigned to);
fs/ocfs2/inode.h +2 -0
@@ -28,6 +28,8 @@
 
 #include "extent_map.h"
 
+struct iocb;
+
 /* OCFS2 Inode Private Data */
 struct ocfs2_inode_info
 {
fs/pipe.c +1 -0
@@ -4,6 +4,7 @@
  *  Copyright (C) 1991, 1992, 1999  Linus Torvalds
  */
 
+#include <linux/aio.h>
 #include <linux/mm.h>
 #include <linux/file.h>
 #include <linux/poll.h>
fs/read_write.c +1 -0
@@ -4,6 +4,7 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
+#include <linux/aio.h>
 #include <linux/slab.h> 
 #include <linux/stat.h>
 #include <linux/fcntl.h>
fs/reiserfs/inode.c +1 -0
@@ -2,6 +2,7 @@
  * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
  */
 
+#include <linux/aio.h>
 #include <linux/time.h>
 #include <linux/fs.h>
 #include <linux/reiserfs_fs.h>
fs/sysfs/file.c +1 -0
@@ -20,6 +20,7 @@
 #include <linux/list.h>
 #include <linux/mutex.h>
 #include <linux/limits.h>
+#include <linux/workqueue.h>
 #include <asm/uaccess.h>
 
 #include "sysfs.h"
fs/ubifs/file.c +1 -0
@@ -50,6 +50,7 @@
  */
 
 #include "ubifs.h"
+#include <linux/aio.h>
 #include <linux/mount.h>
 #include <linux/namei.h>
 
fs/xfs/linux-2.6/xfs_aops.c +1 -0
@@ -40,6 +40,7 @@
 #include "xfs_vnodeops.h"
 #include "xfs_trace.h"
 #include "xfs_bmap.h"
+#include <linux/aio.h>
 #include <linux/mpage.h>
 #include <linux/pagevec.h>
 #include <linux/writeback.h>
fs/xfs/linux-2.6/xfs_file.c +1 -0
@@ -44,6 +44,7 @@
 #include "xfs_ioctl.h"
 #include "xfs_trace.h"
 
+#include <linux/aio.h>
 #include <linux/dcache.h>
 
 static const struct vm_operations_struct xfs_file_vm_ops;
include/linux/cgroup.h +1 -0
@@ -21,6 +21,7 @@
 
 struct cgroupfs_root;
 struct cgroup_subsys;
+struct file;
 struct inode;
 struct cgroup;
 struct css_id;
include/linux/kvm_host.h +1 -0
@@ -16,6 +16,7 @@
 #include <linux/mm.h>
 #include <linux/preempt.h>
 #include <linux/msi.h>
+#include <linux/workqueue.h>
 #include <asm/signal.h>
 
 #include <linux/kvm.h>
include/linux/memcontrol.h +2 -2
@@ -20,10 +20,10 @@
 #ifndef _LINUX_MEMCONTROL_H
 #define _LINUX_MEMCONTROL_H
 #include <linux/cgroup.h>
+#include <linux/mm_types.h>
+
 struct mem_cgroup;
 struct page_cgroup;
-struct page;
-struct mm_struct;
 
 #ifdef CONFIG_CGROUP_MEM_RES_CTLR
 /*
include/linux/mm.h +106 -0

111 lines not on this page · raw message

include/linux/mm_types.h +1 -0
@@ -311,6 +311,7 @@ struct mm_struct {
 	struct mmu_notifier_mm *mmu_notifier_mm;
 #endif
 };
+extern struct mm_struct init_mm;
 
 /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */
 #define mm_cpumask(mm) (&(mm)->cpu_vm_mask)
include/linux/sched.h +1 -113

150 lines not on this page · raw message

include/linux/user_namespace.h +1 -0
@@ -5,6 +5,7 @@
 #include <linux/nsproxy.h>
 #include <linux/sched.h>
 #include <linux/err.h>
+#include <linux/workqueue.h>
 
 #define UIDHASH_BITS	(CONFIG_BASE_SMALL ? 3 : 8)
 #define UIDHASH_SZ	(1 << UIDHASH_BITS)
include/net/sock.h +1 -0
@@ -40,6 +40,7 @@
 #ifndef _SOCK_H
 #define _SOCK_H
 
+#include <linux/aio.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/list_nulls.h>
kernel/cgroup.c +1 -0
@@ -52,6 +52,7 @@
 #include <linux/pid_namespace.h>
 #include <linux/idr.h>
 #include <linux/vmalloc.h> /* TODO: replace with more sophisticated array */
+#include <linux/workqueue.h>
 
 #include <asm/atomic.h>
 
kernel/fork.c +1 -0
@@ -11,6 +11,7 @@
  * management can be a bitch. See 'mm/memory.c': 'copy_page_range()'
  */
 
+#include <linux/aio.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/unistd.h>
kernel/ptrace.c +1 -0
@@ -22,6 +22,7 @@
 #include <linux/pid_namespace.h>
 #include <linux/syscalls.h>
 #include <linux/uaccess.h>
+#include <linux/uio.h>
 #include <linux/regset.h>
 
 
lib/debugobjects.c +1 -0
@@ -13,6 +13,7 @@
 #include <linux/seq_file.h>
 #include <linux/debugfs.h>
 #include <linux/hash.h>
+#include <linux/workqueue.h>
 
 #define ODEBUG_HASH_BITS	14
 #define ODEBUG_HASH_SIZE	(1 << ODEBUG_HASH_BITS)
lib/is_single_threaded.c +1 -0
@@ -11,6 +11,7 @@
  */
 
 #include <linux/sched.h>
+#include <linux/mm.h>
 
 /*
  * Returns true if the task does not share ->mm with another thread/process.
mm/shmem.c +1 -0
@@ -20,6 +20,7 @@
  * This file is released under the GPL.
  */
 
+#include <linux/aio.h>
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/vfs.h>
security/keys/gc.c +1 -0
@@ -10,6 +10,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/workqueue.h>
 #include <keys/keyring-type.h>
 #include "internal.h"
 
sound/core/pcm_native.c +1 -0
@@ -19,6 +19,7 @@
  *
  */
 
+#include <linux/aio.h>
 #include <linux/mm.h>
 #include <linux/file.h>
 #include <linux/slab.h>