diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-03-22 19:30:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-22 20:44:01 -0400 |
commit | 207205a2ba2655652fe46a60b49838af6c16a919 (patch) | |
tree | 4309aa7cd5cf39c805219001e0ed8ec5b71e4d5e /kernel/fork.c | |
parent | b6a84016bd2598e35ead635147fa53619982648d (diff) |
kthread: NUMA aware kthread_create_on_node()
All kthreads being created from a single helper task, they all use memory
from a single node for their kernel stack and task struct.
This patch suite creates kthread_create_on_node(), adding a 'cpu' parameter
to parameters already used by kthread_create().
This parameter serves in allocating memory for the new kthread on its
memory node if possible.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Tejun Heo <tj@kernel.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: David Howells <dhowells@redhat.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index cbc6adc6e891..a8f64f8ec7e1 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/tracehook.h> | 40 | #include <linux/tracehook.h> |
41 | #include <linux/futex.h> | 41 | #include <linux/futex.h> |
42 | #include <linux/compat.h> | 42 | #include <linux/compat.h> |
43 | #include <linux/kthread.h> | ||
43 | #include <linux/task_io_accounting_ops.h> | 44 | #include <linux/task_io_accounting_ops.h> |
44 | #include <linux/rcupdate.h> | 45 | #include <linux/rcupdate.h> |
45 | #include <linux/ptrace.h> | 46 | #include <linux/ptrace.h> |
@@ -254,7 +255,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig) | |||
254 | struct task_struct *tsk; | 255 | struct task_struct *tsk; |
255 | struct thread_info *ti; | 256 | struct thread_info *ti; |
256 | unsigned long *stackend; | 257 | unsigned long *stackend; |
257 | int node = numa_node_id(); | 258 | int node = tsk_fork_get_node(orig); |
258 | int err; | 259 | int err; |
259 | 260 | ||
260 | prepare_to_copy(orig); | 261 | prepare_to_copy(orig); |