diff options
author | jeff <jeff@FreeBSD.org> | 2009-01-25 09:11:24 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2009-01-25 09:11:24 +0000 |
commit | 69d1bd86702d1d3505e941e98bc5f72403790a22 (patch) | |
tree | 816ddb03fae2b243e6596d085b68de89f1198131 /sys/vm/uma.h | |
parent | ce1034ac575d9a536351843e5fa3ac3d26a2a766 (diff) | |
download | FreeBSD-src-69d1bd86702d1d3505e941e98bc5f72403790a22.zip FreeBSD-src-69d1bd86702d1d3505e941e98bc5f72403790a22.tar.gz |
- Make the keg abstraction more complete. Permit a zone to have multiple
backend kegs so it may source compatible memory from multiple backends.
This is useful for cases such as NUMA or different layouts for the same
memory type.
- Provide a new api for adding new backend kegs to secondary zones.
- Provide a new flag for adjusting the layout of zones to stagger
allocations better across cache lines.
Sponsored by: Nokia
Diffstat (limited to 'sys/vm/uma.h')
-rw-r--r-- | sys/vm/uma.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 81f08d8..c044824 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -205,6 +205,17 @@ uma_zone_t uma_zsecond_create(char *name, uma_ctor ctor, uma_dtor dtor, uma_init zinit, uma_fini zfini, uma_zone_t master); /* + * Add a second master to a secondary zone. This provides multiple data + * backends for objects with the same size. Both masters must have + * compatible allocation flags. Presently, UMA_ZONE_MALLOC type zones are + * the only supported. + * + * Returns: + * Error on failure, 0 on success. + */ +int uma_zsecond_add(uma_zone_t zone, uma_zone_t master); + +/* * Definitions for uma_zcreate flags * * These flags share space with UMA_ZFLAGs in uma_int.h. Be careful not to @@ -230,6 +241,22 @@ uma_zone_t uma_zsecond_create(char *name, uma_ctor ctor, uma_dtor dtor, #define UMA_ZONE_SECONDARY 0x0200 /* Zone is a Secondary Zone */ #define UMA_ZONE_REFCNT 0x0400 /* Allocate refcnts in slabs */ #define UMA_ZONE_MAXBUCKET 0x0800 /* Use largest buckets */ +#define UMA_ZONE_CACHESPREAD 0x1000 /* + * Spread memory start locations across + * all possible cache lines. May + * require many virtually contiguous + * backend pages and can fail early. + */ +#define UMA_ZONE_VTOSLAB 0x2000 /* Zone uses vtoslab for lookup. */ + +/* + * These flags are shared between the keg and zone. In zones wishing to add + * new kegs these flags must be compatible. Some are determined based on + * physical parameters of the request and may not be provided by the consumer. + */ +#define UMA_ZONE_INHERIT \ + (UMA_ZONE_OFFPAGE | UMA_ZONE_MALLOC | UMA_ZONE_HASH | \ + UMA_ZONE_REFCNT | UMA_ZONE_VTOSLAB) /* Definitions for align */ #define UMA_ALIGN_PTR (sizeof(void *) - 1) /* Alignment fit for ptr */ |