Clarify some language. Favor primary where both master and primary were
used in conjunction with secondary.
This commit is contained in:
parent
7621bd5ead
commit
c8b0a88b8d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362449
11
sys/vm/uma.h
11
sys/vm/uma.h
@ -197,24 +197,23 @@ uma_zone_t uma_zcreate(const char *name, size_t size, uma_ctor ctor,
|
|||||||
* ctor/dtor/zinit/zfini may all be null, see notes above.
|
* ctor/dtor/zinit/zfini may all be null, see notes above.
|
||||||
* Note that the zinit and zfini specified here are NOT
|
* Note that the zinit and zfini specified here are NOT
|
||||||
* exactly the same as the init/fini specified to uma_zcreate()
|
* exactly the same as the init/fini specified to uma_zcreate()
|
||||||
* when creating a master zone. These zinit/zfini are called
|
* when creating a primary zone. These zinit/zfini are called
|
||||||
* on the TRANSITION from keg to zone (and vice-versa). Once
|
* on the TRANSITION from keg to zone (and vice-versa). Once
|
||||||
* these are set, the primary zone may alter its init/fini
|
* these are set, the primary zone may alter its init/fini
|
||||||
* (which are called when the object passes from VM to keg)
|
* (which are called when the object passes from VM to keg)
|
||||||
* using uma_zone_set_init/fini()) as well as its own
|
* using uma_zone_set_init/fini()) as well as its own
|
||||||
* zinit/zfini (unset by default for master zone) with
|
* zinit/zfini (unset by default for primary zone) with
|
||||||
* uma_zone_set_zinit/zfini() (note subtle 'z' prefix).
|
* uma_zone_set_zinit/zfini() (note subtle 'z' prefix).
|
||||||
*
|
*
|
||||||
* master A reference to this zone's Master Zone (Primary Zone),
|
* primary A reference to this zone's Primary Zone which contains the
|
||||||
* which contains the backing Keg for the Secondary Zone
|
* backing Keg for the Secondary Zone being added.
|
||||||
* being added.
|
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* A pointer to a structure which is intended to be opaque to users of
|
* A pointer to a structure which is intended to be opaque to users of
|
||||||
* the interface. The value may be null if the wait flag is not set.
|
* the interface. The value may be null if the wait flag is not set.
|
||||||
*/
|
*/
|
||||||
uma_zone_t uma_zsecond_create(const char *name, uma_ctor ctor, uma_dtor dtor,
|
uma_zone_t uma_zsecond_create(const char *name, uma_ctor ctor, uma_dtor dtor,
|
||||||
uma_init zinit, uma_fini zfini, uma_zone_t master);
|
uma_init zinit, uma_fini zfini, uma_zone_t primary);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create cache-only zones.
|
* Create cache-only zones.
|
||||||
|
@ -2197,7 +2197,7 @@ keg_ctor(void *mem, int size, void *udata, int flags)
|
|||||||
keg->uk_dr.dr_iter = 0;
|
keg->uk_dr.dr_iter = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The master zone is passed to us at keg-creation time.
|
* The primary zone is passed to us at keg-creation time.
|
||||||
*/
|
*/
|
||||||
zone = arg->zone;
|
zone = arg->zone;
|
||||||
keg->uk_name = zone->uz_name;
|
keg->uk_name = zone->uz_name;
|
||||||
@ -2808,7 +2808,7 @@ uma_startup1(vm_offset_t virtual_avail)
|
|||||||
{
|
{
|
||||||
struct uma_zctor_args args;
|
struct uma_zctor_args args;
|
||||||
size_t ksize, zsize, size;
|
size_t ksize, zsize, size;
|
||||||
uma_keg_t masterkeg;
|
uma_keg_t primarykeg;
|
||||||
uintptr_t m;
|
uintptr_t m;
|
||||||
int domain;
|
int domain;
|
||||||
uint8_t pflag;
|
uint8_t pflag;
|
||||||
@ -2838,7 +2838,7 @@ uma_startup1(vm_offset_t virtual_avail)
|
|||||||
m += zsize;
|
m += zsize;
|
||||||
kegs = (uma_zone_t)m;
|
kegs = (uma_zone_t)m;
|
||||||
m += zsize;
|
m += zsize;
|
||||||
masterkeg = (uma_keg_t)m;
|
primarykeg = (uma_keg_t)m;
|
||||||
|
|
||||||
/* "manually" create the initial zone */
|
/* "manually" create the initial zone */
|
||||||
memset(&args, 0, sizeof(args));
|
memset(&args, 0, sizeof(args));
|
||||||
@ -2848,7 +2848,7 @@ uma_startup1(vm_offset_t virtual_avail)
|
|||||||
args.dtor = keg_dtor;
|
args.dtor = keg_dtor;
|
||||||
args.uminit = zero_init;
|
args.uminit = zero_init;
|
||||||
args.fini = NULL;
|
args.fini = NULL;
|
||||||
args.keg = masterkeg;
|
args.keg = primarykeg;
|
||||||
args.align = UMA_SUPER_ALIGN - 1;
|
args.align = UMA_SUPER_ALIGN - 1;
|
||||||
args.flags = UMA_ZFLAG_INTERNAL;
|
args.flags = UMA_ZFLAG_INTERNAL;
|
||||||
zone_ctor(kegs, zsize, &args, M_WAITOK);
|
zone_ctor(kegs, zsize, &args, M_WAITOK);
|
||||||
@ -3024,13 +3024,13 @@ uma_zcreate(const char *name, size_t size, uma_ctor ctor, uma_dtor dtor,
|
|||||||
/* See uma.h */
|
/* See uma.h */
|
||||||
uma_zone_t
|
uma_zone_t
|
||||||
uma_zsecond_create(const char *name, uma_ctor ctor, uma_dtor dtor,
|
uma_zsecond_create(const char *name, uma_ctor ctor, uma_dtor dtor,
|
||||||
uma_init zinit, uma_fini zfini, uma_zone_t master)
|
uma_init zinit, uma_fini zfini, uma_zone_t primary)
|
||||||
{
|
{
|
||||||
struct uma_zctor_args args;
|
struct uma_zctor_args args;
|
||||||
uma_keg_t keg;
|
uma_keg_t keg;
|
||||||
uma_zone_t res;
|
uma_zone_t res;
|
||||||
|
|
||||||
keg = master->uz_keg;
|
keg = primary->uz_keg;
|
||||||
memset(&args, 0, sizeof(args));
|
memset(&args, 0, sizeof(args));
|
||||||
args.name = name;
|
args.name = name;
|
||||||
args.size = keg->uk_size;
|
args.size = keg->uk_size;
|
||||||
|
@ -97,8 +97,8 @@
|
|||||||
* safely only from their associated CPU, while the Zones backed by the same
|
* safely only from their associated CPU, while the Zones backed by the same
|
||||||
* Keg all share a common Keg lock (to coalesce contention on the backing
|
* Keg all share a common Keg lock (to coalesce contention on the backing
|
||||||
* slabs). The backing Keg typically only serves one Zone but in the case of
|
* slabs). The backing Keg typically only serves one Zone but in the case of
|
||||||
* multiple Zones, one of the Zones is considered the Master Zone and all
|
* multiple Zones, one of the Zones is considered the Primary Zone and all
|
||||||
* Zone-related stats from the Keg are done in the Master Zone. For an
|
* Zone-related stats from the Keg are done in the Primary Zone. For an
|
||||||
* example of a Multi-Zone setup, refer to the Mbuf allocation code.
|
* example of a Multi-Zone setup, refer to the Mbuf allocation code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user