[lkml]   [2020]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 06/14] mm: remove use-once cache bias from LRU balancing
When the splitlru patches divided page cache and swap-backed pages
into separate LRU lists, the pressure balance between the lists was
biased to account for the fact that streaming IO can cause memory
pressure with a flood of pages that are used only once. New page cache
additions would tip the balance toward the file LRU, and repeat access
would neutralize that bias again. This ensured that page reclaim would
always go for used-once cache first.

Since e9868505987a ("mm,vmscan: only evict file pages when we have
plenty"), page reclaim generally skips over swap-backed memory
entirely as long as there is used-once cache present, and will apply
the LRU balancing when only repeatedly accessed cache pages are left -
at which point the previous use-once bias will have been
neutralized. This makes the use-once cache balancing bias unnecessary.

Signed-off-by: Johannes Weiner <>
Acked-by: Michal Hocko <>
Acked-by: Minchan Kim <>
mm/swap.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/mm/swap.c b/mm/swap.c
index c93a6c84464c..3b8c81bc93cd 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -277,7 +277,6 @@ static void __activate_page(struct page *page, struct lruvec *lruvec,
void *arg)
if (PageLRU(page) && !PageActive(page) && !PageUnevictable(page)) {
- int file = page_is_file_lru(page);
int lru = page_lru_base_type(page);

del_page_from_lru_list(page, lruvec, lru);
@@ -287,7 +286,6 @@ static void __activate_page(struct page *page, struct lruvec *lruvec,

- update_page_reclaim_stat(lruvec, file, 1, hpage_nr_pages(page));

@@ -936,9 +934,6 @@ static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec,

if (page_evictable(page)) {
lru = page_lru(page);
- update_page_reclaim_stat(lruvec, is_file_lru(lru),
- PageActive(page),
- hpage_nr_pages(page));
if (was_unevictable)
} else {
 \ /
  Last update: 2020-05-21 01:26    [W:0.066 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site