Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp613013pxu; Wed, 7 Oct 2020 11:06:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLdqG3knBCrwyPvIpVK+s1NYk+Kvgf8r2XRt4Mj4bNC3b+RbIWqY2sjN0BD98X57uhUs99 X-Received: by 2002:a17:906:360b:: with SMTP id q11mr4816069ejb.259.1602093966061; Wed, 07 Oct 2020 11:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602093966; cv=none; d=google.com; s=arc-20160816; b=Mfm3Ig9o78eTqqWkb1Q/0nvh3hoCNdnGONDW9SIhqCobkorT2cohmKPlNbmDRQBUwh IyKvFYsf8oS4yXW+4MOxicQX/xa1Gu6gP/qE7eNC1fCRJf/CnQOapPMtqP2ysdPbrMGc +tU5dewOyPwnFVLDHVeJ/U3/bHZQlUCujszsqvVJjDRDmRg+1D70oTZ/1oAEQFQywTAS ZTd4C9XZHMQbXTMQX0PF5JvrqrTYYl38h2e/eCuphmR+PNFQyCpWVFa8XT1ms+Pmv07m 7RpirBWWp5B0N0RqCMUpviX0WNbN9S8yUMgifksnXM34Y3Cst1tvd63fqDBM+sErqtZ1 OReg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:from:cc:to:subject:ironport-sdr :ironport-sdr; bh=+z/UT/53WPVW2ji3TL9liShfwSDG1gN2bsEE4ENVVCo=; b=RBCNzYcgMrXrMXImqr1jW/5P0neZ+fthLI8E2wva+akeiflbENDUNKPp+Upl0eYgsa ybQI527+rSnCOtRlw1H6ARvQ6zYJjfWIgJuq9YXvJPlT9jDPqiWuR+62a5r4r3Oze+WZ 1mEFyHDpbZ+fSkaZAW4rWC/3vnVHjZy69MqiPqc6lGiU3/BSbtM1dpvVS/87zbZpgCt3 LywfLxSxKBFdHYERLXk2+3AzHpZse8WltZKvg7g/OaFv/K/W7gD6cGU6EKHx0UUt1SHQ as/66J6rqYfT01VBBGfzefLKEUY3vnOi0jMh6LLb2rw+QlaKDkzPiFZuFKDpFpv0mofE Tvow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l25si1866812eds.531.2020.10.07.11.05.22; Wed, 07 Oct 2020 11:06:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727652AbgJGQRo (ORCPT + 99 others); Wed, 7 Oct 2020 12:17:44 -0400 Received: from mga07.intel.com ([134.134.136.100]:54556 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbgJGQRo (ORCPT ); Wed, 7 Oct 2020 12:17:44 -0400 IronPort-SDR: 7dXkIx3DIA7esbLlD6RgZEzPSvg3hx1U2RJLlFtUdwEgMxebKbnoeiqfUeTsTl2YYCZN1+j0sT tgc+M1tZWg3Q== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="229142513" X-IronPort-AV: E=Sophos;i="5.77,347,1596524400"; d="scan'208";a="229142513" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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