@@ -2494,43 +2494,43 @@ static ssize_t mem_cgroup_reset(struct kernfs_open_file *of, char *buf,
#define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON))
#define LRU_ALL ((1 << NR_LRU_LISTS) - 1)
-/* static unsigned long mem_cgroup_node_nr_lru_pages(struct mem_cgroup *memcg, */
-/* int nid, unsigned int lru_mask, bool tree) */
-/* { */
-/* struct lruvec *lruvec = mem_cgroup_lruvec(memcg, NODE_DATA(nid)); */
-/* unsigned long nr = 0; */
-/* enum lru_list lru; */
-
-/* VM_BUG_ON((unsigned)nid >= nr_node_ids); */
-
-/* for_each_lru(lru) { */
-/* if (!(BIT(lru) & lru_mask)) */
-/* continue; */
-/* if (tree) */
-/* nr += lruvec_page_state(lruvec, NR_LRU_BASE + lru); */
-/* else */
-/* nr += lruvec_page_state_local(lruvec, NR_LRU_BASE + lru); */
-/* } */
-/* return nr; */
-/* } */
-
-/* static unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg, */
-/* unsigned int lru_mask, */
-/* bool tree) */
-/* { */
-/* unsigned long nr = 0; */
-/* enum lru_list lru; */
-
-/* for_each_lru(lru) { */
-/* if (!(BIT(lru) & lru_mask)) */
-/* continue; */
-/* if (tree) */
-/* nr += memcg_page_state(memcg, NR_LRU_BASE + lru); */
-/* else */
-/* nr += memcg_page_state_local(memcg, NR_LRU_BASE + lru); */
-/* } */
-/* return nr; */
-/* } */
+static unsigned long mem_cgroup_node_nr_lru_pages(struct mem_cgroup *memcg,
+ int nid, unsigned int lru_mask, bool tree)
+{
+ struct lruvec *lruvec = mem_cgroup_lruvec(memcg, NODE_DATA(nid));
+ unsigned long nr = 0;
+ enum lru_list lru;
+
+ VM_BUG_ON((unsigned)nid >= nr_node_ids);
+
+ for_each_lru(lru) {
+ if (!(BIT(lru) & lru_mask))
+ continue;
+ if (tree)
+ nr += lruvec_page_state(lruvec, NR_LRU_BASE + lru);
+ else
+ nr += lruvec_page_state_local(lruvec, NR_LRU_BASE + lru);
+ }
+ return nr;
+}
+
+static unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,
+ unsigned int lru_mask,
+ bool tree)
+{
+ unsigned long nr = 0;
+ enum lru_list lru;
+
+ for_each_lru(lru) {
+ if (!(BIT(lru) & lru_mask))
+ continue;
+ if (tree)
+ nr += memcg_page_state(memcg, NR_LRU_BASE + lru);
+ else
+ nr += memcg_page_state_local(memcg, NR_LRU_BASE + lru);
+ }
+ return nr;
+}
static int memcg_numa_stat_show(struct seq_file *m, void *v)
{
@@ -88,11 +88,6 @@ void memcg1_oom_finish(struct mem_cgroup *memcg, bool locked);
void memcg1_oom_recover(struct mem_cgroup *memcg);
void drain_all_stock(struct mem_cgroup *root_memcg);
-unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,
- unsigned int lru_mask, bool tree);
-unsigned long mem_cgroup_node_nr_lru_pages(struct mem_cgroup *memcg,
- int nid, unsigned int lru_mask,
- bool tree);
unsigned long memcg_events(struct mem_cgroup *memcg, int event);
unsigned long memcg_events_local(struct mem_cgroup *memcg, int event);
@@ -3188,44 +3188,6 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg)
}
#endif /* CONFIG_MEMCG_KMEM */
-unsigned long mem_cgroup_node_nr_lru_pages(struct mem_cgroup *memcg,
- int nid, unsigned int lru_mask,
- bool tree)
-{
- struct lruvec *lruvec = mem_cgroup_lruvec(memcg, NODE_DATA(nid));
- unsigned long nr = 0;
- enum lru_list lru;
-
- VM_BUG_ON((unsigned)nid >= nr_node_ids);
-
- for_each_lru(lru) {
- if (!(BIT(lru) & lru_mask))
- continue;
- if (tree)
- nr += lruvec_page_state(lruvec, NR_LRU_BASE + lru);
- else
- nr += lruvec_page_state_local(lruvec, NR_LRU_BASE + lru);
- }
- return nr;
-}
-
-unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,
- unsigned int lru_mask, bool tree)
-{
- unsigned long nr = 0;
- enum lru_list lru;
-
- for_each_lru(lru) {
- if (!(BIT(lru) & lru_mask))
- continue;
- if (tree)
- nr += memcg_page_state(memcg, NR_LRU_BASE + lru);
- else
- nr += memcg_page_state_local(memcg, NR_LRU_BASE + lru);
- }
- return nr;
-}
-
#ifdef CONFIG_CGROUP_WRITEBACK
#include <trace/events/writeback.h>
This is a small fixup for the commit "mm: memcg: move cgroup v1 oom handling code into memcontrol-v1.c". I forgot to actually move two functions mem_cgroup_node_nr_lru_pages() and mem_cgroup_nr_lru_pages() into mm/memcontrol-v1.c, so that they remain in mm/memcontrol.c and their commented out duplicated versions in mm/memcontrol-v1.c. Andrew, can you, please, squash it into the original commit? I checked that the rest of mm-unstable tree can be rebased automatically without any merge conflicts. Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev> --- mm/memcontrol-v1.c | 74 +++++++++++++++++++++++----------------------- mm/memcontrol-v1.h | 5 ---- mm/memcontrol.c | 38 ------------------------ 3 files changed, 37 insertions(+), 80 deletions(-)