]> git.hungrycats.org Git - linux/commitdiff
[PATCH] small numa api fixups
authorAndrew Morton <akpm@osdl.org>
Sat, 22 May 2004 15:04:51 +0000 (08:04 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 22 May 2004 15:04:51 +0000 (08:04 -0700)
From: Christoph Hellwig <hch@lst.de>

- don't include mempolicy.h in sched.h and mm.h when a forward delcaration
  is enough.  Andi argued against that in the past, but I'd really hate to add
  another header to two of the includes used in basically every driver when we
  can include it in the six files actually needing it instead (that number is
  for my ppc32 system, maybe other arches need more include in their
  directories)

- make numa api fields in tast_struct conditional on CONFIG_NUMA, this gives
  us a few ugly ifdefs but avoids wasting memory on non-NUMA systems.

13 files changed:
arch/ia64/ia32/binfmt_elf32.c
arch/ia64/kernel/perfmon.c
arch/ia64/mm/init.c
arch/x86_64/ia32/ia32_binfmt.c
fs/exec.c
include/linux/mm.h
include/linux/sched.h
kernel/exit.c
kernel/fork.c
mm/mempolicy.c
mm/mmap.c
mm/mprotect.c
mm/shmem.c

index 44952a0ef8cda92b0ee549fcb4b7af3927200970..57dd04a1b904990c44985f3af1494a7cf266c0a0 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/security.h>
+#include <linux/mempolicy.h>
 
 #include <asm/param.h>
 #include <asm/signal.h>
index 3365f23ffc914ff8e60875eaa6c5c5502e907fab..df163f66ab3817c1596e6076f287b816da37625c 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/pagemap.h>
 #include <linux/mount.h>
 #include <linux/version.h>
+#include <linux/mempolicy.h>
 
 #include <asm/bitops.h>
 #include <asm/errno.h>
index 673d73bfa7b76d720e82b049363db203bb08d1c0..a24e706351b8280d761d06b474591cc525d2d558 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/slab.h>
 #include <linux/swap.h>
 #include <linux/proc_fs.h>
+#include <linux/mempolicy.h>
 
 #include <asm/a.out.h>
 #include <asm/bitops.h>
index af8d595da912a04a3860fcb2fd6b4cdece04d9ba..0d8355e60e6827e767c4e8502cefe0648d09cc88 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/binfmts.h>
 #include <linux/mm.h>
 #include <linux/security.h>
+#include <linux/mempolicy.h>
 
 #include <asm/segment.h> 
 #include <asm/ptrace.h>
index 0e6fdcf20984884ab92c17c0a57024f7a94cc39f..b0c53d706eef5ab4881cdd591ebf6874dd2ac41e 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -46,6 +46,7 @@
 #include <linux/security.h>
 #include <linux/syscalls.h>
 #include <linux/rmap.h>
+#include <linux/mempolicy.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
index 8dd58e11edb0b3766c3f240500f62177177036f8..249167672b830672ebe22357a32f7de778ec3abc 100644 (file)
@@ -12,7 +12,8 @@
 #include <linux/mmzone.h>
 #include <linux/rbtree.h>
 #include <linux/fs.h>
-#include <linux/mempolicy.h>
+
+struct mempolicy;
 
 #ifndef CONFIG_DISCONTIGMEM          /* Don't use mapnrs, do it properly */
 extern unsigned long max_mapnr;
index 9a539b7eb0d20eff759bbc657a1f508a85706438..9cf8e5be3ed084ef3b20bb73d978ca7aea9aa9bd 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/completion.h>
 #include <linux/pid.h>
 #include <linux/percpu.h>
-#include <linux/mempolicy.h>
 
 struct exec_domain;
 
@@ -381,6 +380,7 @@ int set_current_groups(struct group_info *group_info);
 
 
 struct audit_context;          /* See audit.c */
+struct mempolicy;
 
 struct task_struct {
        volatile long state;    /* -1 unrunnable, 0 runnable, >0 stopped */
@@ -510,8 +510,10 @@ struct task_struct {
        unsigned long ptrace_message;
        siginfo_t *last_siginfo; /* For ptrace use.  */
 
+#ifdef CONFIG_NUMA
        struct mempolicy *mempolicy;
        short il_next;          /* could be shared with used_math */
+#endif
 };
 
 static inline pid_t process_group(struct task_struct *tsk)
index 5ac2db963f0b2fcdcdf61337cf5250101854d43b..1053be962cad5f9cf1cbc6236cb6426bb5cd39f2 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/profile.h>
 #include <linux/mount.h>
 #include <linux/proc_fs.h>
+#include <linux/mempolicy.h>
 
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
@@ -791,7 +792,9 @@ asmlinkage NORET_TYPE void do_exit(long code)
        __exit_fs(tsk);
        exit_namespace(tsk);
        exit_thread();
+#ifdef CONFIG_NUMA
        mpol_free(tsk->mempolicy);
+#endif
 
        if (tsk->signal->leader)
                disassociate_ctty(1);
index 2297ac8d0a0fb96432c770f5bddb2389477bf1b8..8909a42c442090e34fb58b2440c6cb780509c694 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/completion.h>
 #include <linux/namespace.h>
 #include <linux/personality.h>
+#include <linux/mempolicy.h>
 #include <linux/sem.h>
 #include <linux/file.h>
 #include <linux/binfmts.h>
@@ -972,12 +973,14 @@ struct task_struct *copy_process(unsigned long clone_flags,
        p->security = NULL;
        p->io_context = NULL;
        p->audit_context = NULL;
+#ifdef CONFIG_NUMA
        p->mempolicy = mpol_copy(p->mempolicy);
        if (IS_ERR(p->mempolicy)) {
                retval = PTR_ERR(p->mempolicy);
                p->mempolicy = NULL;
                goto bad_fork_cleanup;
        }
+#endif
 
        retval = -ENOMEM;
        if ((retval = security_task_alloc(p)))
@@ -1128,7 +1131,9 @@ bad_fork_cleanup_audit:
 bad_fork_cleanup_security:
        security_task_free(p);
 bad_fork_cleanup_policy:
+#ifdef CONFIG_NUMA
        mpol_free(p->mempolicy);
+#endif
 bad_fork_cleanup:
        if (p->pid > 0)
                free_pidmap(p->pid);
index 63b01f4b336805024e13c67e56500592d1293ec1..d4c9c9b922327e69f3ae1741ad12c78dda5f4811 100644 (file)
@@ -72,6 +72,7 @@
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/compat.h>
+#include <linux/mempolicy.h>
 #include <asm/uaccess.h>
 
 static kmem_cache_t *policy_cache;
index 0a570ac3b4de8003ccc986c14d23b5eb2131928d..6b0a9036abff853eba5d2c3c576b5c83344eb9b3 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -21,6 +21,7 @@
 #include <linux/profile.h>
 #include <linux/module.h>
 #include <linux/mount.h>
+#include <linux/mempolicy.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
index d7c3e33a855f506141141dc927876c39e1ecb6cb..7934dcec6e27f625563e0bc41c96e39eebae4816 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/fs.h>
 #include <linux/highmem.h>
 #include <linux/security.h>
+#include <linux/mempolicy.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
index 6af8c3afcf568f02d0a5fb2719750c9c200ce8ee..5a6d56a450d8e17a2c4b79c8461f9d9726a8e6af 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/blkdev.h>
 #include <linux/security.h>
 #include <linux/swapops.h>
+#include <linux/mempolicy.h>
 #include <asm/uaccess.h>
 #include <asm/div64.h>
 #include <asm/pgtable.h>