diff options
author | jeff <jeff@FreeBSD.org> | 2002-04-29 23:45:41 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-04-29 23:45:41 +0000 |
commit | c52db1bfdfb3a9e4065f735384e8e23dd29a14c0 (patch) | |
tree | 6dec1f923097576eb3f5e981d5d602bbff1c0b68 /sys/vm/uma_int.h | |
parent | 1b161ee22037718913e8fcbbd1e19c367713e1b7 (diff) | |
download | FreeBSD-src-c52db1bfdfb3a9e4065f735384e8e23dd29a14c0.zip FreeBSD-src-c52db1bfdfb3a9e4065f735384e8e23dd29a14c0.tar.gz |
Add a new zone flag UMA_ZONE_MTXCLASS. This puts the zone in it's own
mutex class. Currently this is only used for kmapentzone because kmapents
are are potentially allocated when freeing memory. This is not dangerous
though because no other allocations will be done while holding the
kmapentzone lock.
Diffstat (limited to 'sys/vm/uma_int.h')
-rw-r--r-- | sys/vm/uma_int.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/sys/vm/uma_int.h b/sys/vm/uma_int.h index 3190bb8..d7c86bb 100644 --- a/sys/vm/uma_int.h +++ b/sys/vm/uma_int.h @@ -284,16 +284,31 @@ void uma_large_free(uma_slab_t slab); /* Lock Macros */ -#define ZONE_LOCK_INIT(z) \ - mtx_init(&(z)->uz_lock, (z)->uz_name, "UMA zone", \ - MTX_DEF | MTX_DUPOK) +#define ZONE_LOCK_INIT(z, lc) \ + do { \ + if ((lc)) \ + mtx_init(&(z)->uz_lock, (z)->uz_name, \ + (z)->uz_name, MTX_DEF | MTX_DUPOK); \ + else \ + mtx_init(&(z)->uz_lock, (z)->uz_name, \ + "UMA zone", MTX_DEF | MTX_DUPOK); \ + } while (0) + #define ZONE_LOCK_FINI(z) mtx_destroy(&(z)->uz_lock) #define ZONE_LOCK(z) mtx_lock(&(z)->uz_lock) #define ZONE_UNLOCK(z) mtx_unlock(&(z)->uz_lock) -#define CPU_LOCK_INIT(z, cpu) \ - mtx_init(&(z)->uz_cpu[(cpu)].uc_lock, (z)->uz_lname, "UMA cpu", \ - MTX_DEF | MTX_DUPOK) +#define CPU_LOCK_INIT(z, cpu, lc) \ + do { \ + if ((lc)) \ + mtx_init(&(z)->uz_cpu[(cpu)].uc_lock, \ + (z)->uz_lname, (z)->uz_lname, \ + MTX_DEF | MTX_DUPOK); \ + else \ + mtx_init(&(z)->uz_cpu[(cpu)].uc_lock, \ + (z)->uz_lname, "UMA cpu", \ + MTX_DEF | MTX_DUPOK); \ + } while (0) #define CPU_LOCK_FINI(z, cpu) \ mtx_destroy(&(z)->uz_cpu[(cpu)].uc_lock) |