2001-03-09 03:09:30 +00:00
|
|
|
.\" Copyright (c) 2000-2001
|
2000-10-24 03:33:24 +00:00
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
- Fix the kthread_{suspend, resume, suspend_check}() locking.
In the current code, the locking is completely broken and may lead
easilly to deadlocks. Fix it by using the proc_mtx, linked to the
suspending thread, as lock for the operation. Keep using the
thread_lock for setting and reading the flag even if it is not entirely
necessary (atomic ops may do it as well, but this way the code is more
readable).
- Fix a deadlock within kthread_suspend().
The suspender should not sleep on a different channel wrt the suspended
thread, or, otherwise, the awaker should wakeup both. Uniform the
interface to what the kproc_* counterparts do (sleeping on the same
channel).
- Change the kthread_suspend_check() prototype.
kthread_suspend_check() always assumes curthread and must only refer to
it, so skip the thread pointer as it may be easilly mistaken.
If curthread is not a kthread, the system will panic.
In collabouration with: jhb
Tested by: Giovanni Trematerra
<giovanni dot trematerra at gmail dot com>
MFC: 2 weeks
2010-01-24 15:07:00 +00:00
|
|
|
.Dd January 24, 2010
|
2000-10-24 03:33:24 +00:00
|
|
|
.Dt KTHREAD 9
|
2000-11-13 20:34:20 +00:00
|
|
|
.Os
|
2000-10-24 03:33:24 +00:00
|
|
|
.Sh NAME
|
2007-10-26 08:28:45 +00:00
|
|
|
.Nm kthread_start ,
|
|
|
|
.Nm kthread_shutdown ,
|
|
|
|
.Nm kthread_add ,
|
2000-10-24 03:33:24 +00:00
|
|
|
.Nm kthread_exit ,
|
2000-12-15 20:39:35 +00:00
|
|
|
.Nm kthread_resume ,
|
|
|
|
.Nm kthread_suspend ,
|
|
|
|
.Nm kthread_suspend_check
|
2007-10-26 16:50:21 +00:00
|
|
|
.Nd "kernel threads"
|
2000-10-24 03:33:24 +00:00
|
|
|
.Sh SYNOPSIS
|
2001-10-01 16:09:29 +00:00
|
|
|
.In sys/kthread.h
|
2000-10-24 03:33:24 +00:00
|
|
|
.Ft void
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_start "const void *udata"
|
2000-11-13 20:34:20 +00:00
|
|
|
.Ft void
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_shutdown "void *arg" "int howto"
|
2000-10-24 03:33:24 +00:00
|
|
|
.Ft void
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_exit "void"
|
2000-10-24 03:33:24 +00:00
|
|
|
.Ft int
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_resume "struct thread *td"
|
2000-11-13 20:34:20 +00:00
|
|
|
.Ft int
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_suspend "struct thread *td" "int timo"
|
2000-12-15 20:39:35 +00:00
|
|
|
.Ft void
|
- Fix the kthread_{suspend, resume, suspend_check}() locking.
In the current code, the locking is completely broken and may lead
easilly to deadlocks. Fix it by using the proc_mtx, linked to the
suspending thread, as lock for the operation. Keep using the
thread_lock for setting and reading the flag even if it is not entirely
necessary (atomic ops may do it as well, but this way the code is more
readable).
- Fix a deadlock within kthread_suspend().
The suspender should not sleep on a different channel wrt the suspended
thread, or, otherwise, the awaker should wakeup both. Uniform the
interface to what the kproc_* counterparts do (sleeping on the same
channel).
- Change the kthread_suspend_check() prototype.
kthread_suspend_check() always assumes curthread and must only refer to
it, so skip the thread pointer as it may be easilly mistaken.
If curthread is not a kthread, the system will panic.
In collabouration with: jhb
Tested by: Giovanni Trematerra
<giovanni dot trematerra at gmail dot com>
MFC: 2 weeks
2010-01-24 15:07:00 +00:00
|
|
|
.Fn kthread_suspend_check "void"
|
2009-01-27 00:22:16 +00:00
|
|
|
.In sys/unistd.h
|
|
|
|
.Ft int
|
|
|
|
.Fo kthread_add
|
|
|
|
.Fa "void (*func)(void *)" "void *arg" "struct proc *procp"
|
|
|
|
.Fa "struct thread **newtdpp" "int flags" "int pages"
|
|
|
|
.Fa "const char *fmt" ...
|
|
|
|
.Fc
|
2008-04-29 22:43:15 +00:00
|
|
|
.Ft int
|
|
|
|
.Fo kproc_kthread_add
|
|
|
|
.Fa "void (*func)(void *)" "void *arg"
|
|
|
|
.Fa "struct proc **procptr" "struct thread **tdptr"
|
|
|
|
.Fa "int flags" "int pages" "char * procname" "const char *fmt" "..."
|
|
|
|
.Fc
|
2000-10-24 03:33:24 +00:00
|
|
|
.Sh DESCRIPTION
|
2009-08-23 07:48:11 +00:00
|
|
|
In
|
|
|
|
.Fx 8.0 ,
|
|
|
|
the older family of
|
|
|
|
.Fn kthread_* 9
|
|
|
|
functions was renamed to be the
|
|
|
|
.Fn kproc_* 9
|
|
|
|
family of functions,
|
|
|
|
as they were previously misnamed
|
|
|
|
and actually produced kernel processes.
|
|
|
|
This new family of
|
|
|
|
.Fn kthread_* 9
|
|
|
|
functions was added to produce
|
|
|
|
.Em real
|
|
|
|
kernel threads.
|
|
|
|
See the
|
|
|
|
.Xr kproc 9
|
|
|
|
man page for more information on the renamed calls.
|
|
|
|
Also note that the
|
|
|
|
.Fn kproc_kthread_add 9
|
|
|
|
function appears in both pages as its functionality is split.
|
|
|
|
.Pp
|
2000-10-24 03:33:24 +00:00
|
|
|
The function
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_start
|
2000-11-13 20:34:20 +00:00
|
|
|
is used to start
|
|
|
|
.Dq internal
|
2007-10-26 16:50:21 +00:00
|
|
|
daemons such as
|
|
|
|
.Nm bufdaemon , pagedaemon , vmdaemon ,
|
|
|
|
and the
|
|
|
|
.Nm syncer
|
|
|
|
and is intended
|
2000-11-13 20:34:20 +00:00
|
|
|
to be called from
|
|
|
|
.Xr SYSINIT 9 .
|
|
|
|
The
|
|
|
|
.Fa udata
|
|
|
|
argument is actually a pointer to a
|
2007-10-26 16:50:21 +00:00
|
|
|
.Vt "struct kthread_desc"
|
2000-11-13 20:34:20 +00:00
|
|
|
which describes the kernel thread that should be created:
|
|
|
|
.Bd -literal -offset indent
|
2007-10-26 08:28:45 +00:00
|
|
|
struct kthread_desc {
|
2007-10-26 16:50:21 +00:00
|
|
|
char *arg0;
|
|
|
|
void (*func)(void);
|
|
|
|
struct thread **global_threadpp;
|
2000-11-13 20:34:20 +00:00
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The structure members are used by
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_start
|
2000-11-13 20:34:20 +00:00
|
|
|
as follows:
|
2007-10-26 16:50:21 +00:00
|
|
|
.Bl -tag -width ".Va global_threadpp" -offset indent
|
2000-11-13 20:34:20 +00:00
|
|
|
.It Va arg0
|
2007-10-26 08:28:45 +00:00
|
|
|
String to be used for the name of the thread.
|
2000-11-13 20:34:20 +00:00
|
|
|
This string will be copied into the
|
2007-10-26 08:28:45 +00:00
|
|
|
.Va td_name
|
|
|
|
member of the new threads'
|
2007-10-26 16:50:21 +00:00
|
|
|
.Vt "struct thread" .
|
2000-11-13 20:34:20 +00:00
|
|
|
.It Va func
|
2007-10-26 16:50:21 +00:00
|
|
|
The main function for this kernel thread to run.
|
2007-10-26 08:28:45 +00:00
|
|
|
.It Va global_threadpp
|
2000-11-13 20:34:20 +00:00
|
|
|
A pointer to a
|
2007-10-26 16:50:21 +00:00
|
|
|
.Vt "struct thread"
|
|
|
|
pointer that should be updated to point to the newly created thread's
|
|
|
|
.Vt thread
|
2000-11-13 20:34:20 +00:00
|
|
|
structure.
|
|
|
|
If this variable is
|
|
|
|
.Dv NULL ,
|
2007-10-26 16:50:21 +00:00
|
|
|
then it is ignored.
|
|
|
|
The thread will be a subthread of
|
|
|
|
.Va proc0
|
|
|
|
(PID 0).
|
2000-11-13 20:34:20 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_add
|
2000-11-13 20:34:20 +00:00
|
|
|
function is used to create a kernel thread.
|
2007-10-26 16:50:21 +00:00
|
|
|
The new thread runs in kernel mode only.
|
|
|
|
It is added to the process specified by the
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fa procp
|
2007-10-26 16:50:21 +00:00
|
|
|
argument, or if that is
|
|
|
|
.Dv NULL ,
|
|
|
|
to
|
|
|
|
.Va proc0 .
|
2000-11-13 20:34:20 +00:00
|
|
|
The
|
|
|
|
.Fa func
|
|
|
|
argument specifies the function that the thread should execute.
|
|
|
|
The
|
|
|
|
.Fa arg
|
|
|
|
argument is an arbitrary pointer that is passed in as the only argument to
|
|
|
|
.Fa func
|
2007-10-26 16:50:21 +00:00
|
|
|
when it is called by the new thread.
|
2000-11-13 20:34:20 +00:00
|
|
|
The
|
2007-10-26 16:50:21 +00:00
|
|
|
.Fa newtdpp
|
2000-11-13 20:34:20 +00:00
|
|
|
pointer points to a
|
2007-10-26 16:50:21 +00:00
|
|
|
.Vt "struct thread"
|
2007-10-26 08:28:45 +00:00
|
|
|
pointer that is to be updated to point to the newly created thread.
|
2000-11-13 20:34:20 +00:00
|
|
|
If this argument is
|
|
|
|
.Dv NULL ,
|
|
|
|
then it is ignored.
|
|
|
|
The
|
|
|
|
.Fa flags
|
2009-01-27 00:22:16 +00:00
|
|
|
argument may be set to
|
|
|
|
.Dv RFSTOPPED
|
|
|
|
to leave the thread in a stopped state.
|
|
|
|
The caller must call
|
|
|
|
.Fn sched_add
|
|
|
|
to start the thread.
|
2002-10-19 01:39:44 +00:00
|
|
|
The
|
|
|
|
.Fa pages
|
|
|
|
argument specifies the size of the new kernel thread's stack in pages.
|
|
|
|
If 0 is used, the default kernel stack size is allocated.
|
2000-11-13 20:34:20 +00:00
|
|
|
The rest of the arguments form a
|
|
|
|
.Xr printf 9
|
|
|
|
argument list that is used to build the name of the new thread and is stored
|
|
|
|
in the
|
2007-10-26 08:28:45 +00:00
|
|
|
.Va td_name
|
2000-11-13 20:34:20 +00:00
|
|
|
member of the new thread's
|
2007-10-26 16:50:21 +00:00
|
|
|
.Vt "struct thread" .
|
2000-11-13 20:34:20 +00:00
|
|
|
.Pp
|
|
|
|
The
|
2008-04-29 22:43:15 +00:00
|
|
|
.Fn kproc_kthread_add
|
|
|
|
function is much like the
|
|
|
|
.Fn kthread_add
|
|
|
|
function above except that if the kproc does not already
|
|
|
|
exist, it is created.
|
|
|
|
This function is better documented in the
|
|
|
|
.Xr kproc 9
|
|
|
|
manual page.
|
|
|
|
.Pp
|
|
|
|
The
|
2000-10-24 03:33:24 +00:00
|
|
|
.Fn kthread_exit
|
2000-11-13 20:34:20 +00:00
|
|
|
function is used to terminate kernel threads.
|
|
|
|
It should be called by the main function of the kernel thread rather than
|
|
|
|
letting the main function return to its caller.
|
2007-10-26 16:50:21 +00:00
|
|
|
.\" XXX "int ecode" argument isn't documented.
|
2000-11-13 20:34:20 +00:00
|
|
|
.Pp
|
|
|
|
The
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_resume ,
|
|
|
|
.Fn kthread_suspend ,
|
2000-11-13 20:34:20 +00:00
|
|
|
and
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_suspend_check
|
2000-11-13 20:34:20 +00:00
|
|
|
functions are used to suspend and resume a kernel thread.
|
|
|
|
During the main loop of its execution, a kernel thread that wishes to allow
|
|
|
|
itself to be suspended should call
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_suspend_check
|
- Fix the kthread_{suspend, resume, suspend_check}() locking.
In the current code, the locking is completely broken and may lead
easilly to deadlocks. Fix it by using the proc_mtx, linked to the
suspending thread, as lock for the operation. Keep using the
thread_lock for setting and reading the flag even if it is not entirely
necessary (atomic ops may do it as well, but this way the code is more
readable).
- Fix a deadlock within kthread_suspend().
The suspender should not sleep on a different channel wrt the suspended
thread, or, otherwise, the awaker should wakeup both. Uniform the
interface to what the kproc_* counterparts do (sleeping on the same
channel).
- Change the kthread_suspend_check() prototype.
kthread_suspend_check() always assumes curthread and must only refer to
it, so skip the thread pointer as it may be easilly mistaken.
If curthread is not a kthread, the system will panic.
In collabouration with: jhb
Tested by: Giovanni Trematerra
<giovanni dot trematerra at gmail dot com>
MFC: 2 weeks
2010-01-24 15:07:00 +00:00
|
|
|
in order to check if the it has been asked to suspend.
|
2000-11-13 20:34:20 +00:00
|
|
|
If it has, it will
|
- Fix the kthread_{suspend, resume, suspend_check}() locking.
In the current code, the locking is completely broken and may lead
easilly to deadlocks. Fix it by using the proc_mtx, linked to the
suspending thread, as lock for the operation. Keep using the
thread_lock for setting and reading the flag even if it is not entirely
necessary (atomic ops may do it as well, but this way the code is more
readable).
- Fix a deadlock within kthread_suspend().
The suspender should not sleep on a different channel wrt the suspended
thread, or, otherwise, the awaker should wakeup both. Uniform the
interface to what the kproc_* counterparts do (sleeping on the same
channel).
- Change the kthread_suspend_check() prototype.
kthread_suspend_check() always assumes curthread and must only refer to
it, so skip the thread pointer as it may be easilly mistaken.
If curthread is not a kthread, the system will panic.
In collabouration with: jhb
Tested by: Giovanni Trematerra
<giovanni dot trematerra at gmail dot com>
MFC: 2 weeks
2010-01-24 15:07:00 +00:00
|
|
|
.Xr msleep 9
|
2000-11-13 20:34:20 +00:00
|
|
|
until it is told to resume.
|
|
|
|
Once it has been told to resume it will return allowing execution of the
|
|
|
|
kernel thread to continue.
|
|
|
|
The other two functions are used to notify a kernel thread of a suspend or
|
|
|
|
resume request.
|
|
|
|
The
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fa td
|
2000-11-13 20:34:20 +00:00
|
|
|
argument points to the
|
2007-10-26 16:50:21 +00:00
|
|
|
.Vt "struct thread"
|
2000-11-13 20:34:20 +00:00
|
|
|
of the kernel thread to suspend or resume.
|
|
|
|
For
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_suspend ,
|
2000-11-13 20:34:20 +00:00
|
|
|
the
|
|
|
|
.Fa timo
|
|
|
|
argument specifies a timeout to wait for the kernel thread to acknowledge the
|
|
|
|
suspend request and suspend itself.
|
|
|
|
.Pp
|
|
|
|
The
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_shutdown
|
2000-11-13 20:34:20 +00:00
|
|
|
function is meant to be registered as a shutdown event for kernel threads that
|
|
|
|
need to be suspended voluntarily during system shutdown so as not to interfere
|
|
|
|
with system shutdown activities.
|
|
|
|
The actual suspension of the kernel thread is done with
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_suspend .
|
2000-11-13 20:34:20 +00:00
|
|
|
.Sh RETURN VALUES
|
|
|
|
The
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_add ,
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_resume ,
|
2000-11-13 20:34:20 +00:00
|
|
|
and
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_suspend
|
2000-11-13 20:34:20 +00:00
|
|
|
functions return zero on success and non-zero on failure.
|
|
|
|
.Sh EXAMPLES
|
|
|
|
This example demonstrates the use of a
|
2007-10-26 16:50:21 +00:00
|
|
|
.Vt "struct kthread_desc"
|
2000-11-13 20:34:20 +00:00
|
|
|
and the functions
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_start ,
|
|
|
|
.Fn kthread_shutdown ,
|
2000-10-24 03:33:24 +00:00
|
|
|
and
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_suspend_check
|
2000-11-13 20:34:20 +00:00
|
|
|
to run the
|
2007-10-26 16:50:21 +00:00
|
|
|
.Nm bufdaemon
|
2000-11-13 20:34:20 +00:00
|
|
|
process.
|
|
|
|
.Bd -literal -offset indent
|
2007-10-26 08:28:45 +00:00
|
|
|
static struct thread *bufdaemonthread;
|
2000-11-13 20:34:20 +00:00
|
|
|
|
2007-10-26 08:28:45 +00:00
|
|
|
static struct kthread_desc buf_kp = {
|
2000-11-13 20:34:20 +00:00
|
|
|
"bufdaemon",
|
|
|
|
buf_daemon,
|
2007-10-26 08:28:45 +00:00
|
|
|
&bufdaemonthread
|
2000-11-13 20:34:20 +00:00
|
|
|
};
|
2007-10-26 08:28:45 +00:00
|
|
|
SYSINIT(bufdaemon, SI_SUB_KTHREAD_BUF, SI_ORDER_FIRST, kthread_start,
|
2000-11-13 20:34:20 +00:00
|
|
|
&buf_kp)
|
|
|
|
|
|
|
|
static void
|
|
|
|
buf_daemon()
|
|
|
|
{
|
|
|
|
...
|
|
|
|
/*
|
|
|
|
* This process needs to be suspended prior to shutdown sync.
|
|
|
|
*/
|
2007-10-26 08:28:45 +00:00
|
|
|
EVENTHANDLER_REGISTER(shutdown_pre_sync, kthread_shutdown,
|
|
|
|
bufdaemonthread, SHUTDOWN_PRI_LAST);
|
2000-11-13 20:34:20 +00:00
|
|
|
...
|
|
|
|
for (;;) {
|
2007-10-26 08:28:45 +00:00
|
|
|
kthread_suspend_check(bufdaemonthread);
|
2000-11-13 20:34:20 +00:00
|
|
|
...
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.Ed
|
|
|
|
.Sh ERRORS
|
|
|
|
The
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_resume
|
2000-11-13 20:34:20 +00:00
|
|
|
and
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_suspend
|
2000-11-13 20:34:20 +00:00
|
|
|
functions will fail if:
|
|
|
|
.Bl -tag -width Er
|
|
|
|
.It Bq Er EINVAL
|
|
|
|
The
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fa td
|
2000-11-13 20:34:20 +00:00
|
|
|
argument does not reference a kernel thread.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The
|
2007-10-26 16:50:21 +00:00
|
|
|
.Fn kthread_add
|
2000-11-13 20:34:20 +00:00
|
|
|
function will fail if:
|
|
|
|
.Bl -tag -width Er
|
2009-01-27 00:22:16 +00:00
|
|
|
.It Bq Er ENOMEM
|
|
|
|
Memory for a thread's stack could not be allocated.
|
2000-12-29 09:18:45 +00:00
|
|
|
.El
|
2000-10-24 03:33:24 +00:00
|
|
|
.Sh SEE ALSO
|
2007-10-26 16:50:21 +00:00
|
|
|
.Xr kproc 9 ,
|
2004-09-24 19:58:47 +00:00
|
|
|
.Xr SYSINIT 9 ,
|
|
|
|
.Xr wakeup 9
|
2000-11-13 20:34:20 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_start
|
2000-11-13 20:34:20 +00:00
|
|
|
function first appeared in
|
2007-10-26 16:50:21 +00:00
|
|
|
.Fx 2.2
|
|
|
|
where it created a whole process.
|
|
|
|
It was converted to create threads in
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fx 8.0 .
|
2000-11-13 20:34:20 +00:00
|
|
|
The
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_shutdown ,
|
2000-11-13 20:34:20 +00:00
|
|
|
.Fn kthread_exit ,
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_resume ,
|
|
|
|
.Fn kthread_suspend ,
|
2000-11-13 20:34:20 +00:00
|
|
|
and
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_suspend_check
|
2002-01-09 11:43:48 +00:00
|
|
|
functions were introduced in
|
2007-10-26 16:50:21 +00:00
|
|
|
.Fx 4.0
|
|
|
|
and were converted to threads in
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fx 8.0 .
|
2007-10-26 16:50:21 +00:00
|
|
|
The
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_create
|
2007-10-26 16:50:21 +00:00
|
|
|
call was renamed to
|
|
|
|
.Fn kthread_add
|
|
|
|
in
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fx 8.0 .
|
2007-10-26 16:50:21 +00:00
|
|
|
The old functionality of creating a kernel process was renamed
|
|
|
|
to
|
|
|
|
.Xr kproc_create 9 .
|
2000-12-15 20:39:35 +00:00
|
|
|
Prior to
|
|
|
|
.Fx 5.0 ,
|
|
|
|
the
|
2007-10-26 08:28:45 +00:00
|
|
|
.Fn kthread_shutdown ,
|
2000-12-15 20:39:35 +00:00
|
|
|
.Fn kthread_resume ,
|
|
|
|
.Fn kthread_suspend ,
|
|
|
|
and
|
|
|
|
.Fn kthread_suspend_check
|
|
|
|
functions were named
|
|
|
|
.Fn shutdown_kproc ,
|
|
|
|
.Fn resume_kproc ,
|
|
|
|
.Fn shutdown_kproc ,
|
|
|
|
and
|
|
|
|
.Fn kproc_suspend_loop ,
|
|
|
|
respectively.
|