mirror of
https://github.com/commaai/agnos-kernel-sdm845.git
synced 2026-06-08 11:24:51 +08:00
Merge "mm: vmscan: only write dirty pages that the scanner has seen twice"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
20fa9d7ff7
16
mm/vmscan.c
16
mm/vmscan.c
@@ -1154,14 +1154,18 @@ static unsigned long shrink_page_list(struct list_head *page_list,
|
||||
|
||||
if (PageDirty(page)) {
|
||||
/*
|
||||
* Only kswapd can writeback filesystem pages to
|
||||
* avoid risk of stack overflow but only writeback
|
||||
* if many dirty pages have been encountered.
|
||||
* Only kswapd can writeback filesystem pages
|
||||
* to avoid risk of stack overflow. But avoid
|
||||
* injecting inefficient single-page IO into
|
||||
* flusher writeback as much as possible: only
|
||||
* write pages when we've encountered many
|
||||
* dirty pages, and when we've already scanned
|
||||
* the rest of the LRU for clean pages and see
|
||||
* the same dirty pages again (PageReclaim).
|
||||
*/
|
||||
if (page_is_file_cache(page) &&
|
||||
(!current_is_kswapd() ||
|
||||
(pgdat &&
|
||||
!test_bit(PGDAT_DIRTY, &pgdat->flags)))) {
|
||||
(!current_is_kswapd() || !PageReclaim(page) ||
|
||||
!test_bit(PGDAT_DIRTY, &pgdat->flags))) {
|
||||
/*
|
||||
* Immediately reclaim when written back.
|
||||
* Similar in principal to deactivate_page()
|
||||
|
||||
Reference in New Issue
Block a user