[PATCH] page flags: add commentry regarding field reservation
authorAndy Whitcroft <apw@shadowen.org>
Tue, 11 Apr 2006 05:53:01 +0000 (22:53 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 11 Apr 2006 13:18:32 +0000 (06:18 -0700)
Add some documentation regarding the utilisation of the flags field in
struct page.  This field is overloaded for per page bits and to hold node,
zone and SPARSEMEM information.  Make it clear which areas are used for
what and how many bits are in each area.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/page-flags.h

index 547aac7..d276a4e 100644 (file)
 
 /*
  * Don't use the *_dontuse flags.  Use the macros.  Otherwise you'll break
- * locked- and dirty-page accounting.  The top eight bits of page->flags are
- * used for page->zone, so putting flag bits there doesn't work.
+ * locked- and dirty-page accounting.
+ *
+ * The page flags field is split into two parts, the main flags area
+ * which extends from the low bits upwards, and the fields area which
+ * extends from the high bits downwards.
+ *
+ *  | FIELD | ... | FLAGS |
+ *  N-1     ^             0
+ *          (N-FLAGS_RESERVED)
+ *
+ * The fields area is reserved for fields mapping zone, node and SPARSEMEM
+ * section.  The boundry between these two areas is defined by
+ * FLAGS_RESERVED which defines the width of the fields section
+ * (see linux/mmzone.h).  New flags must _not_ overlap with this area.
  */
 #define PG_locked               0      /* Page is locked. Don't touch. */
 #define PG_error                1