aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNick Piggin <nickpiggin@yahoo.com.au>2006-01-06 00:11:21 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 08:33:29 -0800
commitb09eb1c06a14641209e6b86e9a5b28ea8287f193 (patch)
tree1a3adbf25c05d7f6a585331260c2cdd7287e8c36 /include
parent[PATCH] mm: page_state opt (diff)
downloadlinux-dev-b09eb1c06a14641209e6b86e9a5b28ea8287f193.tar.xz
linux-dev-b09eb1c06a14641209e6b86e9a5b28ea8287f193.zip
[PATCH] mm: page_state opt docs
Comment the new locking rules for page_state statistics. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/page-flags.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index dede8d412dca..d52999c43336 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -79,13 +79,23 @@
/*
* Global page accounting. One instance per CPU. Only unsigned longs are
* allowed.
+ *
+ * - Fields can be modified with xxx_page_state and xxx_page_state_zone at
+ * any time safely (which protects the instance from modification by
+ * interrupt.
+ * - The __xxx_page_state variants can be used safely when interrupts are
+ * disabled.
+ * - The __xxx_page_state variants can be used if the field is only
+ * modified from process context, or only modified from interrupt context.
+ * In this case, the field should be commented here.
*/
struct page_state {
unsigned long nr_dirty; /* Dirty writeable pages */
unsigned long nr_writeback; /* Pages under writeback */
unsigned long nr_unstable; /* NFS unstable pages */
unsigned long nr_page_table_pages;/* Pages used for pagetables */
- unsigned long nr_mapped; /* mapped into pagetables */
+ unsigned long nr_mapped; /* mapped into pagetables.
+ * only modified from process context */
unsigned long nr_slab; /* In slab */
#define GET_PAGE_STATE_LAST nr_slab