mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
ANDROID: clear memory trylock-bit when page_locked.
Clearing trylock-bit of page shrinked by shrnk_page_list in advance
which avoids page in other scene with the trylock-bit.
The page with trylock-bit will be added ret_pages and handled in
trace_android_vh_handle_failed_page_trylock. In the progress[unlock_page, handled],
the page carried with trylock-bit will cause some error-issues in other
scene, so clear trylock-bit here.
trace_android_vh_page_trylock_get_result will clear trylock-bit and return
if page tyrlock failed in reclaim-process. Here we just want to clear
trylock-bit so that ignore page_trylock_result.
Fixes: 309a6bf81a20 ("ANDROID: vendor_hook: Add hook to not be stuck ro rmap lock in kswapd or direct_reclaim")
Bug: 240003372
Signed-off-by: Peifeng Li <lipeifeng@oppo.com>
Change-Id: Ifecd308573ef37a51e33856a0b3bb93cd67289ac
This commit is contained in:
13
mm/vmscan.c
13
mm/vmscan.c
@@ -1128,6 +1128,7 @@ static unsigned int shrink_page_list(struct list_head *page_list,
|
|||||||
LIST_HEAD(free_pages);
|
LIST_HEAD(free_pages);
|
||||||
unsigned int nr_reclaimed = 0;
|
unsigned int nr_reclaimed = 0;
|
||||||
unsigned int pgactivate = 0;
|
unsigned int pgactivate = 0;
|
||||||
|
bool page_trylock_result;
|
||||||
|
|
||||||
memset(stat, 0, sizeof(*stat));
|
memset(stat, 0, sizeof(*stat));
|
||||||
cond_resched();
|
cond_resched();
|
||||||
@@ -1527,6 +1528,18 @@ activate_locked:
|
|||||||
count_memcg_page_event(page, PGACTIVATE);
|
count_memcg_page_event(page, PGACTIVATE);
|
||||||
}
|
}
|
||||||
keep_locked:
|
keep_locked:
|
||||||
|
/*
|
||||||
|
* The page with trylock-bit will be added ret_pages and
|
||||||
|
* handled in trace_android_vh_handle_failed_page_trylock.
|
||||||
|
* In the progress[unlock_page, handled], the page carried
|
||||||
|
* with trylock-bit will cause some error-issues in other
|
||||||
|
* scene, so clear trylock-bit here.
|
||||||
|
* trace_android_vh_page_trylock_get_result will clear
|
||||||
|
* trylock-bit and return if page tyrlock failed in
|
||||||
|
* reclaim-process. Here we just want to clear trylock-bit
|
||||||
|
* so that ignore page_trylock_result.
|
||||||
|
*/
|
||||||
|
trace_android_vh_page_trylock_get_result(page, &page_trylock_result);
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
keep:
|
keep:
|
||||||
list_add(&page->lru, &ret_pages);
|
list_add(&page->lru, &ret_pages);
|
||||||
|
|||||||
Reference in New Issue
Block a user