mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
memcg: fix calculation of active_ratio
Currently, inactive_ratio of memcg is calculated at setting limit. because page_alloc.c does so and current implementation is straightforward porting. However, memcg introduced hierarchy feature recently. In hierarchy restriction, memory limit is not only decided memory.limit_in_bytes of current cgroup, but also parent limit and sibling memory usage. Then, The optimal inactive_ratio is changed frequently. So, everytime calculation is better. Tested-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
a7885eb8ad
commit
c772be939e
3 changed files with 34 additions and 37 deletions
|
|
@ -97,8 +97,7 @@ extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem,
|
|||
int priority);
|
||||
extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem,
|
||||
int priority);
|
||||
int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg,
|
||||
struct zone *zone);
|
||||
int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg);
|
||||
unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg,
|
||||
struct zone *zone,
|
||||
enum lru_list lru);
|
||||
|
|
@ -252,7 +251,7 @@ static inline bool mem_cgroup_oom_called(struct task_struct *task)
|
|||
}
|
||||
|
||||
static inline int
|
||||
mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone)
|
||||
mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue