diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2014-12-10 18:44:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 20:41:09 -0500 |
commit | 5d1ea48bdde67898e87d6d8f511fd097fa64c749 (patch) | |
tree | 2936b8ed4b948ffdf655fd7b8fa71d68069f8bc4 | |
parent | 1306a85aed3ec3db98945aafb7dfbe5648a1203c (diff) |
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>
-rw-r--r-- | MAINTAINERS | 2 | ||||
-rw-r--r-- | include/linux/swap_cgroup.h (renamed from include/linux/page_cgroup.h) | 8 | ||||
-rw-r--r-- | mm/Makefile | 3 | ||||
-rw-r--r-- | mm/memcontrol.c | 2 | ||||
-rw-r--r-- | mm/swap_cgroup.c (renamed from mm/page_cgroup.c) | 9 | ||||
-rw-r--r-- | mm/swap_state.c | 1 | ||||
-rw-r--r-- | mm/swapfile.c | 2 |
7 files changed, 13 insertions, 14 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 0d6469a2cf70..0aedd3e1804b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -2606,7 +2606,7 @@ L: cgroups@vger.kernel.org | |||
2606 | L: linux-mm@kvack.org | 2606 | L: linux-mm@kvack.org |
2607 | S: Maintained | 2607 | S: Maintained |
2608 | F: mm/memcontrol.c | 2608 | F: mm/memcontrol.c |
2609 | F: mm/page_cgroup.c | 2609 | F: mm/swap_cgroup.c |
2610 | 2610 | ||
2611 | CORETEMP HARDWARE MONITORING DRIVER | 2611 | CORETEMP HARDWARE MONITORING DRIVER |
2612 | M: Fenghua Yu <fenghua.yu@intel.com> | 2612 | M: Fenghua Yu <fenghua.yu@intel.com> |
diff --git a/include/linux/page_cgroup.h b/include/linux/swap_cgroup.h index 65be35785c86..145306bdc92f 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/swap_cgroup.h | |||
@@ -1,15 +1,17 @@ | |||
1 | #ifndef __LINUX_PAGE_CGROUP_H | 1 | #ifndef __LINUX_SWAP_CGROUP_H |
2 | #define __LINUX_PAGE_CGROUP_H | 2 | #define __LINUX_SWAP_CGROUP_H |
3 | 3 | ||
4 | #include <linux/swap.h> | 4 | #include <linux/swap.h> |
5 | 5 | ||
6 | #ifdef CONFIG_MEMCG_SWAP | 6 | #ifdef CONFIG_MEMCG_SWAP |
7 | |||
7 | extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, | 8 | extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, |
8 | unsigned short old, unsigned short new); | 9 | unsigned short old, unsigned short new); |
9 | extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); | 10 | extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); |
10 | extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent); | 11 | extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent); |
11 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); | 12 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); |
12 | extern void swap_cgroup_swapoff(int type); | 13 | extern void swap_cgroup_swapoff(int type); |
14 | |||
13 | #else | 15 | #else |
14 | 16 | ||
15 | static inline | 17 | static inline |
@@ -37,4 +39,4 @@ static inline void swap_cgroup_swapoff(int type) | |||
37 | 39 | ||
38 | #endif /* CONFIG_MEMCG_SWAP */ | 40 | #endif /* CONFIG_MEMCG_SWAP */ |
39 | 41 | ||
40 | #endif /* __LINUX_PAGE_CGROUP_H */ | 42 | #endif /* __LINUX_SWAP_CGROUP_H */ |
diff --git a/mm/Makefile b/mm/Makefile index 6d9f40e922f7..b3c6ce932c64 100644 --- a/mm/Makefile +++ b/mm/Makefile | |||
@@ -56,7 +56,8 @@ obj-$(CONFIG_MIGRATION) += migrate.o | |||
56 | obj-$(CONFIG_QUICKLIST) += quicklist.o | 56 | obj-$(CONFIG_QUICKLIST) += quicklist.o |
57 | obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o | 57 | obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o |
58 | obj-$(CONFIG_PAGE_COUNTER) += page_counter.o | 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 | obj-$(CONFIG_CGROUP_HUGETLB) += hugetlb_cgroup.o | 61 | obj-$(CONFIG_CGROUP_HUGETLB) += hugetlb_cgroup.o |
61 | obj-$(CONFIG_MEMORY_FAILURE) += memory-failure.o | 62 | obj-$(CONFIG_MEMORY_FAILURE) += memory-failure.o |
62 | obj-$(CONFIG_HWPOISON_INJECT) += hwpoison-inject.o | 63 | obj-$(CONFIG_HWPOISON_INJECT) += hwpoison-inject.o |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index b864067791dc..ab270e34ba3e 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include <linux/seq_file.h> | 51 | #include <linux/seq_file.h> |
52 | #include <linux/vmpressure.h> | 52 | #include <linux/vmpressure.h> |
53 | #include <linux/mm_inline.h> | 53 | #include <linux/mm_inline.h> |
54 | #include <linux/page_cgroup.h> | 54 | #include <linux/swap_cgroup.h> |
55 | #include <linux/cpu.h> | 55 | #include <linux/cpu.h> |
56 | #include <linux/oom.h> | 56 | #include <linux/oom.h> |
57 | #include <linux/lockdep.h> | 57 | #include <linux/lockdep.h> |
diff --git a/mm/page_cgroup.c b/mm/swap_cgroup.c index f0f31c1d4d0c..b5f7f24b8dd1 100644 --- a/mm/page_cgroup.c +++ b/mm/swap_cgroup.c | |||
@@ -1,9 +1,8 @@ | |||
1 | #include <linux/mm.h> | 1 | #include <linux/swap_cgroup.h> |
2 | #include <linux/page_cgroup.h> | ||
3 | #include <linux/vmalloc.h> | 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 | static DEFINE_MUTEX(swap_cgroup_mutex); | 7 | static DEFINE_MUTEX(swap_cgroup_mutex); |
9 | struct swap_cgroup_ctrl { | 8 | struct swap_cgroup_ctrl { |
@@ -207,5 +206,3 @@ void swap_cgroup_swapoff(int type) | |||
207 | vfree(map); | 206 | vfree(map); |
208 | } | 207 | } |
209 | } | 208 | } |
210 | |||
211 | #endif | ||
diff --git a/mm/swap_state.c b/mm/swap_state.c index 154444918685..9711342987a0 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/blkdev.h> | 17 | #include <linux/blkdev.h> |
18 | #include <linux/pagevec.h> | 18 | #include <linux/pagevec.h> |
19 | #include <linux/migrate.h> | 19 | #include <linux/migrate.h> |
20 | #include <linux/page_cgroup.h> | ||
21 | 20 | ||
22 | #include <asm/pgtable.h> | 21 | #include <asm/pgtable.h> |
23 | 22 | ||
diff --git a/mm/swapfile.c b/mm/swapfile.c index 8798b2e0ac59..63f55ccb9b26 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include <asm/pgtable.h> | 38 | #include <asm/pgtable.h> |
39 | #include <asm/tlbflush.h> | 39 | #include <asm/tlbflush.h> |
40 | #include <linux/swapops.h> | 40 | #include <linux/swapops.h> |
41 | #include <linux/page_cgroup.h> | 41 | #include <linux/swap_cgroup.h> |
42 | 42 | ||
43 | static bool swap_count_continued(struct swap_info_struct *, pgoff_t, | 43 | static bool swap_count_continued(struct swap_info_struct *, pgoff_t, |
44 | unsigned char); | 44 | unsigned char); |