summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_page.h
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2012-06-16 18:56:19 +0000
committeralc <alc@FreeBSD.org>2012-06-16 18:56:19 +0000
commit6eeaee04e4175a3faa0ce3f7778a3abce0d8d9a2 (patch)
treeebf0376a21131a0f41835773afe0ddda56d3efbe /sys/vm/vm_page.h
parentca31dfb2b475f8026e45a8b10673993068ebc000 (diff)
downloadFreeBSD-src-6eeaee04e4175a3faa0ce3f7778a3abce0d8d9a2.zip
FreeBSD-src-6eeaee04e4175a3faa0ce3f7778a3abce0d8d9a2.tar.gz
The page flag PGA_WRITEABLE is set and cleared exclusively by the pmap
layer, but it is read directly by the MI VM layer. This change introduces pmap_page_is_write_mapped() in order to completely encapsulate all direct access to PGA_WRITEABLE in the pmap layer. Aesthetics aside, I am making this change because amd64 will likely begin using an alternative method to track write mappings, and having pmap_page_is_write_mapped() in place allows me to make such a change without further modification to the MI VM layer. As an added bonus, tidy up some nearby comments concerning page flags. Reviewed by: kib MFC after: 6 weeks
Diffstat (limited to 'sys/vm/vm_page.h')
-rw-r--r--sys/vm/vm_page.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index 479c5bf..44fe235 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -237,20 +237,22 @@ extern struct vpglocks pa_lock[];
#endif
#define vm_page_queue_free_mtx vm_page_queue_free_lock.data
+
/*
* These are the flags defined for vm_page.
*
- * aflags are updated by atomic accesses. Use the vm_page_aflag_set()
+ * aflags are updated by atomic accesses. Use the vm_page_aflag_set()
* and vm_page_aflag_clear() functions to set and clear the flags.
*
* PGA_REFERENCED may be cleared only if the object containing the page is
- * locked.
+ * locked. It is set by both the MI and MD VM layers.
*
* PGA_WRITEABLE is set exclusively on managed pages by pmap_enter(). When it
- * does so, the page must be VPO_BUSY.
+ * does so, the page must be VPO_BUSY. The MI VM layer must never access this
+ * flag directly. Instead, it should call pmap_page_is_write_mapped().
*
* PGA_EXECUTABLE may be set by pmap routines, and indicates that a page has
- * at least one executable mapping. It is not consumed by the VM layer.
+ * at least one executable mapping. It is not consumed by the MI VM layer.
*/
#define PGA_WRITEABLE 0x01 /* page may be mapped writeable */
#define PGA_REFERENCED 0x02 /* page has been referenced */
@@ -262,12 +264,12 @@ extern struct vpglocks pa_lock[];
*/
#define PG_CACHED 0x01 /* page is cached */
#define PG_FREE 0x02 /* page is free */
-#define PG_FICTITIOUS 0x04 /* physical page doesn't exist (O) */
+#define PG_FICTITIOUS 0x04 /* physical page doesn't exist */
#define PG_ZERO 0x08 /* page is zeroed */
#define PG_MARKER 0x10 /* special queue marker page */
#define PG_SLAB 0x20 /* object pointer is actually a slab */
#define PG_WINATCFLS 0x40 /* flush dirty page on inactive q */
-#define PG_NODUMP 0x80 /* don't include this page in the dump */
+#define PG_NODUMP 0x80 /* don't include this page in a dump */
/*
* Misc constants.
OpenPOWER on IntegriCloud