Commit e9f06986 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

kernel/kthread.c:kthread_create_on_node(): clarify documentation

- Make it clear that the `node' arg refers to memory allocations only:
  kthread_create_on_node() does not pin the new thread to that node's
  CPUs.

- Encourage the use of NUMA_NO_NODE.

[nzimmer@sgi.com: use NUMA_NO_NODE in kthread_create() also]
Cc: Nathan Zimmer <nzimmer@sgi.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 04697858
...@@ -11,7 +11,7 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), ...@@ -11,7 +11,7 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
const char namefmt[], ...); const char namefmt[], ...);
#define kthread_create(threadfn, data, namefmt, arg...) \ #define kthread_create(threadfn, data, namefmt, arg...) \
kthread_create_on_node(threadfn, data, -1, namefmt, ##arg) kthread_create_on_node(threadfn, data, NUMA_NO_NODE, namefmt, ##arg)
struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data), struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data),
......
...@@ -248,15 +248,16 @@ static void create_kthread(struct kthread_create_info *create) ...@@ -248,15 +248,16 @@ static void create_kthread(struct kthread_create_info *create)
* kthread_create_on_node - create a kthread. * kthread_create_on_node - create a kthread.
* @threadfn: the function to run until signal_pending(current). * @threadfn: the function to run until signal_pending(current).
* @data: data ptr for @threadfn. * @data: data ptr for @threadfn.
* @node: memory node number. * @node: task and thread structures for the thread are allocated on this node
* @namefmt: printf-style name for the thread. * @namefmt: printf-style name for the thread.
* *
* Description: This helper function creates and names a kernel * Description: This helper function creates and names a kernel
* thread. The thread will be stopped: use wake_up_process() to start * thread. The thread will be stopped: use wake_up_process() to start
* it. See also kthread_run(). * it. See also kthread_run(). The new thread has SCHED_NORMAL policy and
* is affine to all CPUs.
* *
* If thread is going to be bound on a particular cpu, give its node * If thread is going to be bound on a particular cpu, give its node
* in @node, to get NUMA affinity for kthread stack, or else give -1. * in @node, to get NUMA affinity for kthread stack, or else give NUMA_NO_NODE.
* When woken, the thread will run @threadfn() with @data as its * When woken, the thread will run @threadfn() with @data as its
* argument. @threadfn() can either call do_exit() directly if it is a * argument. @threadfn() can either call do_exit() directly if it is a
* standalone thread for which no one will call kthread_stop(), or * standalone thread for which no one will call kthread_stop(), or
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment