mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
memcg: remove direct page_cgroup-to-page pointer
In struct page_cgroup, we have a full word for flags but only a few are reserved. Use the remaining upper bits to encode, depending on configuration, the node or the section, to enable page_cgroup-to-page lookups without a direct pointer. This saves a full word for every page in a system with memory cgroups enabled. Signed-off-by: Johannes Weiner <[email protected]> Acked-by: KAMEZAWA Hiroyuki <[email protected]> Cc: Daisuke Nishimura <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Randy Dunlap <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
5564e88ba6
commit
6b3ae58efc
4 changed files with 117 additions and 55 deletions
|
|
@ -1080,7 +1080,7 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
|
|||
if (unlikely(!PageCgroupUsed(pc)))
|
||||
continue;
|
||||
|
||||
page = pc->page;
|
||||
page = lookup_cgroup_page(pc);
|
||||
|
||||
if (unlikely(!PageLRU(page)))
|
||||
continue;
|
||||
|
|
@ -3344,7 +3344,7 @@ static int mem_cgroup_force_empty_list(struct mem_cgroup *mem,
|
|||
}
|
||||
spin_unlock_irqrestore(&zone->lru_lock, flags);
|
||||
|
||||
page = pc->page;
|
||||
page = lookup_cgroup_page(pc);
|
||||
|
||||
ret = mem_cgroup_move_parent(page, pc, mem, GFP_KERNEL);
|
||||
if (ret == -ENOMEM)
|
||||
|
|
|
|||
Loading…
Reference in a new issue