1KTHREAD_CREATE_ON_NO(9) Driver Basics KTHREAD_CREATE_ON_NO(9)
2
3
4
6 kthread_create_on_node - create a kthread.
7
9 struct task_struct *
10 kthread_create_on_node(int (*threadfn) (void *data),
11 void * data, int node,
12 const char namefmt[], ...);
13
15 threadfn
16 the function to run until signal_pending(current).
17
18 data
19 data ptr for threadfn.
20
21 node
22 memory node number.
23
24 namefmt[]
25 printf-style name for the thread.
26
27 ...
28 variable arguments
29
31 This helper function creates and names a kernel thread. The thread will
32 be stopped: use wake_up_process to start it. See also kthread_run.
33
34 If thread is going to be bound on a particular cpu, give its node in
35 node, to get NUMA affinity for kthread stack, or else give -1. When
36 woken, the thread will run threadfn() with data as its argument.
37 threadfn() can either call do_exit directly if it is a standalone
38 thread for which no one will call kthread_stop, or return when
39 'kthread_should_stop' is true (which means kthread_stop has been
40 called). The return value should be zero or a negative error number; it
41 will be passed to kthread_stop.
42
43 Returns a task_struct or ERR_PTR(-ENOMEM).
44
46Kernel Hackers Manual 3.10 June 2019 KTHREAD_CREATE_ON_NO(9)