Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00f0b825 authored by Balbir Singh's avatar Balbir Singh Committed by Linus Torvalds
Browse files

Memory controller: rename to Memory Resource Controller



Rename Memory Controller to Memory Resource Controller.  Reflect the same
changes in the CONFIG definition for the Memory Resource Controller.  Group
together the config options for Resource Counters and Memory Resource
Controller.

Signed-off-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 804defea
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
Memory Controller
Memory Resource Controller

NOTE: The Memory Resource Controller has been generically been referred
to as the memory controller in this document. Do not confuse memory controller
used here with the memory controller that is used in hardware.

Salient features

@@ -152,7 +156,7 @@ The memory controller uses the following hierarchy

a. Enable CONFIG_CGROUPS
b. Enable CONFIG_RESOURCE_COUNTERS
c. Enable CONFIG_CGROUP_MEM_CONT
c. Enable CONFIG_CGROUP_MEM_RES_CTLR

1. Prepare the cgroups
# mkdir -p /cgroups
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ SUBSYS(cpuacct)

/* */

#ifdef CONFIG_CGROUP_MEM_CONT
#ifdef CONFIG_CGROUP_MEM_RES_CTLR
SUBSYS(mem_cgroup)
#endif

+2 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ struct page_cgroup;
struct page;
struct mm_struct;

#ifdef CONFIG_CGROUP_MEM_CONT
#ifdef CONFIG_CGROUP_MEM_RES_CTLR

extern void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p);
extern void mm_free_cgroup(struct mm_struct *mm);
@@ -72,7 +72,7 @@ extern long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem,
extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem,
				struct zone *zone, int priority);

#else /* CONFIG_CGROUP_MEM_CONT */
#else /* CONFIG_CGROUP_MEM_RES_CTLR */
static inline void mm_init_cgroup(struct mm_struct *mm,
					struct task_struct *p)
{
+2 −2
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ struct page {
	void *virtual;			/* Kernel virtual address (NULL if
					   not kmapped, ie. highmem) */
#endif /* WANT_PAGE_VIRTUAL */
#ifdef CONFIG_CGROUP_MEM_CONT
#ifdef CONFIG_CGROUP_MEM_RES_CTLR
	unsigned long page_cgroup;
#endif
};
@@ -222,7 +222,7 @@ struct mm_struct {
	/* aio bits */
	rwlock_t		ioctx_list_lock;
	struct kioctx		*ioctx_list;
#ifdef CONFIG_CGROUP_MEM_CONT
#ifdef CONFIG_CGROUP_MEM_RES_CTLR
	struct mem_cgroup *mem_cgroup;
#endif
};
+15 −15
Original line number Diff line number Diff line
@@ -366,6 +366,21 @@ config RESOURCE_COUNTERS
          infrastructure that works with cgroups
	depends on CGROUPS

config CGROUP_MEM_RES_CTLR
	bool "Memory Resource Controller for Control Groups"
	depends on CGROUPS && RESOURCE_COUNTERS
	help
	  Provides a memory resource controller that manages both page cache and
	  RSS memory.

	  Note that setting this option increases fixed memory overhead
	  associated with each page of memory in the system by 4/8 bytes
	  and also increases cache misses because struct page on many 64bit
	  systems will not fit into a single cache line anymore.

	  Only enable when you're ok with these trade offs and really
	  sure you need the memory resource controller.

config SYSFS_DEPRECATED
	bool "Create deprecated sysfs files"
	depends on SYSFS
@@ -387,21 +402,6 @@ config SYSFS_DEPRECATED
	  If you are using a distro that was released in 2006 or later,
	  it should be safe to say N here.

config CGROUP_MEM_CONT
	bool "Memory controller for cgroups"
	depends on CGROUPS && RESOURCE_COUNTERS
	help
	  Provides a memory controller that manages both page cache and
	  RSS memory.

	  Note that setting this option increases fixed memory overhead
	  associated with each page of memory in the system by 4/8 bytes
	  and also increases cache misses because struct page on many 64bit
	  systems will not fit into a single cache line anymore.

	  Only enable when you're ok with these trade offs and really
	  sure you need the memory controller.

config PROC_PID_CPUSET
	bool "Include legacy /proc/<pid>/cpuset file"
	depends on CPUSETS
Loading