summaryrefslogtreecommitdiffstats
path: root/sys/vm/uma_dbg.c
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2002-11-10 16:16:44 +0000
committermjacob <mjacob@FreeBSD.org>2002-11-10 16:16:44 +0000
commitd00e94bfc6ad609cc7e33749154f06f9f3c7d325 (patch)
tree90dbbf3448aec98fbc1da92f040e86f7f1cecadf /sys/vm/uma_dbg.c
parentc04706a1260c50515ae805da5efdc4cddfb973cb (diff)
downloadFreeBSD-src-d00e94bfc6ad609cc7e33749154f06f9f3c7d325.zip
FreeBSD-src-d00e94bfc6ad609cc7e33749154f06f9f3c7d325.tar.gz
Use atomic_set_8 on the us_freelist maps as they are not otherwise
protected. Furthermore, in some RISC architectures with no normal byte operations, the surrounding 3 bytes are also affected by the read-modify-write that has to occur.
Diffstat (limited to 'sys/vm/uma_dbg.c')
-rw-r--r--sys/vm/uma_dbg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/vm/uma_dbg.c b/sys/vm/uma_dbg.c
index cea5371..a1009e9 100644
--- a/sys/vm/uma_dbg.c
+++ b/sys/vm/uma_dbg.c
@@ -230,7 +230,7 @@ uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void *item)
freei = ((unsigned long)item - (unsigned long)slab->us_data)
/ zone->uz_rsize;
- slab->us_freelist[freei] = 255;
+ atomic_set_8(&slab->us_freelist[freei], 255);
return;
}
@@ -279,5 +279,5 @@ uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *item)
* Until then the count of valid slabs will make sure we don't
* accidentally follow this and assume it's a valid index.
*/
- slab->us_freelist[freei] = 0;
+ atomic_set_8(&slab->us_freelist[freei], 0);
}
OpenPOWER on IntegriCloud