[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200218082634.1596727-8-ying.huang@intel.com>
Date: Tue, 18 Feb 2020 16:26:33 +0800
From: "Huang, Ying" <ying.huang@...el.com>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Feng Tang <feng.tang@...el.com>,
Huang Ying <ying.huang@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.com>, Rik van Riel <riel@...hat.com>,
Mel Gorman <mgorman@...e.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Dan Williams <dan.j.williams@...el.com>
Subject: [RFC -V2 7/8] autonuma, memory tiering: Double hot threshold for write hint page fault
From: Huang Ying <ying.huang@...el.com>
The write performance of PMEM is much worse than its read
performance. So even if a write-mostly pages is colder than a
read-mostly pages, it is usually better to put the write-mostly pages
in DRAM and read-mostly pages in PMEM.
To give write-mostly pages more opportunity to be promoted to DRAM, in
this patch, the hot threshold for write hint page fault is
doubled (easier to be promoted).
Signed-off-by: "Huang, Ying" <ying.huang@...el.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Michal Hocko <mhocko@...e.com>
Cc: Rik van Riel <riel@...hat.com>
Cc: Mel Gorman <mgorman@...e.de>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org
---
include/linux/sched/numa_balancing.h | 1 +
kernel/sched/fair.c | 2 ++
mm/memory.c | 3 +++
3 files changed, 6 insertions(+)
diff --git a/include/linux/sched/numa_balancing.h b/include/linux/sched/numa_balancing.h
index 4899ec000245..518b3d6143ba 100644
--- a/include/linux/sched/numa_balancing.h
+++ b/include/linux/sched/numa_balancing.h
@@ -15,6 +15,7 @@
#define TNF_FAULT_LOCAL 0x08
#define TNF_MIGRATE_FAIL 0x10
#define TNF_YOUNG 0x20
+#define TNF_WRITE 0x40
#ifdef CONFIG_NUMA_BALANCING
extern void task_numa_fault(int last_node, int node, int pages, int flags);
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 773f3220efc4..e5f7f4139c82 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1513,6 +1513,8 @@ bool should_numa_migrate_memory(struct task_struct *p, struct page * page,
return false;
th = msecs_to_jiffies(sysctl_numa_balancing_hot_threshold);
+ if (flags & TNF_WRITE)
+ th *= 2;
latency = numa_hint_fault_latency(p, addr);
if (latency > th)
return false;
diff --git a/mm/memory.c b/mm/memory.c
index 207caa9e61da..595d3cd62f61 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3829,6 +3829,9 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf)
if (pte_young(old_pte))
flags |= TNF_YOUNG;
+ if (vmf->flags & FAULT_FLAG_WRITE)
+ flags |= TNF_WRITE;
+
page = vm_normal_page(vma, vmf->address, pte);
if (!page)
goto unmap_out;
--
2.24.1
Powered by blists - more mailing lists