small numa api fixups
Subsystems (8)
PATCH 26/57 small numa api fixups
From: Christoph Hellwig <[email protected]>
- 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.
---
25-akpm/arch/ia64/ia32/binfmt_elf32.c | 1 + 25-akpm/arch/ia64/kernel/perfmon.c | 1 + 25-akpm/arch/ia64/mm/init.c | 1 + 25-akpm/arch/x86_64/ia32/ia32_binfmt.c | 1 + 25-akpm/fs/exec.c | 1 + 25-akpm/include/linux/mm.h | 3 ++- 25-akpm/include/linux/sched.h | 4 +++- 25-akpm/kernel/exit.c | 3 +++ 25-akpm/kernel/fork.c | 5 +++++ 25-akpm/mm/mempolicy.c | 1 + 25-akpm/mm/mmap.c | 1 + 25-akpm/mm/mprotect.c | 1 + 25-akpm/mm/shmem.c | 1 + 13 files changed, 22 insertions(+), 2 deletions(-)
fs/exec.c renamed from fs/exec.c~small-numa-api-fixups +1 -0
@@ -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>
include/linux/mm.h renamed from include/linux/mm.h~small-numa-api-fixups +2 -1
@@ -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;
include/linux/sched.h renamed from include/linux/sched.h~small-numa-api-fixups +3 -1
@@ -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_infostruct 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)
kernel/exit.c renamed from kernel/exit.c~small-numa-api-fixups +3 -0
@@ -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__exit_fs (tsk);exit_namespace (tsk);exit_thread (); +#ifdef CONFIG_NUMA mpol_free (tsk->mempolicy); +#endif if (tsk->signal->leader)disassociate_ctty (1 );
kernel/fork.c renamed from kernel/fork.c~small-numa-api-fixups +5 -0
@@ -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(unsigne 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);
mm/mempolicy.c renamed from mm/mempolicy.c~small-numa-api-fixups +1 -0
@@ -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;
mm/mmap.c renamed from mm/mmap.c~small-numa-api-fixups +1 -0
@@ -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>
mm/mprotect.c renamed from mm/mprotect.c~small-numa-api-fixups +1 -0
@@ -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>
mm/shmem.c renamed from mm/shmem.c~small-numa-api-fixups +1 -0
@@ -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>
arch/ia64/ia32/binfmt_elf32.c renamed from arch/ia64/ia32/binfmt_elf32.c~small-numa-api-fixups +1 -0
@@ -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>
arch/ia64/kernel/perfmon.c renamed from arch/ia64/kernel/perfmon.c~small-numa-api-fixups +1 -0
@@ -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>
arch/ia64/mm/init.c renamed from arch/ia64/mm/init.c~small-numa-api-fixups +1 -0
@@ -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>
arch/x86_64/ia32/ia32_binfmt.c renamed from arch/x86_64/ia32/ia32_binfmt.c~small-numa-api-fixups +1 -0
@@ -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>
_
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>