Zones are described by a struct zone_t. It keeps track of information like page usage statistics, free area information and locks. It is declared as follows in include/linux/mmzone.h
37 typedef struct zone_struct {
41 spinlock_t lock;
42 unsigned long free_pages;
43 unsigned long pages_min, pages_low, pages_high;
44 int need_balance;
45
49 free_area_t free_area[MAX_ORDER];
50
76 wait_queue_head_t * wait_table;
77 unsigned long wait_table_size;
78 unsigned long wait_table_shift;
79
83 struct pglist_data *zone_pgdat;
84 struct page *zone_mem_map;
85 unsigned long zone_start_paddr;
86 unsigned long zone_start_mapnr;
87
91 char *name;
92 unsigned long size;
93 } zone_t;
When available memory in the system is low, the pageout daemon kswapd is woken up to start freeing up pages (See Chapter 11). If memory gets too low, the process will free up memory synchronously. The parameters affecting pageout behavior are similar to those by FreeBSD[#!mckusick96!#] and Solaris[#!mauro01!#].
Each zone has watermarks which help track how much pressure a zone
is under. They are pages_low, pages_min and
pages_high. The number of pages for pages_min is
calculated in the function free_area_init_core() during memory
init and is based on a ratio to the size of the zone in pages. It is calculated
initially as
. The lowest value it will be is 20 pages
(80K on a x86) and the highest possible value is 255 pages (1MiB on a x86).
Whatever the pageout parameters are called in each operating system, the meaning is the same, it helps determine how hard the pageout daemon or processes work to free up pages.