LUR: Revert "BACKPORT: mm/vmscan.c: use add_page_to_lru_list()"

The LRU function is not compatible with GKI,
causing GKI to fail to start, so revert.

This reverts commit 15a8f8af8670c68474abf476ef1d3017ef8e1Montana.

Change-Id: I3129823e1c05d84cc5616e30b16c906e973e36e3
Reviewed-on: https://gerrit.mot.com/2609772
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
xiewen3 2023-05-16 22:59:33 +08:00 • committed by Xiaojun Ji
commit 30837c89d8

View file

@ -1954,8 +1954,8 @@ static unsigned noinline_for_stack move_pages_to_lru(struct lruvec *lruvec,
while (!list_empty(list)) {
page = lru_to_page(list);
VM_BUG_ON_PAGE(PageLRU(page), page);
list_del(&page->lru);
if (unlikely(!page_evictable(page))) {
list_del(&page->lru);
spin_unlock_irq(&pgdat->lru_lock);
putback_lru_page(page);
spin_lock_irq(&pgdat->lru_lock);
@ -1965,7 +1965,10 @@ static unsigned noinline_for_stack move_pages_to_lru(struct lruvec *lruvec,
SetPageLRU(page);
lru = page_lru(page);
add_page_to_lru_list(page, lruvec, lru);
nr_pages = hpage_nr_pages(page);
update_lru_size(lruvec, lru, page_zonenum(page), nr_pages);
list_move(&page->lru, &lruvec->lists[lru]);
if (put_page_testzero(page)) {
__ClearPageLRU(page);
@ -1979,7 +1982,6 @@ static unsigned noinline_for_stack move_pages_to_lru(struct lruvec *lruvec,
} else
list_add(&page->lru, &pages_to_free);
} else {
nr_pages = hpage_nr_pages(page);
nr_moved += nr_pages;
}
}