Skip to content

Commit

Permalink
mm: page_cgroup: rename file to mm/swap_cgroup.c
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Acked-by: Vladimir Davydov <[email protected]>
Acked-by: David S. Miller <[email protected]>
Acked-by: KAMEZAWA Hiroyuki <[email protected]>
Cc: "Kirill A. Shutemov" <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
hnaz authored and torvalds committed Dec 11, 2014
1 parent 1306a85 commit 5d1ea48
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2606,7 +2606,7 @@ L: [email protected]
L: [email protected]
S: Maintained
F: mm/memcontrol.c
F: mm/page_cgroup.c
F: mm/swap_cgroup.c

CORETEMP HARDWARE MONITORING DRIVER
M: Fenghua Yu <[email protected]>
Expand Down
8 changes: 5 additions & 3 deletions include/linux/page_cgroup.h → include/linux/swap_cgroup.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#ifndef __LINUX_PAGE_CGROUP_H
#define __LINUX_PAGE_CGROUP_H
#ifndef __LINUX_SWAP_CGROUP_H
#define __LINUX_SWAP_CGROUP_H

#include <linux/swap.h>

#ifdef CONFIG_MEMCG_SWAP

extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent,
unsigned short old, unsigned short new);
extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id);
extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent);
extern int swap_cgroup_swapon(int type, unsigned long max_pages);
extern void swap_cgroup_swapoff(int type);

#else

static inline
Expand Down Expand Up @@ -37,4 +39,4 @@ static inline void swap_cgroup_swapoff(int type)

#endif /* CONFIG_MEMCG_SWAP */

#endif /* __LINUX_PAGE_CGROUP_H */
#endif /* __LINUX_SWAP_CGROUP_H */
3 changes: 2 additions & 1 deletion mm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ obj-$(CONFIG_MIGRATION) += migrate.o
obj-$(CONFIG_QUICKLIST) += quicklist.o
obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o
obj-$(CONFIG_PAGE_COUNTER) += page_counter.o
obj-$(CONFIG_MEMCG) += memcontrol.o page_cgroup.o vmpressure.o
obj-$(CONFIG_MEMCG) += memcontrol.o vmpressure.o
obj-$(CONFIG_MEMCG_SWAP) += swap_cgroup.o
obj-$(CONFIG_CGROUP_HUGETLB) += hugetlb_cgroup.o
obj-$(CONFIG_MEMORY_FAILURE) += memory-failure.o
obj-$(CONFIG_HWPOISON_INJECT) += hwpoison-inject.o
Expand Down
2 changes: 1 addition & 1 deletion mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include <linux/seq_file.h>
#include <linux/vmpressure.h>
#include <linux/mm_inline.h>
#include <linux/page_cgroup.h>
#include <linux/swap_cgroup.h>
#include <linux/cpu.h>
#include <linux/oom.h>
#include <linux/lockdep.h>
Expand Down
9 changes: 3 additions & 6 deletions mm/page_cgroup.c → mm/swap_cgroup.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include <linux/mm.h>
#include <linux/page_cgroup.h>
#include <linux/swap_cgroup.h>
#include <linux/vmalloc.h>
#include <linux/swapops.h>
#include <linux/mm.h>

#ifdef CONFIG_MEMCG_SWAP
#include <linux/swapops.h> /* depends on mm.h include */

static DEFINE_MUTEX(swap_cgroup_mutex);
struct swap_cgroup_ctrl {
Expand Down Expand Up @@ -207,5 +206,3 @@ void swap_cgroup_swapoff(int type)
vfree(map);
}
}

#endif
1 change: 0 additions & 1 deletion mm/swap_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <linux/blkdev.h>
#include <linux/pagevec.h>
#include <linux/migrate.h>
#include <linux/page_cgroup.h>

#include <asm/pgtable.h>

Expand Down
2 changes: 1 addition & 1 deletion mm/swapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
#include <linux/swapops.h>
#include <linux/page_cgroup.h>
#include <linux/swap_cgroup.h>

static bool swap_count_continued(struct swap_info_struct *, pgoff_t,
unsigned char);
Expand Down

0 comments on commit 5d1ea48

Please sign in to comment.