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 X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96085C433DF for ; Tue, 30 Jun 2020 18:36:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 573F0206CB for ; Tue, 30 Jun 2020 18:36:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="nlvzt4sr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 573F0206CB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C66106B0006; Tue, 30 Jun 2020 14:36:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C16F66B0007; Tue, 30 Jun 2020 14:36:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ADF476B0008; Tue, 30 Jun 2020 14:36:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id 98A196B0006 for ; Tue, 30 Jun 2020 14:36:58 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 508501EE6 for ; Tue, 30 Jun 2020 18:36:58 +0000 (UTC) X-FDA: 76986734916.27.day35_58075e526e7a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 244D73D663 for ; Tue, 30 Jun 2020 18:36:58 +0000 (UTC) X-HE-Tag: day35_58075e526e7a X-Filterd-Recvd-Size: 5631 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Tue, 30 Jun 2020 18:36:57 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id e4so23812148ljn.4 for ; Tue, 30 Jun 2020 11:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SmMd8dJzrh6Vbw+MGljTp8jU8xpCSAjIfg+twyARNbY=; b=nlvzt4srVPfvdNTbxPzMxWr2bpcP3G+zeXKZJpHtK/9tLbmDCLXFBOABQDpjJCANOb tExsqVoRZuHmGThsd9zd+SDypDB/jV9PJBuemv5XHM7+ldXkLULO5yl9xg4tj9bBoHi2 U6DN0A5HR8j0kV1jYCHY2vTPczwW/ucBq97bCoTuq7EY7JV/ctM395nrfA7yK7jieePn JLu15ue7i5arhIUCVhwHSJoZisVQ8hFpXSJRP8KX4h5v6QwEQAgPombqVdGOsG4RFQEl nzHiy7vUYvbmLRMw8MkvhA1iUez/j2KbDf/fMpXPrfzvKefH4vsd30bUvJFFbCn0V41Z 0Z7w== 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=SmMd8dJzrh6Vbw+MGljTp8jU8xpCSAjIfg+twyARNbY=; b=sgggZtOvhbPc6UVMoqv9sSBR6xfdhcCvCtHBSJr778CIWbWMezHWFbK2SKBb4X10W7 8CaAaF+D3YDIcEHDVWAu9C9ld5ABhxQ/hHElHntBKEz7DVYGuIfGflsSUVsN1ID7ffNj /nMecq9SUUJrXgc7ITlXJncKR5kw+RmpITT0Ha+0twN/wt5F7DCbsZ9nNie0NbKYTeL1 JTqfe4/kjGdik/D8jq/AJ/zw3tODAzlSxi2YsTsUckaXOpbU3k4wy5toVKeY9fyv7SaK Kh02ZjwEDPBuKblEPe9lMo3Sfdq7r2mkMokNbktiF8BgzbzrEcg9LUZtRrQPCtvC5CRa WnOg== X-Gm-Message-State: AOAM5317PZYmRdHlXaIBn5w+wt9wlzm8vkodZ6vBFL4Ik5ea7GlZhA3A 1yvsu1kmf/dI22UAZmvgVK27gZYjLKgPqhmM31aCIA== X-Google-Smtp-Source: ABdhPJzICJHyF7j4SzEYMvu9uRna6ekqoyKW/gnwuQugvxHqnSV0ara77pUHOzK2yf82Xb022rKhB9mlhUu8MbGLz6c= X-Received: by 2002:a2e:9585:: with SMTP id w5mr10019121ljh.58.1593542215095; Tue, 30 Jun 2020 11:36:55 -0700 (PDT) MIME-Version: 1.0 References: <20200629234503.749E5340@viggo.jf.intel.com> In-Reply-To: <20200629234503.749E5340@viggo.jf.intel.com> From: Shakeel Butt Date: Tue, 30 Jun 2020 11:36:43 -0700 Message-ID: Subject: Re: [RFC][PATCH 0/8] Migrate Pages in lieu of discard To: Dave Hansen Cc: LKML , Linux MM , Yang Shi , David Rientjes , Huang Ying , Dan Williams Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 244D73D663 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: On Mon, Jun 29, 2020 at 4:48 PM Dave Hansen wrote: > > I've been sitting on these for too long. Tha main purpose of this > post is to have a public discussion with the other folks who are > interested in this functionalty and converge on a single > implementation. > > This set directly incorporates a statictics patch from Yang Shi and > also includes one to ensure good behavior with cgroup reclaim which > was very closely derived from this series: > > https://lore.kernel.org/linux-mm/1560468577-101178-1-git-send-email-yang.shi@linux.alibaba.com/ > > Since the last post, the major changes are: > - Added patch to skip migration when doing cgroup reclaim > - Added stats patch from Yang Shi > > The full series is also available here: > > https://github.com/hansendc/linux/tree/automigrate-20200629 > > -- > > 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 part of a larger patch set. If you want to apply these or > play with them, I'd suggest using the tree from here. It includes > autonuma-based hot page promotion back to DRAM: > > http://lkml.kernel.org/r/c3d6de4d-f7c3-b505-2e64-8ee5f70b2118@intel.com > > 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 > I have a high level question. Given a reclaim request for a set of nodes, if there is no demotion path out of that set, should the kernel still consider the migrations within the set of nodes? Basically should the decision to allow migrations within a reclaim request be taken at the node level or the reclaim request (or allocation level)?