Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: page_cgroup: rename file to mm/swap_cgroup.c

Now that the external page_cgroup data structure and its lookup is gone,
the only code remaining in there is swap slot accounting.

Rename it and move the conditional compilation into mm/Makefile.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Tejun Heo <tj@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Johannes Weiner and committed by
Linus Torvalds
5d1ea48b 1306a85a

+13 -14
+1 -1
MAINTAINERS
··· 2606 2606 L: linux-mm@kvack.org 2607 2607 S: Maintained 2608 2608 F: mm/memcontrol.c 2609 - F: mm/page_cgroup.c 2609 + F: mm/swap_cgroup.c 2610 2610 2611 2611 CORETEMP HARDWARE MONITORING DRIVER 2612 2612 M: Fenghua Yu <fenghua.yu@intel.com>
+5 -3
include/linux/page_cgroup.h include/linux/swap_cgroup.h
··· 1 - #ifndef __LINUX_PAGE_CGROUP_H 2 - #define __LINUX_PAGE_CGROUP_H 1 + #ifndef __LINUX_SWAP_CGROUP_H 2 + #define __LINUX_SWAP_CGROUP_H 3 3 4 4 #include <linux/swap.h> 5 5 6 6 #ifdef CONFIG_MEMCG_SWAP 7 + 7 8 extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, 8 9 unsigned short old, unsigned short new); 9 10 extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); 10 11 extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent); 11 12 extern int swap_cgroup_swapon(int type, unsigned long max_pages); 12 13 extern void swap_cgroup_swapoff(int type); 14 + 13 15 #else 14 16 15 17 static inline ··· 39 37 40 38 #endif /* CONFIG_MEMCG_SWAP */ 41 39 42 - #endif /* __LINUX_PAGE_CGROUP_H */ 40 + #endif /* __LINUX_SWAP_CGROUP_H */
+2 -1
mm/Makefile
··· 56 56 obj-$(CONFIG_QUICKLIST) += quicklist.o 57 57 obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o 58 58 obj-$(CONFIG_PAGE_COUNTER) += page_counter.o 59 - obj-$(CONFIG_MEMCG) += memcontrol.o page_cgroup.o vmpressure.o 59 + obj-$(CONFIG_MEMCG) += memcontrol.o vmpressure.o 60 + obj-$(CONFIG_MEMCG_SWAP) += swap_cgroup.o 60 61 obj-$(CONFIG_CGROUP_HUGETLB) += hugetlb_cgroup.o 61 62 obj-$(CONFIG_MEMORY_FAILURE) += memory-failure.o 62 63 obj-$(CONFIG_HWPOISON_INJECT) += hwpoison-inject.o
+1 -1
mm/memcontrol.c
··· 51 51 #include <linux/seq_file.h> 52 52 #include <linux/vmpressure.h> 53 53 #include <linux/mm_inline.h> 54 - #include <linux/page_cgroup.h> 54 + #include <linux/swap_cgroup.h> 55 55 #include <linux/cpu.h> 56 56 #include <linux/oom.h> 57 57 #include <linux/lockdep.h>
+3 -6
mm/page_cgroup.c mm/swap_cgroup.c
··· 1 - #include <linux/mm.h> 2 - #include <linux/page_cgroup.h> 1 + #include <linux/swap_cgroup.h> 3 2 #include <linux/vmalloc.h> 4 - #include <linux/swapops.h> 3 + #include <linux/mm.h> 5 4 6 - #ifdef CONFIG_MEMCG_SWAP 5 + #include <linux/swapops.h> /* depends on mm.h include */ 7 6 8 7 static DEFINE_MUTEX(swap_cgroup_mutex); 9 8 struct swap_cgroup_ctrl { ··· 206 207 vfree(map); 207 208 } 208 209 } 209 - 210 - #endif
-1
mm/swap_state.c
··· 17 17 #include <linux/blkdev.h> 18 18 #include <linux/pagevec.h> 19 19 #include <linux/migrate.h> 20 - #include <linux/page_cgroup.h> 21 20 22 21 #include <asm/pgtable.h> 23 22
+1 -1
mm/swapfile.c
··· 38 38 #include <asm/pgtable.h> 39 39 #include <asm/tlbflush.h> 40 40 #include <linux/swapops.h> 41 - #include <linux/page_cgroup.h> 41 + #include <linux/swap_cgroup.h> 42 42 43 43 static bool swap_count_continued(struct swap_info_struct *, pgoff_t, 44 44 unsigned char);