Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4644933pxu; Tue, 13 Oct 2020 03:48:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw33RBmjkq2BZS5MhTdPhMxMbsCvqBuuBvTglXBcu8mxTc5bUuogIbvKXyv8QzUi0kYVd5n X-Received: by 2002:a50:9b1d:: with SMTP id o29mr19539800edi.56.1602586126697; Tue, 13 Oct 2020 03:48:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602586126; cv=none; d=google.com; s=arc-20160816; b=WbtkeWF9+6F3fZM7yu4rasZEiolpoQ2IaYx1d7D5ZCpc+aEMhA7fodH7CMRShxaQlV eJFz4Oil9BjKYaXmiz/n+hZuIPBY1KBo7XoYHGe07aSa6i7Lc5cSDZaOJINPSEZNjDEA Rnu57V3mevb5xlhbJdpdxSMizFcb1dvG8NuCUDPF588TvBGPrQyGsfWVD88nlu0vyBTu xzjwhvGMrGzjbbGIp/2IqyYY9ZcuV0O1VP31m0I3uWk/j0+8KjSAIFWK6agepl1h96z0 SvYtTgasuLDJNmBbJpxiUfLTSoOdnzTmFveYdsb/ws+va375tF0JFxEW9YJxGMCPxwTQ IZeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WhdARHn7ekpE/B6g7hvohtBN+vrCDHD817Ns5WlYqDg=; b=r7caYm6jleocsI1qM9NFwg2V7skmOkQsalTPQORJIxubh9gmX5sKu9O4HyCKhl8Nmm fhN8Zlbyg5jh5z7f7kKR3xwZvf7N4sdwzRvvhQl5sdG89WBU4xLWIiGDpW1+AIqBP8J4 1bDyXqxj8LEFXyurWcrfgWN05W47alJ06KfzuaYV36gxVo2LoKx+TfrAQTDTvi0klB91 h6ElZvutpYrX98VVyFA/D8s0rsQ1006xho6EcAQia0GH+586P1B21f44PomL7YQnoQ9g d7lO++RYWXxCxxOS6oasukvZu5yBJerdDOmcfbSX09xuHB0VmWxB8wh4x6664tnzhTkI 1yRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rY2+TsxL; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si13866788ejw.351.2020.10.13.03.48.24; Tue, 13 Oct 2020 03:48:46 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rY2+TsxL; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729916AbgJLVa3 (ORCPT + 99 others); Mon, 12 Oct 2020 17:30:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbgJLVa3 (ORCPT ); Mon, 12 Oct 2020 17:30:29 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 380B2C0613D0 for ; Mon, 12 Oct 2020 14:30:29 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id v19so18595127edx.9 for ; Mon, 12 Oct 2020 14:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WhdARHn7ekpE/B6g7hvohtBN+vrCDHD817Ns5WlYqDg=; b=rY2+TsxLiz6pvvr3ngQb0t80ciUoaEE7i0zO5vITri28qzFvp84GEw9YRpxStpMl2d 2cQg5nTQGQZuC1pGc7H5QlQypme3ga5nM3do23Wme/98JRQc70wopxGq97eSVh4n+w2v MlfznvOSBWoLy9KaSipAnSA2oARr5EK/YuAfDkGXmL7pqyA3iAk05Qc1bA+ZY0Bi49Qh FrMUn7KYEI2mrN6zRgZc2qQgaJn8GUwAKF4t6Q2KRUEwAxyDabCRYCoVhqKY/uV8mrT4 +Lrd9Q3j84rDBpzy03XiKNjdHheE12NV/QAz88eMRtAtBVGrUWfjhtEywNbROhLKbAer b9MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WhdARHn7ekpE/B6g7hvohtBN+vrCDHD817Ns5WlYqDg=; b=IJLanjuTwAHN5Iyf1SUcbUkQJPEZRVpufIPt6unyjngjVheCIvgBDAMEdvgTmjoV2g e0RRWFPkP/6o33jCRIPMYq/wxYydES/6vMjoHjR5n5CCXw2ci5T5tVIXGYS54sOXXqC6 hTCIq6nvwt9ageHoB1WD+epcWmuSBpOZP9Xk0WNQ9vsPFqPGFFk9LV98WAFaAQwHAWKV OwpT2atLCL9XAZybAAPS0tcL7AnEPz2RSH6bRjs11/PDArXBxuMSfAd9qELbKE1nHO7s u+FQJSM/sJVKlrP8XzT5eOUVi06Sm3F1/8U3uXjoKCRNkCisSnUfLxHyujT0lWCGwGQE qPkg== X-Gm-Message-State: AOAM531j7EpVe//lAKpPLTIKYv79reiVcAzYh4jJ+fwuX6MujSo8wDDB 2oMlBBeKnM10h0IaYuscZFfC0hV7kouvHp/p5twFMuRlhDU= X-Received: by 2002:a50:c05b:: with SMTP id u27mr16114957edd.290.1602538227750; Mon, 12 Oct 2020 14:30:27 -0700 (PDT) MIME-Version: 1.0 References: <20201007161736.ACC6E387@viggo.jf.intel.com> In-Reply-To: <20201007161736.ACC6E387@viggo.jf.intel.com> From: Yang Shi Date: Mon, 12 Oct 2020 14:30:16 -0700 Message-ID: Subject: Re: [RFC][PATCH 0/9] [v4][RESEND] Migrate Pages in lieu of discard To: Dave Hansen Cc: Linux Kernel Mailing List , Linux MM , Yang Shi , David Rientjes , Huang Ying , Dan Williams , David Hildenbrand Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 7, 2020 at 9:17 AM Dave Hansen wrote: > > > 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. Thanks for doing this. Although I was inclined to think the kswapds on PMEM nodes could make enough space for retrying migration later instead of doing swap right away, this approach might be over-engineering and over-killing. The simple immediate "retry regular reclaim" approach also looks fine to me for the time being. We always could optimize it later with more test results backed by real life workloads. > > 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 >