lkml.org 
[lkml]   [2018]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC][PATCH v2 21/21] mm/vmscan.c: shrink anon list if can migrate to PMEM
Fix OOM by making in-kernel DRAM=>PMEM migration reachable.

Here we assume these 2 possible demotion paths:
- DRAM migrate to PMEM
- PMEM to swap device

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
mm/vmscan.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

--- linux.orig/mm/vmscan.c 2018-12-23 20:38:44.310446223 +0800
+++ linux/mm/vmscan.c 2018-12-23 20:38:44.306446146 +0800
@@ -2259,7 +2259,7 @@ static bool inactive_list_is_low(struct
* If we don't have swap space, anonymous page deactivation
* is pointless.
*/
- if (!file && !total_swap_pages)
+ if (!file && (is_node_pmem(pgdat->node_id) && !total_swap_pages))
return false;

inactive = lruvec_lru_size(lruvec, inactive_lru, sc->reclaim_idx);
@@ -2340,7 +2340,8 @@ static void get_scan_count(struct lruvec
enum lru_list lru;

/* If we have no swap space, do not bother scanning anon pages. */
- if (!sc->may_swap || mem_cgroup_get_nr_swap_pages(memcg) <= 0) {
+ if (is_node_pmem(pgdat->node_id) &&
+ (!sc->may_swap || mem_cgroup_get_nr_swap_pages(memcg) <= 0)) {
scan_balance = SCAN_FILE;
goto out;
}

\
 
 \ /
  Last update: 2018-12-26 14:38    [W:0.349 / U:2.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site