|
Vlastimil Babka |
5b34c0 |
From: Vlastimil Babka <vbabka@suse.cz>
|
|
Vlastimil Babka |
5b34c0 |
Subject: prevent active file list thrashing due to refault detection
|
|
Vlastimil Babka |
5b34c0 |
Patch-mainline: Never, discussing proper upstream solution
|
|
Vlastimil Babka |
5b34c0 |
References: VM Performance, bsc#1156286
|
|
Vlastimil Babka |
5b34c0 |
|
|
Vlastimil Babka |
5b34c0 |
In bsc#1156286 we found that 12SP4 kernel regression compared to 12SP3 is due
|
|
Vlastimil Babka |
5b34c0 |
to commit 2a2e48854d70 ("mm: vmscan: fix IO/refault regression in cache
|
|
Vlastimil Babka |
5b34c0 |
workingset transition") causing active file list thrashing, as the refault
|
|
Vlastimil Babka |
5b34c0 |
counter may increase since the last snapshot between kswapd runs and cause
|
|
Vlastimil Babka |
5b34c0 |
the second kswapd run to focus all reclaim on the active list.
|
|
Vlastimil Babka |
5b34c0 |
|
|
Vlastimil Babka |
5b34c0 |
Proper upstreamable solution needs to be discussed, but we need to fix the
|
|
Vlastimil Babka |
5b34c0 |
regression meanwhile, so effectively disabling commit 2a2e48854d70 is the
|
|
Vlastimil Babka |
5b34c0 |
simplest option. There has been positive feedback from the customer, and
|
|
Vlastimil Babka |
5b34c0 |
performance team found no obvious regressions from this change.
|
|
Vlastimil Babka |
5b34c0 |
|
|
Vlastimil Babka |
5b34c0 |
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
|
|
Vlastimil Babka |
5b34c0 |
|
|
Vlastimil Babka |
5b34c0 |
---
|
|
Vlastimil Babka |
5b34c0 |
mm/vmscan.c | 8 ++++++++
|
|
Vlastimil Babka |
5b34c0 |
1 file changed, 8 insertions(+)
|
|
Vlastimil Babka |
5b34c0 |
|
|
Vlastimil Babka |
5b34c0 |
--- a/mm/vmscan.c
|
|
Vlastimil Babka |
5b34c0 |
+++ b/mm/vmscan.c
|
|
Vlastimil Babka |
5b34c0 |
@@ -2061,6 +2061,12 @@ static bool inactive_list_is_low(struct
|
|
Vlastimil Babka |
5b34c0 |
unsigned long refaults;
|
|
Vlastimil Babka |
5b34c0 |
unsigned long gb;
|
|
Vlastimil Babka |
5b34c0 |
|
|
Vlastimil Babka |
5b34c0 |
+ /*
|
|
Vlastimil Babka |
5b34c0 |
+ * spurious refault detection results in active list thrashing,
|
|
Vlastimil Babka |
5b34c0 |
+ * disable it - bsc#1156286
|
|
Vlastimil Babka |
5b34c0 |
+ */
|
|
Vlastimil Babka |
5b34c0 |
+ actual_reclaim = false;
|
|
Vlastimil Babka |
5b34c0 |
+
|
|
Vlastimil Babka |
5b34c0 |
/*
|
|
Vlastimil Babka |
5b34c0 |
* If we don't have swap space, anonymous page deactivation
|
|
Vlastimil Babka |
5b34c0 |
* is pointless.
|
|
Vlastimil Babka |
5b34c0 |
@@ -2091,6 +2097,8 @@ static bool inactive_list_is_low(struct
|
|
Vlastimil Babka |
5b34c0 |
inactive_ratio = 1;
|
|
Vlastimil Babka |
5b34c0 |
}
|
|
Vlastimil Babka |
5b34c0 |
|
|
Vlastimil Babka |
5b34c0 |
+ /* bsc#1156286 - don't lose the tracepoint */
|
|
Vlastimil Babka |
5b34c0 |
+ actual_reclaim = true;
|
|
Vlastimil Babka |
5b34c0 |
if (actual_reclaim)
|
|
Vlastimil Babka |
5b34c0 |
trace_mm_vmscan_inactive_list_is_low(pgdat->node_id, sc->reclaim_idx,
|
|
Vlastimil Babka |
5b34c0 |
lruvec_lru_size(lruvec, inactive_lru, MAX_NR_ZONES), inactive,
|