diff options
author | jeff <jeff@FreeBSD.org> | 2003-09-19 08:37:44 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2003-09-19 08:37:44 +0000 |
commit | 30f275bb51052e65e8026d2e1d80eb711f88f029 (patch) | |
tree | 644475a574eabecce93510f93324e58118426825 /sys/vm/uma_int.h | |
parent | 758f95abc69f45ea012ea1848903bf92b5361f92 (diff) | |
download | FreeBSD-src-30f275bb51052e65e8026d2e1d80eb711f88f029.zip FreeBSD-src-30f275bb51052e65e8026d2e1d80eb711f88f029.tar.gz |
- Fix the silly flag situation in UMA. Remove redundant ZFLAG/ZONE flags
by accepting the user supplied flags directly. Previously this was not
done so that flags for the same field would not be defined in two
different files. Add comments in each header instructing future
developers on how now to shoot their feet.
- Fix a test for !OFFPAGE which should have been a test for HASH. This would
have caused a panic if we had ever destructed a malloc zone. This also
opens up the possibility that other zones could use the vsetobj() method
rather than a hash.
Diffstat (limited to 'sys/vm/uma_int.h')
-rw-r--r-- | sys/vm/uma_int.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/vm/uma_int.h b/sys/vm/uma_int.h index f7550a7..1c6bfae 100644 --- a/sys/vm/uma_int.h +++ b/sys/vm/uma_int.h @@ -247,17 +247,13 @@ struct uma_zone { #define UMA_CACHE_INC 16 /* How much will we move data */ -#define UMA_ZFLAG_OFFPAGE 0x0001 /* Struct slab/freelist off page */ -#define UMA_ZFLAG_PRIVALLOC 0x0002 /* Zone has supplied it's own alloc */ -#define UMA_ZFLAG_INTERNAL 0x0004 /* Internal zone, no offpage no PCPU */ -#define UMA_ZFLAG_MALLOC 0x0008 /* Zone created by malloc */ -#define UMA_ZFLAG_NOFREE 0x0010 /* Don't free data from this zone */ -#define UMA_ZFLAG_FULL 0x0020 /* This zone reached uz_maxpages */ -#define UMA_ZFLAG_CACHEONLY 0x0040 /* Don't go to VM to allocate internal objs */ -#define UMA_ZFLAG_HASH 0x0080 /* Look up slab via hash */ - -/* This lives in uflags */ -#define UMA_ZONE_INTERNAL 0x1000 /* Internal zone for uflags */ +/* + * These flags must not overlap with the UMA_ZONE flags specified in uma.h. + */ +#define UMA_ZFLAG_PRIVALLOC 0x1000 /* Use uz_allocf. */ +#define UMA_ZFLAG_INTERNAL 0x2000 /* No offpage no PCPU. */ +#define UMA_ZFLAG_FULL 0x4000 /* Reached uz_maxpages */ +#define UMA_ZFLAG_CACHEONLY 0x8000 /* Don't ask VM for buckets. */ /* Internal prototypes */ static __inline uma_slab_t hash_sfind(struct uma_hash *hash, u_int8_t *data); |