'\" t .\" Title: kthread_create_on_node .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Driver Basics .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "KTHREAD_CREATE_ON_NO" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Driver Basics" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" kthread_create_on_node \- create a kthread\&. .SH "SYNOPSIS" .HP \w'struct\ task_struct\ *\ kthread_create_on_node('u .BI "struct task_struct * kthread_create_on_node(int\ (*" "threadfn" ")\ (void\ *data), void\ *\ " "data" ", int\ " "node" ", const\ char\ " "namefmt[]" ", " "\&.\&.\&." ");" .SH "ARGUMENTS" .PP \fIthreadfn\fR .RS 4 the function to run until signal_pending(current)\&. .RE .PP \fIdata\fR .RS 4 data ptr for \fIthreadfn\fR\&. .RE .PP \fInode\fR .RS 4 task and thread structures for the thread are allocated on this node .RE .PP \fInamefmt[]\fR .RS 4 printf\-style name for the thread\&. .RE .PP \fI\&.\&.\&.\fR .RS 4 variable arguments .RE .SH "DESCRIPTION" .PP This helper function creates and names a kernel thread\&. The thread will be stopped: use \fBwake_up_process\fR to start it\&. See also \fBkthread_run\fR\&. The new thread has SCHED_NORMAL policy and is affine to all CPUs\&. .PP If thread is going to be bound on a particular cpu, give its node in \fInode\fR, to get NUMA affinity for kthread stack, or else give NUMA_NO_NODE\&. When woken, the thread will run \fIthreadfn\fR() with \fIdata\fR as its argument\&. \fIthreadfn\fR() can either call \fBdo_exit\fR directly if it is a standalone thread for which no one will call \fBkthread_stop\fR, or return when \*(Aq\fBkthread_should_stop\fR\*(Aq is true (which means \fBkthread_stop\fR has been called)\&. The return value should be zero or a negative error number; it will be passed to \fBkthread_stop\fR\&. .PP Returns a task_struct or ERR_PTR(\-ENOMEM) or ERR_PTR(\-EINTR)\&. .SH "COPYRIGHT" .br