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=-8.3 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no 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 7CAF2ECE58E for ; Thu, 17 Oct 2019 16:01:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3564520872 for ; Thu, 17 Oct 2019 16:01:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="g5hMI5kx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3564520872 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 CA9088E0006; Thu, 17 Oct 2019 12:01:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C32868E0003; Thu, 17 Oct 2019 12:01:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B20808E0006; Thu, 17 Oct 2019 12:01:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0073.hostedemail.com [216.40.44.73]) by kanga.kvack.org (Postfix) with ESMTP id 8BEB28E0003 for ; Thu, 17 Oct 2019 12:01:43 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 2F668840F for ; Thu, 17 Oct 2019 16:01:43 +0000 (UTC) X-FDA: 76053742086.01.store94_ef49e79f5c22 X-HE-Tag: store94_ef49e79f5c22 X-Filterd-Recvd-Size: 5073 Received: from mail-yw1-f66.google.com (mail-yw1-f66.google.com [209.85.161.66]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Oct 2019 16:01:42 +0000 (UTC) Received: by mail-yw1-f66.google.com with SMTP id n11so1043220ywn.6 for ; Thu, 17 Oct 2019 09:01:42 -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=POEbKiu2fpwZ1QYGdQ3ulL/vn9gYu3XJ/PYCzV6tS1M=; b=g5hMI5kxqdtZ26qFVTG0mIIHzCTy2wv7pAqugF2x0aOmsZRu3JJOMH49Vgj5WvQaUI PT2t4M/hIdmFhIGsKjToPX7xZkUNPjIqxowbDYhXNUDNnVhnVS+EjnKJiw/FEfXx68KK XYdF86TxjqCN94emMWZ2iSp3U+mZWflTkLqcJf4NLI26lmuQ0t1Pqd10vDwxCAXxwupx m/n708oPr4x8pp1Y/Xw9/oa6VwHT4kRs6FxvRM5tehLqezrS7MDWfQI/vlUm8bQtC/J/ YdZSRf1KE/gjgr9U2g2o8ug9nytMu4mQ3id8dcfNno1rIfjjt2qIVNR/bv3/QsoVl9r5 Z19g== 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=POEbKiu2fpwZ1QYGdQ3ulL/vn9gYu3XJ/PYCzV6tS1M=; b=EehcQ+9WSDVn8wVJfyvPyViAUp5At/RPgKkhJo1ebhEyWBzs31wrRaxDJR36TbRdf3 Rg9YmwOVOHFOm2lhEl4qLgB4m/YF/tmGPwYiF/VMDiQ5Zqf71IscGunr+Zt1s2g0egSR d/TpIbj1TAxx1bLxAat4/1+K+lzSPnKONuXcEZmMDr9IyN0oiL4jgiFLkXZzVpg13/0R ThSqyEV/6Ug0q9N2jQ+wwbZog0iPHuEsSz/8myu6eLOHtfLMQT2VkOl2TA67ABYzvxjK CLOod6NfuYyhucT9MY2D2+RD/wWztzvhRjn+Sy6A2DKQfUxEJMtrYLFOPYl8P5RKsIWW xXQA== X-Gm-Message-State: APjAAAVLaZDKyntBum4LtlPIpFI7IvZf/hMnfTB6IbCpd67H/Q83/GXc Ybt56+ppR43Xqpaia/WKaT71NIp9srBHEk6mMsfeuQ== X-Google-Smtp-Source: APXvYqyafii/mt+JYS5iwe9OB8ELAj+7pFClz4MBP4sDjY3OuO43IiyT/gJaF5D4PC/yxshcUBDxdMllcXti4wpM+sw= X-Received: by 2002:a81:2d41:: with SMTP id t62mr3387017ywt.368.1571328100270; Thu, 17 Oct 2019 09:01:40 -0700 (PDT) MIME-Version: 1.0 References: <20191016221148.F9CCD155@viggo.jf.intel.com> In-Reply-To: <20191016221148.F9CCD155@viggo.jf.intel.com> From: Suleiman Souhlal Date: Fri, 18 Oct 2019 01:01:28 +0900 Message-ID: Subject: Re: [PATCH 0/4] [RFC] Migrate Pages in lieu of discard To: Dave Hansen Cc: Linux Kernel , linux-mm@kvack.org, dan.j.williams@intel.com Content-Type: text/plain; charset="UTF-8" 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 Thu, Oct 17, 2019 at 7:14 AM Dave Hansen wrote: > > 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 > We prototyped something very similar to this patch series in the past. One problem that came up is that if you get into direct reclaim, because persistent memory can have pretty low write throughput, you can end up stalling users for a pretty long time while migrating pages. To mitigate that, we tried changing background reclaim to start migrating much earlier (but not otherwise reclaiming), however it drastically increased the code complexity and still had the chance of not being able to catch up with pressure. Because of that, we moved to a solution based on the proactive reclaim of idle pages, that was presented at LSFMM earlier this year: https://lwn.net/Articles/787611/ . -- Suleiman