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 format string 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 kthread_create_on_cpu.
34
35 If thread is going to be bound on a particular cpu, give its node in
36 node, to get NUMA affinity for kthread stack, or else give -1. When
37 woken, the thread will run threadfn() with data as its argument.
38 threadfn() can either call do_exit directly if it is a standalone
39 thread for which noone will call kthread_stop, or return when
40 ´kthread_should_stop´ is true (which means kthread_stop has been
41 called). The return value should be zero or a negative error number; it
42 will be passed to kthread_stop.
43
44 Returns a task_struct or ERR_PTR(-ENOMEM).
45
47Kernel Hackers Manual 2.6. June 2019 KTHREAD_CREATE_ON_NO(9)