From patchwork Wed Oct 7 16:17:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Hansen X-Patchwork-Id: 11820963 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1610114D5 for ; Wed, 7 Oct 2020 16:17:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 873FC216C4 for ; Wed, 7 Oct 2020 16:17:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 873FC216C4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6A4486B005C; Wed, 7 Oct 2020 12:17:47 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 655686B0062; Wed, 7 Oct 2020 12:17:47 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 542D46B0068; Wed, 7 Oct 2020 12:17:47 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0240.hostedemail.com [216.40.44.240]) by kanga.kvack.org (Postfix) with ESMTP id 23F546B005C for ; Wed, 7 Oct 2020 12:17:47 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B1AAF180AD804 for ; Wed, 7 Oct 2020 16:17:46 +0000 (UTC) X-FDA: 77345635332.14.hat16_46004dc271d0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 7AC291822987B for ; Wed, 7 Oct 2020 16:17:46 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,dave.hansen@linux.intel.com,,RULES_HIT:30054:30064:30070:30091,0,RBL:134.134.136.31:@linux.intel.com:.lbl8.mailshell.net-64.95.201.95 62.18.0.100;04y8661fwp5oddhqprucy4jdurnkoycrtyb5694fruyhobekpx1diuzzdteoi7f.fer9nz74yrtzhpjidrrpzfrca561uqsmuprnxumih1w48oiitqnxbt1946sjxmr.c-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: hat16_46004dc271d0 X-Filterd-Recvd-Size: 4208 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Wed, 7 Oct 2020 16:17:45 +0000 (UTC) IronPort-SDR: ntuBQD7mKUs3VIjaQSjNHpFISKLqAnhuWC4ZJeeaqiCYSG21MPnrmtmM86dhhTwY4S/zWsK867 pgi8Zi3p78Vw== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="226592601" X-IronPort-AV: E=Sophos;i="5.77,347,1596524400"; d="scan'208";a="226592601" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 09:17:43 -0700 IronPort-SDR: 3u7YuwDKHZTj4ZkRBIwhEH/pHKNbHI/tnXHrG+xnqBDm7EmChsA/EKKFp2YISKur0iP1SE3RQ6 2m2DDvrpxUtA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,347,1596524400"; d="scan'208";a="344349170" Received: from viggo.jf.intel.com (HELO localhost.localdomain) ([10.54.77.144]) by orsmga008.jf.intel.com with ESMTP; 07 Oct 2020 09:17:43 -0700 Subject: [RFC][PATCH 0/9] [v4][RESEND] Migrate Pages in lieu of discard To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org,Dave Hansen ,yang.shi@linux.alibaba.com,rientjes@google.com,ying.huang@intel.com,dan.j.williams@intel.com,david@redhat.com From: Dave Hansen Date: Wed, 07 Oct 2020 09:17:36 -0700 Message-Id: <20201007161736.ACC6E387@viggo.jf.intel.com> 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: Changes since (automigrate-20200818): * Fall back to normal reclaim when demotion fails The full series is also available here: https://github.com/hansendc/linux/tree/automigrate-20201007 I really just want folks to look at: [RFC][PATCH 5/9] mm/migrate: demote pages during reclaim I've reworked that so that it can both use the high-level migration API, and fall back to normal reclaim if migration fails. I think that gives us the best of both worlds. I'm posting the series in case folks want to run the whole thing. --- We're starting to see systems with more and more kinds of memory such as Intel's implementation of persistent memory. Let's say you have a system with some DRAM and some persistent memory. Today, once DRAM fills up, reclaim will start and some of the DRAM contents will be thrown out. Allocations will, at some point, start falling over to the slower persistent memory. That has two nasty properties. First, the newer allocations can end up in the slower persistent memory. Second, reclaimed data in DRAM are just discarded even if there are gobs of space in persistent memory that could be used. This set implements a solution to these problems. At the end of the reclaim process in shrink_page_list() just before the last page refcount is dropped, the page is migrated to persistent memory instead of being dropped. While I've talked about a DRAM/PMEM pairing, this approach would function in any environment where memory tiers exist. This is not perfect. It "strands" pages in slower memory and never brings them back to fast DRAM. Other things need to be built to promote hot pages back to DRAM. This is also all based on an upstream mechanism that allows persistent memory to be onlined and used as if it were volatile: http://lkml.kernel.org/r/20190124231441.37A4A305@viggo.jf.intel.com == Open Issues == * For cpusets and memory policies that restrict allocations to PMEM, is it OK to demote to PMEM? Do we need a cgroup- level API to opt-in or opt-out of these migrations? -- Changes since (https://lwn.net/Articles/824830/): * Use higher-level migrate_pages() API approach from Yang Shi's earlier patches. * made sure to actually check node_reclaim_mode's new bit * disabled migration entirely before introducing RECLAIM_MIGRATE * Replace GFP_NOWAIT with explicit __GFP_KSWAPD_RECLAIM and comment why we want that. * Comment on effects of that keep multiple source nodes from sharing target nodes Cc: Yang Shi Cc: David Rientjes Cc: Huang Ying Cc: Dan Williams Cc: David Hildenbrand