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.
This commit is contained in:
Matt Jacob 2002-11-10 16:16:44 +00:00
parent 4b8dd6b2d0
commit 7ca05a39c7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106733

View File

@ -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);
}