From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4BE9C433F5 for ; Wed, 22 Dec 2021 11:14:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2DC636B0074; Wed, 22 Dec 2021 06:14:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 26BCB6B0078; Wed, 22 Dec 2021 06:14:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 104436B0075; Wed, 22 Dec 2021 06:14:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0224.hostedemail.com [216.40.44.224]) by kanga.kvack.org (Postfix) with ESMTP id D9F716B0074 for ; Wed, 22 Dec 2021 06:14:57 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 88C4582499B9 for ; Wed, 22 Dec 2021 11:14:57 +0000 (UTC) X-FDA: 78945173034.26.D1C4E52 Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by imf02.hostedemail.com (Postfix) with ESMTP id DCB1D8002A for ; Wed, 22 Dec 2021 11:14:51 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R831e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0V.QKPtU_1640171689; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0V.QKPtU_1640171689) by smtp.aliyun-inc.com(127.0.0.1); Wed, 22 Dec 2021 19:14:50 +0800 From: Baolin Wang To: sj@kernel.org, akpm@linux-foundation.org Cc: ying.huang@intel.com, dave.hansen@linux.intel.com, ziy@nvidia.com, shy828301@gmail.com, zhongjiang-ali@linux.alibaba.com, xlpang@linux.alibaba.com, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] Add a new scheme to support demotion on tiered memory system Date: Wed, 22 Dec 2021 19:14:39 +0800 Message-Id: X-Mailer: git-send-email 1.8.3.1 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: DCB1D8002A X-Stat-Signature: f65jw4w6pmxx97bcouyezpi645rrdwb3 Authentication-Results: imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.43 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com X-HE-Tag: 1640171691-662003 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, Now on tiered memory system with different memory types, the reclaim path in shrink_page_list() already support demoting pages to slow memory node instead of discarding the pages. However, at that time the fast memory node memory wartermark is already tense, which will increase the memory allocation latency during page demotion. So a new method from user space demoting cold pages proactively will be more helpful. We can rely on the DAMON in user space to help to monitor the cold memory on fast memory node, and demote the cold pages to slow memory node proactively to keep the fast memory node in a healthy state. This patch set introduces a new scheme named DAMOS_DEMOTE to support this feature, and works well from my testing. Any comments are welcome. Thanks. Changes from v1: - Reuse the demote_page_list(). - Fix some comments style issues. - Move the DAMOS_DEMOTE definition to the correct place. - Rename some function name. - Change to return void type for damos_isolate_page(). - Remove unnecessary PAGE_ALIGN() in damos_demote(). - Fix the return value for damos_demote(). Baolin Wang (2): mm: Export the demote_page_list() function mm/damon: Add a new scheme to support demotion on tiered memory system include/linux/damon.h | 3 ++ mm/damon/dbgfs.c | 1 + mm/damon/vaddr.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++ mm/internal.h | 2 + mm/vmscan.c | 4 +- 5 files changed, 155 insertions(+), 2 deletions(-) -- 1.8.3.1