aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/mm/pgtable.c5
-rw-r--r--drivers/base/node.c5
-rw-r--r--fs/proc/proc_misc.c2
-rw-r--r--include/linux/mmzone.h1
-rw-r--r--include/linux/page-flags.h8
-rw-r--r--include/linux/vmstat.h1
-rw-r--r--mm/page-writeback.c2
-rw-r--r--mm/page_alloc.c2
-rw-r--r--mm/vmstat.c2
9 files changed, 12 insertions, 16 deletions
diff --git a/arch/i386/mm/pgtable.c b/arch/i386/mm/pgtable.c
index aa211dcddb08..5e735ff90e8a 100644
--- a/arch/i386/mm/pgtable.c
+++ b/arch/i386/mm/pgtable.c
@@ -30,7 +30,6 @@ void show_mem(void)
30 struct page *page; 30 struct page *page;
31 pg_data_t *pgdat; 31 pg_data_t *pgdat;
32 unsigned long i; 32 unsigned long i;
33 struct page_state ps;
34 unsigned long flags; 33 unsigned long flags;
35 34
36 printk(KERN_INFO "Mem-info:\n"); 35 printk(KERN_INFO "Mem-info:\n");
@@ -58,9 +57,9 @@ void show_mem(void)
58 printk(KERN_INFO "%d pages shared\n", shared); 57 printk(KERN_INFO "%d pages shared\n", shared);
59 printk(KERN_INFO "%d pages swap cached\n", cached); 58 printk(KERN_INFO "%d pages swap cached\n", cached);
60 59
61 get_page_state(&ps);
62 printk(KERN_INFO "%lu pages dirty\n", global_page_state(NR_FILE_DIRTY)); 60 printk(KERN_INFO "%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
63 printk(KERN_INFO "%lu pages writeback\n", ps.nr_writeback); 61 printk(KERN_INFO "%lu pages writeback\n",
62 global_page_state(NR_WRITEBACK));
64 printk(KERN_INFO "%lu pages mapped\n", global_page_state(NR_FILE_MAPPED)); 63 printk(KERN_INFO "%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
65 printk(KERN_INFO "%lu pages slab\n", global_page_state(NR_SLAB)); 64 printk(KERN_INFO "%lu pages slab\n", global_page_state(NR_SLAB));
66 printk(KERN_INFO "%lu pages pagetables\n", 65 printk(KERN_INFO "%lu pages pagetables\n",
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 6fed520d00f4..a7b3dcbbdfc9 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -49,9 +49,6 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
49 get_page_state_node(&ps, nid); 49 get_page_state_node(&ps, nid);
50 __get_zone_counts(&active, &inactive, &free, NODE_DATA(nid)); 50 __get_zone_counts(&active, &inactive, &free, NODE_DATA(nid));
51 51
52 /* Check for negative values in these approximate counters */
53 if ((long)ps.nr_writeback < 0)
54 ps.nr_writeback = 0;
55 52
56 n = sprintf(buf, "\n" 53 n = sprintf(buf, "\n"
57 "Node %d MemTotal: %8lu kB\n" 54 "Node %d MemTotal: %8lu kB\n"
@@ -80,7 +77,7 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
80 nid, K(i.totalram - i.totalhigh), 77 nid, K(i.totalram - i.totalhigh),
81 nid, K(i.freeram - i.freehigh), 78 nid, K(i.freeram - i.freehigh),
82 nid, K(node_page_state(nid, NR_FILE_DIRTY)), 79 nid, K(node_page_state(nid, NR_FILE_DIRTY)),
83 nid, K(ps.nr_writeback), 80 nid, K(node_page_state(nid, NR_WRITEBACK)),
84 nid, K(node_page_state(nid, NR_FILE_PAGES)), 81 nid, K(node_page_state(nid, NR_FILE_PAGES)),
85 nid, K(node_page_state(nid, NR_FILE_MAPPED)), 82 nid, K(node_page_state(nid, NR_FILE_MAPPED)),
86 nid, K(node_page_state(nid, NR_ANON_PAGES)), 83 nid, K(node_page_state(nid, NR_ANON_PAGES)),
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index e23717dec3c1..48cb35862445 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -191,7 +191,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
191 K(i.totalswap), 191 K(i.totalswap),
192 K(i.freeswap), 192 K(i.freeswap),
193 K(global_page_state(NR_FILE_DIRTY)), 193 K(global_page_state(NR_FILE_DIRTY)),
194 K(ps.nr_writeback), 194 K(global_page_state(NR_WRITEBACK)),
195 K(global_page_state(NR_ANON_PAGES)), 195 K(global_page_state(NR_ANON_PAGES)),
196 K(global_page_state(NR_FILE_MAPPED)), 196 K(global_page_state(NR_FILE_MAPPED)),
197 K(global_page_state(NR_SLAB)), 197 K(global_page_state(NR_SLAB)),
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 1cc8412ac264..885cc9727001 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -54,6 +54,7 @@ enum zone_stat_item {
54 NR_SLAB, /* Pages used by slab allocator */ 54 NR_SLAB, /* Pages used by slab allocator */
55 NR_PAGETABLE, /* used for pagetables */ 55 NR_PAGETABLE, /* used for pagetables */
56 NR_FILE_DIRTY, 56 NR_FILE_DIRTY,
57 NR_WRITEBACK,
57 NR_VM_ZONE_STAT_ITEMS }; 58 NR_VM_ZONE_STAT_ITEMS };
58 59
59struct per_cpu_pages { 60struct per_cpu_pages {
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index ff235c4b79ea..5748642e9f36 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -181,7 +181,7 @@
181 do { \ 181 do { \
182 if (!test_and_set_bit(PG_writeback, \ 182 if (!test_and_set_bit(PG_writeback, \
183 &(page)->flags)) \ 183 &(page)->flags)) \
184 inc_page_state(nr_writeback); \ 184 inc_zone_page_state(page, NR_WRITEBACK); \
185 } while (0) 185 } while (0)
186#define TestSetPageWriteback(page) \ 186#define TestSetPageWriteback(page) \
187 ({ \ 187 ({ \
@@ -189,14 +189,14 @@
189 ret = test_and_set_bit(PG_writeback, \ 189 ret = test_and_set_bit(PG_writeback, \
190 &(page)->flags); \ 190 &(page)->flags); \
191 if (!ret) \ 191 if (!ret) \
192 inc_page_state(nr_writeback); \ 192 inc_zone_page_state(page, NR_WRITEBACK); \
193 ret; \ 193 ret; \
194 }) 194 })
195#define ClearPageWriteback(page) \ 195#define ClearPageWriteback(page) \
196 do { \ 196 do { \
197 if (test_and_clear_bit(PG_writeback, \ 197 if (test_and_clear_bit(PG_writeback, \
198 &(page)->flags)) \ 198 &(page)->flags)) \
199 dec_page_state(nr_writeback); \ 199 dec_zone_page_state(page, NR_WRITEBACK); \
200 } while (0) 200 } while (0)
201#define TestClearPageWriteback(page) \ 201#define TestClearPageWriteback(page) \
202 ({ \ 202 ({ \
@@ -204,7 +204,7 @@
204 ret = test_and_clear_bit(PG_writeback, \ 204 ret = test_and_clear_bit(PG_writeback, \
205 &(page)->flags); \ 205 &(page)->flags); \
206 if (ret) \ 206 if (ret) \
207 dec_page_state(nr_writeback); \ 207 dec_zone_page_state(page, NR_WRITEBACK); \
208 ret; \ 208 ret; \
209 }) 209 })
210 210
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index b323ea2c6260..60c2e0382ceb 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -22,7 +22,6 @@
22 * commented here. 22 * commented here.
23 */ 23 */
24struct page_state { 24struct page_state {
25 unsigned long nr_writeback; /* Pages under writeback */
26 unsigned long nr_unstable; /* NFS unstable pages */ 25 unsigned long nr_unstable; /* NFS unstable pages */
27#define GET_PAGE_STATE_LAST nr_unstable 26#define GET_PAGE_STATE_LAST nr_unstable
28 27
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index da8547830098..3cfdff4b1985 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -113,7 +113,7 @@ static void get_writeback_state(struct writeback_state *wbs)
113 wbs->nr_unstable = read_page_state(nr_unstable); 113 wbs->nr_unstable = read_page_state(nr_unstable);
114 wbs->nr_mapped = global_page_state(NR_FILE_MAPPED) + 114 wbs->nr_mapped = global_page_state(NR_FILE_MAPPED) +
115 global_page_state(NR_ANON_PAGES); 115 global_page_state(NR_ANON_PAGES);
116 wbs->nr_writeback = read_page_state(nr_writeback); 116 wbs->nr_writeback = global_page_state(NR_WRITEBACK);
117} 117}
118 118
119/* 119/*
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index c2b9aa4acc46..a12e894a8bca 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1315,7 +1315,7 @@ void show_free_areas(void)
1315 active, 1315 active,
1316 inactive, 1316 inactive,
1317 global_page_state(NR_FILE_DIRTY), 1317 global_page_state(NR_FILE_DIRTY),
1318 ps.nr_writeback, 1318 global_page_state(NR_WRITEBACK),
1319 ps.nr_unstable, 1319 ps.nr_unstable,
1320 nr_free_pages(), 1320 nr_free_pages(),
1321 global_page_state(NR_SLAB), 1321 global_page_state(NR_SLAB),
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 1982fb533a40..e84c7e520a1d 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -401,9 +401,9 @@ static char *vmstat_text[] = {
401 "nr_slab", 401 "nr_slab",
402 "nr_page_table_pages", 402 "nr_page_table_pages",
403 "nr_dirty", 403 "nr_dirty",
404 "nr_writeback",
404 405
405 /* Page state */ 406 /* Page state */
406 "nr_writeback",
407 "nr_unstable", 407 "nr_unstable",
408 408
409 "pgpgin", 409 "pgpgin",