FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/systm.h>
Go to the source code of this file.
Data Structures | |
struct | mtxpool_header |
struct | mtx_pool |
Macros | |
#define | MTX_POOL_SLEEP_SIZE 1024 |
#define | mtx_pool_size mtx_pool_header.mtxpool_size |
#define | mtx_pool_mask mtx_pool_header.mtxpool_mask |
#define | mtx_pool_shift mtx_pool_header.mtxpool_shift |
#define | mtx_pool_next mtx_pool_header.mtxpool_next |
#define | POINTER_BITS 64 |
#define | HASH_MULTIPLIER 11400714819323198485u /* (2^64)*(sqrt(5)-1)/2 */ |
Functions | |
__FBSDID ("$FreeBSD$") | |
static | MALLOC_DEFINE (M_MTXPOOL, "mtx_pool", "mutex pool") |
struct mtx * | mtx_pool_find (struct mtx_pool *pool, void *ptr) |
static void | mtx_pool_initialize (struct mtx_pool *pool, const char *mtx_name, int pool_size, int opts) |
struct mtx_pool * | mtx_pool_create (const char *mtx_name, int pool_size, int opts) |
void | mtx_pool_destroy (struct mtx_pool **poolp) |
static void | mtx_pool_setup_dynamic (void *dummy __unused) |
struct mtx * | mtx_pool_alloc (struct mtx_pool *pool) |
SYSINIT (mtxpooli2, SI_SUB_MTX_POOL_DYNAMIC, SI_ORDER_FIRST, mtx_pool_setup_dynamic, NULL) | |
Variables | |
struct mtx_pool __read_mostly * | mtxpool_sleep |
#define HASH_MULTIPLIER 11400714819323198485u /* (2^64)*(sqrt(5)-1)/2 */ |
Definition at line 88 of file kern_mtxpool.c.
#define mtx_pool_mask mtx_pool_header.mtxpool_mask |
Definition at line 80 of file kern_mtxpool.c.
#define mtx_pool_next mtx_pool_header.mtxpool_next |
Definition at line 82 of file kern_mtxpool.c.
#define mtx_pool_shift mtx_pool_header.mtxpool_shift |
Definition at line 81 of file kern_mtxpool.c.
#define mtx_pool_size mtx_pool_header.mtxpool_size |
Definition at line 79 of file kern_mtxpool.c.
#define MTX_POOL_SLEEP_SIZE 1024 |
Definition at line 64 of file kern_mtxpool.c.
#define POINTER_BITS 64 |
Definition at line 87 of file kern_mtxpool.c.
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 173 of file kern_mtxpool.c.
References mtx_pool::mtx_pool_ary.
struct mtx_pool * mtx_pool_create | ( | const char * | mtx_name, |
int | pool_size, | ||
int | opts | ||
) |
Definition at line 132 of file kern_mtxpool.c.
References malloc(), mtx, mtx_pool_initialize(), and printf().
Referenced by mtx_pool_setup_dynamic(), and selectinit().
void mtx_pool_destroy | ( | struct mtx_pool ** | poolp | ) |
Definition at line 149 of file kern_mtxpool.c.
References free(), and mtx_pool::mtx_pool_ary.
Definition at line 101 of file kern_mtxpool.c.
References HASH_MULTIPLIER, and mtx_pool::mtx_pool_ary.
Referenced by bdone(), biodone(), biowait(), bwait(), get_advice(), selrecord(), uipc_close(), uipc_detach(), unp_connectat(), and vfs_unp_reclaim().
|
static |
Definition at line 116 of file kern_mtxpool.c.
References mtx_pool::mtx_pool_ary, and POINTER_BITS.
Referenced by mtx_pool_create().
|
static |
Definition at line 161 of file kern_mtxpool.c.
References mtx_pool_create(), MTX_POOL_SLEEP_SIZE, and mtxpool_sleep.
SYSINIT | ( | mtxpooli2 | , |
SI_SUB_MTX_POOL_DYNAMIC | , | ||
SI_ORDER_FIRST | , | ||
mtx_pool_setup_dynamic | , | ||
NULL | |||
) |
struct mtx_pool __read_mostly* mtxpool_sleep |
Definition at line 84 of file kern_mtxpool.c.
Referenced by bdone(), biodone(), biowait(), bwait(), get_advice(), kern_posix_fadvise(), mtx_pool_setup_dynamic(), uipc_close(), uipc_detach(), unp_connectat(), and vfs_unp_reclaim().