From patchwork Thu Mar 21 20:01:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 10864259 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 57A5413B5 for ; Thu, 21 Mar 2019 20:03:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3965E2A45C for ; Thu, 21 Mar 2019 20:03:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D77D2A47F; Thu, 21 Mar 2019 20:03:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DD0D62A45C for ; Thu, 21 Mar 2019 20:03:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A1D7E2194EB70; Thu, 21 Mar 2019 13:03:48 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=keith.busch@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B5E4D2194EB70 for ; Thu, 21 Mar 2019 13:02:56 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2019 13:02:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,254,1549958400"; d="scan'208";a="309246228" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.69]) by orsmga005.jf.intel.com with ESMTP; 21 Mar 2019 13:02:55 -0700 From: Keith Busch To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org Subject: [PATCH 0/5] Page demotion for memory reclaim Date: Thu, 21 Mar 2019 14:01:52 -0600 Message-Id: <20190321200157.29678-1-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Hansen MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP The kernel has recently added support for using persistent memory as normal RAM: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c221c0b0308fd01d9fb33a16f64d2fd95f8830a4 The persistent memory is hot added to nodes separate from other memory types, which makes it convenient to make node based memory policies. When persistent memory provides a larger and cheaper address space, but with slower access characteristics than system RAM, we'd like the kernel to make use of these memory-only nodes as a migration tier for pages that would normally be discared during memory reclaim. This is faster than doing IO for swap or page cache, and makes better utilization of available physical address space. The feature is not enabled by default. The user must opt-in to kernel managed page migration by defining the demotion path. In the future, we may want to have the kernel automatically create this based on heterogeneous memory attributes and CPU locality. Keith Busch (5): node: Define and export memory migration path mm: Split handling old page for migration mm: Attempt to migrate page in lieu of discard mm: Consider anonymous pages without swap mm/migrate: Add page movement trace event Documentation/ABI/stable/sysfs-devices-node | 11 +- drivers/base/node.c | 73 +++++++++++++ include/linux/migrate.h | 6 ++ include/linux/node.h | 6 ++ include/linux/swap.h | 20 ++++ include/trace/events/migrate.h | 29 ++++- mm/debug.c | 1 + mm/migrate.c | 161 ++++++++++++++++++---------- mm/vmscan.c | 25 ++++- 9 files changed, 271 insertions(+), 61 deletions(-)