aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/vmstat.h4
-rw-r--r--mm/vmstat.c14
2 files changed, 0 insertions, 18 deletions
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 5b5b96afc395..5fad1613e7d6 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -70,13 +70,9 @@ struct page_state {
70}; 70};
71 71
72extern void get_full_page_state(struct page_state *ret); 72extern void get_full_page_state(struct page_state *ret);
73extern unsigned long read_page_state_offset(unsigned long offset);
74extern void mod_page_state_offset(unsigned long offset, unsigned long delta); 73extern void mod_page_state_offset(unsigned long offset, unsigned long delta);
75extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); 74extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
76 75
77#define read_page_state(member) \
78 read_page_state_offset(offsetof(struct page_state, member))
79
80#define mod_page_state(member, delta) \ 76#define mod_page_state(member, delta) \
81 mod_page_state_offset(offsetof(struct page_state, member), (delta)) 77 mod_page_state_offset(offsetof(struct page_state, member), (delta))
82 78
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 25e5ca7c1743..06a6d1052198 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -52,20 +52,6 @@ void get_full_page_state(struct page_state *ret)
52 __get_page_state(ret, sizeof(*ret) / sizeof(unsigned long), &mask); 52 __get_page_state(ret, sizeof(*ret) / sizeof(unsigned long), &mask);
53} 53}
54 54
55unsigned long read_page_state_offset(unsigned long offset)
56{
57 unsigned long ret = 0;
58 int cpu;
59
60 for_each_online_cpu(cpu) {
61 unsigned long in;
62
63 in = (unsigned long)&per_cpu(page_states, cpu) + offset;
64 ret += *((unsigned long *)in);
65 }
66 return ret;
67}
68
69void __mod_page_state_offset(unsigned long offset, unsigned long delta) 55void __mod_page_state_offset(unsigned long offset, unsigned long delta)
70{ 56{
71 void *ptr; 57 void *ptr;