@@ -938,12 +938,6 @@ static inline void mod_memcg_page_state(struct page *page,
unsigned long __memcg_page_state(struct mem_cgroup *memcg, int idx, bool local);
-/* idx can be of type enum memcg_stat_item or node_stat_item. */
-static inline unsigned long memcg_page_state_local(struct mem_cgroup *memcg, int idx)
-{
- return __memcg_page_state(memcg, idx, true);
-}
-
static inline unsigned long memcg_page_state(struct mem_cgroup *memcg, int idx)
{
return __memcg_page_state(memcg, idx, false);
@@ -106,6 +106,23 @@ static struct lockdep_map memcg_oom_lock_dep_map = {
DEFINE_SPINLOCK(memcg_oom_lock);
+static unsigned long memcg_events_local(struct mem_cgroup *memcg, int event)
+{
+ return __memcg_events(memcg, event, true);
+}
+
+/* idx can be of type enum memcg_stat_item or node_stat_item. */
+static unsigned long memcg_page_state_local(struct mem_cgroup *memcg, int idx)
+{
+ return __memcg_page_state(memcg, idx, true);
+}
+
+static unsigned long memcg_page_state_local_output(struct mem_cgroup *memcg, int item)
+{
+ return memcg_page_state_local(memcg, item) *
+ memcg_page_state_output_unit(item);
+}
+
static void __mem_cgroup_insert_exceeded(struct mem_cgroup_per_node *mz,
struct mem_cgroup_tree_per_node *mctz,
unsigned long new_usage_in_excess)
@@ -65,13 +65,8 @@ static inline unsigned long memcg_events(struct mem_cgroup *memcg, int event)
return __memcg_events(memcg, event, false);
}
-static inline unsigned long memcg_events_local(struct mem_cgroup *memcg, int event)
-{
- return __memcg_events(memcg, event, true);
-}
-
+int memcg_page_state_output_unit(int item);
unsigned long memcg_page_state_output(struct mem_cgroup *memcg, int item);
-unsigned long memcg_page_state_local_output(struct mem_cgroup *memcg, int item);
int memory_stat_show(struct seq_file *m, void *v);
/* Cgroup v1-specific declarations */
@@ -1367,7 +1367,7 @@ static int memcg_page_state_unit(int item)
}
/* Translate stat items to the correct unit for memory.stat output */
-static int memcg_page_state_output_unit(int item)
+int memcg_page_state_output_unit(int item)
{
/*
* Workingset state is actually in pages, but we export it to userspace
@@ -1402,12 +1402,6 @@ unsigned long memcg_page_state_output(struct mem_cgroup *memcg, int item)
memcg_page_state_output_unit(item);
}
-unsigned long memcg_page_state_local_output(struct mem_cgroup *memcg, int item)
-{
- return memcg_page_state_local(memcg, item) *
- memcg_page_state_output_unit(item);
-}
-
#ifdef CONFIG_HUGETLB_PAGE
static bool memcg_accounts_hugetlb(void)
{