mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mm/memcg: apply add/del_page to lruvec
Take lruvec further: pass it instead of zone to add_page_to_lru_list() and del_page_from_lru_list(); and pagevec_lru_move_fn() pass lruvec down to its target functions. This cleanup eliminates a swathe of cruft in memcontrol.c, including mem_cgroup_lru_add_list(), mem_cgroup_lru_del_list() and mem_cgroup_lru_move_lists() - which never actually touched the lists. In their place, mem_cgroup_page_lruvec() to decide the lruvec, previously a side-effect of add, and mem_cgroup_update_lru_size() to maintain the lru_size stats. Whilst these are simplifications in their own right, the goal is to bring the evaluation of lruvec next to the spin_locking of the lrus, in preparation for a future patch. Signed-off-by: Hugh Dickins <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Acked-by: KAMEZAWA Hiroyuki <[email protected]> Acked-by: Michal Hocko <[email protected]> Acked-by: Konstantin Khlebnikov <[email protected]> Cc: Johannes Weiner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
75b00af77e
commit
fa9add641b
8 changed files with 122 additions and 181 deletions
|
|
@ -227,6 +227,7 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
|
|||
unsigned long nr_scanned = 0, nr_isolated = 0;
|
||||
struct list_head *migratelist = &cc->migratepages;
|
||||
isolate_mode_t mode = 0;
|
||||
struct lruvec *lruvec;
|
||||
|
||||
/*
|
||||
* Ensure that there are not too many pages isolated from the LRU
|
||||
|
|
@ -328,6 +329,8 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
|
|||
if (cc->mode != COMPACT_SYNC)
|
||||
mode |= ISOLATE_ASYNC_MIGRATE;
|
||||
|
||||
lruvec = mem_cgroup_page_lruvec(page, zone);
|
||||
|
||||
/* Try isolate the page */
|
||||
if (__isolate_lru_page(page, mode) != 0)
|
||||
continue;
|
||||
|
|
@ -335,7 +338,7 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
|
|||
VM_BUG_ON(PageTransCompound(page));
|
||||
|
||||
/* Successfully isolated */
|
||||
del_page_from_lru_list(zone, page, page_lru(page));
|
||||
del_page_from_lru_list(page, lruvec, page_lru(page));
|
||||
list_add(&page->lru, migratelist);
|
||||
cc->nr_migratepages++;
|
||||
nr_isolated++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue