summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/gfp.h2
-rw-r--r--include/linux/page-flags.h10
2 files changed, 9 insertions, 3 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 939f16910233..c340b447a963 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -86,4 +86,6 @@ extern void FASTCALL(free_pages(unsigned long addr, unsigned int order));
#define __free_page(page) __free_pages((page), 0)
#define free_page(addr) free_pages((addr),0)
+void page_alloc_init(void);
+
#endif /* __LINUX_GFP_H */
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 5c770f49787a..282902bb9816 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -5,6 +5,8 @@
#ifndef PAGE_FLAGS_H
#define PAGE_FLAGS_H
+#include <linux/percpu.h>
+
/*
* Various page->flags bits:
*
@@ -73,7 +75,7 @@
* Global page accounting. One instance per CPU. Only unsigned longs are
* allowed.
*/
-extern struct page_state {
+struct page_state {
unsigned long nr_dirty;
unsigned long nr_writeback;
unsigned long nr_pagecache;
@@ -103,7 +105,9 @@ extern struct page_state {
unsigned long kswapd_steal;
unsigned long pageoutrun;
unsigned long allocstall;
-} ____cacheline_aligned_in_smp page_states[NR_CPUS];
+};
+
+DECLARE_PER_CPU(struct page_state, page_states);
extern void get_page_state(struct page_state *ret);
extern void get_full_page_state(struct page_state *ret);
@@ -111,7 +115,7 @@ extern void get_full_page_state(struct page_state *ret);
#define mod_page_state(member, delta) \
do { \
int cpu = get_cpu(); \
- page_states[cpu].member += (delta); \
+ per_cpu(page_states, cpu).member += (delta); \
put_cpu(); \
} while (0)