summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2010-10-21 17:29:32 +0000
committerjhb <jhb@FreeBSD.org>2010-10-21 17:29:32 +0000
commit2d6ab8853a286164be8e70da0268b3599ccaa0d3 (patch)
treecf57ca3486d101a83bf6249dd02ff5ba997700e7 /sys/vm/vm_map.h
parent24f2e3e95977a97fcfdb49f610bab77d3e6fceb9 (diff)
downloadFreeBSD-src-2d6ab8853a286164be8e70da0268b3599ccaa0d3.zip
FreeBSD-src-2d6ab8853a286164be8e70da0268b3599ccaa0d3.tar.gz
- Make 'vm_refcnt' volatile so that compilers won't be tempted to treat
its value as a loop invariant. Currently this is a no-op because 'atomic_cmpset_int()' clobbers all memory on current architectures. - Use atomic_fetchadd_int() instead of an atomic_cmpset_int() loop to drop a reference in vmspace_free(). Reviewed by: alc MFC after: 1 month
Diffstat (limited to 'sys/vm/vm_map.h')
-rw-r--r--sys/vm/vm_map.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h
index 18a1edf..8715b41 100644
--- a/sys/vm/vm_map.h
+++ b/sys/vm/vm_map.h
@@ -236,7 +236,7 @@ struct vmspace {
caddr_t vm_taddr; /* (c) user virtual address of text */
caddr_t vm_daddr; /* (c) user virtual address of data */
caddr_t vm_maxsaddr; /* user VA at max stack growth */
- int vm_refcnt; /* number of references */
+ volatile int vm_refcnt; /* number of references */
/*
* Keep the PMAP last, so that CPU-specific variations of that
* structure on a single architecture don't result in offset
OpenPOWER on IntegriCloud