FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_posix.h"
#include "opt_hwpmc_hooks.h"
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/posix4.h>
#include <sys/ptrace.h>
#include <sys/racct.h>
#include <sys/resourcevar.h>
#include <sys/rwlock.h>
#include <sys/sched.h>
#include <sys/sysctl.h>
#include <sys/smp.h>
#include <sys/syscallsubr.h>
#include <sys/sysent.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
#include <sys/signalvar.h>
#include <sys/ucontext.h>
#include <sys/thr.h>
#include <sys/rtprio.h>
#include <sys/umtxvar.h>
#include <sys/limits.h>
#include <machine/frame.h>
#include <security/audit/audit.h>
Go to the source code of this file.
Data Structures | |
struct | thr_create_initthr_args |
Macros | |
#define | suword_lwpid suword |
Functions | |
__FBSDID ("$FreeBSD$") | |
static | SYSCTL_NODE (_kern, OID_AUTO, threads, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "thread allocation") |
SYSCTL_INT (_kern_threads, OID_AUTO, max_threads_per_proc, CTLFLAG_RW, &max_threads_per_proc, 0, "Limit on threads per proc") | |
SYSCTL_INT (_kern_threads, OID_AUTO, max_threads_hits, CTLFLAG_RD, &max_threads_hits, 0, "kern.threads.max_threads_per_proc hit count") | |
static int | thr_create_initthr (struct thread *td, void *thunk) |
int | sys_thr_create (struct thread *td, struct thr_create_args *uap) |
int | sys_thr_new (struct thread *td, struct thr_new_args *uap) |
static int | thr_new_initthr (struct thread *td, void *thunk) |
int | kern_thr_new (struct thread *td, struct thr_param *param) |
int | thread_create (struct thread *td, struct rtprio *rtp, int(*initialize_thread)(struct thread *, void *), void *thunk) |
int | sys_thr_self (struct thread *td, struct thr_self_args *uap) |
int | sys_thr_exit (struct thread *td, struct thr_exit_args *uap) |
int | kern_thr_exit (struct thread *td) |
int | sys_thr_kill (struct thread *td, struct thr_kill_args *uap) |
int | sys_thr_kill2 (struct thread *td, struct thr_kill2_args *uap) |
int | sys_thr_suspend (struct thread *td, struct thr_suspend_args *uap) |
int | kern_thr_suspend (struct thread *td, struct timespec *tsp) |
int | sys_thr_wake (struct thread *td, struct thr_wake_args *uap) |
int | sys_thr_set_name (struct thread *td, struct thr_set_name_args *uap) |
int | kern_thr_alloc (struct proc *p, int pages, struct thread **ntd) |
Variables | |
int | max_threads_per_proc = 1500 |
static int | max_threads_hits |
#define suword_lwpid suword |
Definition at line 93 of file kern_thr.c.
__FBSDID | ( | "$FreeBSD$" | ) |
int kern_thr_alloc | ( | struct proc * | p, |
int | pages, | ||
struct thread ** | ntd | ||
) |
Definition at line 613 of file kern_thr.c.
References max_threads_hits, max_threads_per_proc, and thread_alloc().
Referenced by thread_create().
int kern_thr_exit | ( | struct thread * | td | ) |
Definition at line 325 of file kern_thr.c.
References ptracestop(), tdsigcleanup(), thread_exit(), thread_stopped(), and tidhash_remove().
Referenced by sys_thr_exit(), and thread_suspend_check().
int kern_thr_new | ( | struct thread * | td, |
struct thr_param * | param | ||
) |
Definition at line 176 of file kern_thr.c.
References thr_new_initthr(), and thread_create().
Referenced by sys_thr_new().
int kern_thr_suspend | ( | struct thread * | td, |
struct timespec * | tsp | ||
) |
Definition at line 510 of file kern_thr.c.
References tvtohz().
Referenced by sys_thr_suspend().
int sys_thr_create | ( | struct thread * | td, |
struct thr_create_args * | uap | ||
) |
Definition at line 119 of file kern_thr.c.
References thr_create_initthr_args::ctx, thr_create_initthr(), thread_create(), and thr_create_initthr_args::tid.
int sys_thr_exit | ( | struct thread * | td, |
struct thr_exit_args * | uap | ||
) |
Definition at line 309 of file kern_thr.c.
References kern_thr_exit(), kern_umtx_wake(), suword_lwpid, and umtx_thread_exit().
int sys_thr_kill | ( | struct thread * | td, |
struct thr_kill_args * | uap | ||
) |
Definition at line 388 of file kern_thr.c.
References tdfind(), and tdksignal().
int sys_thr_kill2 | ( | struct thread * | td, |
struct thr_kill2_args * | uap | ||
) |
Definition at line 435 of file kern_thr.c.
References p_cansignal(), pfind(), tdfind(), and tdksignal().
int sys_thr_new | ( | struct thread * | td, |
struct thr_new_args * | uap | ||
) |
Definition at line 132 of file kern_thr.c.
References kern_thr_new().
int sys_thr_self | ( | struct thread * | td, |
struct thr_self_args * | uap | ||
) |
Definition at line 297 of file kern_thr.c.
References suword_lwpid.
int sys_thr_set_name | ( | struct thread * | td, |
struct thr_set_name_args * | uap | ||
) |
Definition at line 578 of file kern_thr.c.
References name, and tdfind().
int sys_thr_suspend | ( | struct thread * | td, |
struct thr_suspend_args * | uap | ||
) |
Definition at line 492 of file kern_thr.c.
References kern_thr_suspend(), ts, and umtx_copyin_timeout().
int sys_thr_wake | ( | struct thread * | td, |
struct thr_wake_args * | uap | ||
) |
Definition at line 554 of file kern_thr.c.
References tdfind(), and wakeup().
SYSCTL_INT | ( | _kern_threads | , |
OID_AUTO | , | ||
max_threads_hits | , | ||
CTLFLAG_RD | , | ||
& | max_threads_hits, | ||
0 | , | ||
"kern.threads.max_threads_per_proc hit count" | |||
) |
SYSCTL_INT | ( | _kern_threads | , |
OID_AUTO | , | ||
max_threads_per_proc | , | ||
CTLFLAG_RW | , | ||
& | max_threads_per_proc, | ||
0 | , | ||
"Limit on threads per proc" | |||
) |
|
static |
|
static |
Definition at line 106 of file kern_thr.c.
References thr_create_initthr_args::ctx, suword_lwpid, and thr_create_initthr_args::tid.
Referenced by sys_thr_create().
|
static |
Definition at line 147 of file kern_thr.c.
References suword_lwpid.
Referenced by kern_thr_new().
int thread_create | ( | struct thread * | td, |
struct rtprio * | rtp, | ||
int(*)(struct thread *, void *) | initialize_thread, | ||
void * | thunk | ||
) |
Definition at line 192 of file kern_thr.c.
References kern_thr_alloc(), priv_check(), rtp_to_pri(), sched_add(), sched_fork_thread(), thread_cow_free(), thread_cow_get(), thread_free(), thread_link(), and tidhash_add().
Referenced by kern_thr_new(), and sys_thr_create().
|
static |
Definition at line 74 of file kern_thr.c.
Referenced by kern_thr_alloc().
int max_threads_per_proc = 1500 |
Definition at line 70 of file kern_thr.c.
Referenced by kern_thr_alloc(), and threadinit().