|
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 |
| struct | mtx_pool_lockbuilder |
Macros | |
| #define | MTX_POOL_LOCKBUILDER_SIZE 128 |
| #define | MTX_POOL_SLEEP_SIZE 128 |
| #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 ("$BSDSUniX$") | |
| 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_static (void *dummy __unused) |
| static void | mtx_pool_setup_dynamic (void *dummy __unused) |
| struct mtx * | mtx_pool_alloc (struct mtx_pool *pool) |
| SYSINIT (mtxpooli1, SI_SUB_MTX_POOL_STATIC, SI_ORDER_FIRST, mtx_pool_setup_static, NULL) | |
| SYSINIT (mtxpooli2, SI_SUB_MTX_POOL_DYNAMIC, SI_ORDER_FIRST, mtx_pool_setup_dynamic, NULL) | |
Variables | |
| static struct mtx_pool_lockbuilder | lockbuilder_pool |
| struct mtx_pool * | mtxpool_sleep |
| struct mtx_pool * | mtxpool_lockbuilder |
| #define HASH_MULTIPLIER 11400714819323198485u /* (2^64)*(sqrt(5)-1)/2 */ |
Definition at line 96 of file kern_mtxpool.c.
Referenced by mtx_pool_find().
| #define MTX_POOL_LOCKBUILDER_SIZE 128 |
Definition at line 63 of file kern_mtxpool.c.
Referenced by mtx_pool_setup_static().
| #define mtx_pool_mask mtx_pool_header.mtxpool_mask |
Definition at line 87 of file kern_mtxpool.c.
| #define mtx_pool_next mtx_pool_header.mtxpool_next |
Definition at line 89 of file kern_mtxpool.c.
| #define mtx_pool_shift mtx_pool_header.mtxpool_shift |
Definition at line 88 of file kern_mtxpool.c.
| #define mtx_pool_size mtx_pool_header.mtxpool_size |
Definition at line 86 of file kern_mtxpool.c.
| #define MTX_POOL_SLEEP_SIZE 128 |
Definition at line 66 of file kern_mtxpool.c.
Referenced by mtx_pool_setup_dynamic().
| #define POINTER_BITS 64 |
Definition at line 95 of file kern_mtxpool.c.
Referenced by mtx_pool_initialize().
| __FBSDID | ( | "$BSDSUniX$" | ) |
|
static |
| struct mtx* mtx_pool_alloc | ( | struct mtx_pool * | pool | ) |
Definition at line 190 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 140 of file kern_mtxpool.c.
References malloc(), mtx_pool_initialize(), and printf().
Referenced by mtx_pool_setup_dynamic(), and selectinit().


| void mtx_pool_destroy | ( | struct mtx_pool ** | poolp | ) |
Definition at line 157 of file kern_mtxpool.c.
References free(), mtx_destroy(), and mtx_pool::mtx_pool_ary.

| struct mtx* mtx_pool_find | ( | struct mtx_pool * | pool, |
| void * | ptr | ||
| ) |
Definition at line 109 of file kern_mtxpool.c.
References HASH_MULTIPLIER, and mtx_pool::mtx_pool_ary.
Referenced by bdone(), biodone(), biowait(), bpin(), bunpin(), bunpin_wait(), bwait(), foffset_lock(), foffset_unlock(), get_advice(), selrecord(), vn_read(), and vn_write().

|
static |
Definition at line 124 of file kern_mtxpool.c.
References mtx_init(), mtx_pool::mtx_pool_ary, and POINTER_BITS.
Referenced by mtx_pool_create(), and mtx_pool_setup_static().


|
static |
Definition at line 178 of file kern_mtxpool.c.
References mtx_pool_create(), and MTX_POOL_SLEEP_SIZE.

|
static |
Definition at line 169 of file kern_mtxpool.c.
References lockbuilder_pool, mtx_pool_initialize(), and MTX_POOL_LOCKBUILDER_SIZE.

| SYSINIT | ( | mtxpooli1 | , |
| SI_SUB_MTX_POOL_STATIC | , | ||
| SI_ORDER_FIRST | , | ||
| mtx_pool_setup_static | , | ||
| NULL | |||
| ) |
| SYSINIT | ( | mtxpooli2 | , |
| SI_SUB_MTX_POOL_DYNAMIC | , | ||
| SI_ORDER_FIRST | , | ||
| mtx_pool_setup_dynamic | , | ||
| NULL | |||
| ) |
|
static |
Referenced by mtx_pool_setup_static().
| struct mtx_pool* mtxpool_lockbuilder |
Definition at line 92 of file kern_mtxpool.c.
| struct mtx_pool* mtxpool_sleep |
Definition at line 91 of file kern_mtxpool.c.
Referenced by bdone(), biodone(), biowait(), bpin(), bunpin(), bunpin_wait(), bwait(), foffset_lock(), foffset_unlock(), get_advice(), kern_posix_fadvise(), vn_read(), and vn_write().