Commit 91fc8ab3 authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Linus Torvalds

[PATCH] page flags: add commentry regarding field reservation

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: default avatarAndy Whitcroft <apw@shadowen.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d5ddc79b
...@@ -48,8 +48,20 @@ ...@@ -48,8 +48,20 @@
/* /*
* Don't use the *_dontuse flags. Use the macros. Otherwise you'll break * 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 * locked- and dirty-page accounting.
* used for page->zone, so putting flag bits there doesn't work. *
* 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_locked 0 /* Page is locked. Don't touch. */
#define PG_error 1 #define PG_error 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment