Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp184451img; Thu, 21 Mar 2019 17:22:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxldjT3V1SKgCuZJHZQONypgG7nbfsQHfI9vxnqCtJyIVbgZk+xuhvZ3i+QJrlSxqX4jPbi X-Received: by 2002:a17:902:e40a:: with SMTP id ci10mr6521732plb.77.1553214135350; Thu, 21 Mar 2019 17:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553214135; cv=none; d=google.com; s=arc-20160816; b=QBqQK29zN5l6iKUZaj/pTJV8IiqXHoA+KtFH7P1tYG/kFtdYOdvspYaRr7DZXtMbEC wUB+d/BBkIB3LODR7NEZJP3rdUVGEsaWthHU/wwlaGQlNSIo39u2BIstQeB+4G25urZv oJXaaPx0EH29l18eU6Ay9XNPuLG7wh14F8FBeBBxVUmG1/XgJ7a4Nu/gSI/SyYDFPP57 +k2pGtr4qnsMGR9/8CU9g6sV7qz65XOQMjesh/hA4bmUrrTHcDSumI8TNeYlVtyWcAlf p+z9XFetjYk6N40F2cfqGJs/nOXobZeo5DSykCa4pTFEheczHq+Sb/5sPVlB9+nqV+NG OIhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=Uz5tWnTog3rM6fg5Ngw8SgW9XsFI4Vq/7X9KTfiskDU=; b=QTus8jhHr+fXP8PckuqRFvVgiB4r9PPPi7VTpYQhLeN0BAtqTkDyl+wn1EiAQ/KHSY uLYwKY6K+VynjQoQEhCxvQ/5U7Sa/v3e3ydPQsRO4UF6RjiQFo9GumWwQw/ZTEMh4ayo iH1H+06uzzCi7N+VZg41ffW81Cwoshl5BR78n9AiWtTIO1y2TF9aIA4GImUQ8D3e3/Oe eJoSm3LWqVgFWHoc1RpqgzMmb5iF6pCY/8IE2oujrmoAg9dFi/35GCepHvD1qzu1/eLZ Um4zR4Om1g3gEIgqSvH6JdMROsWzbbgP9AcHQsCeS7MgGqclsDTriUdNWVJj0vpYy8/4 gWZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=OUWf6Gw+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7si5222689pgw.149.2019.03.21.17.21.58; Thu, 21 Mar 2019 17:22:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=OUWf6Gw+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727274AbfCVAU6 (ORCPT + 99 others); Thu, 21 Mar 2019 20:20:58 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:13963 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbfCVAU6 (ORCPT ); Thu, 21 Mar 2019 20:20:58 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 21 Mar 2019 17:20:54 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Thu, 21 Mar 2019 17:20:55 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Thu, 21 Mar 2019 17:20:55 -0700 Received: from [10.2.161.82] (172.20.13.39) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 22 Mar 2019 00:20:55 +0000 From: Zi Yan To: Yang Shi CC: Keith Busch , Linux Kernel Mailing List , Linux MM , , Dave Hansen , Dan Williams , "Kirill A. Shutemov" , John Hubbard , Michal Hocko , David Nellans Subject: Re: [PATCH 0/5] Page demotion for memory reclaim Date: Thu, 21 Mar 2019 17:20:54 -0700 X-Mailer: MailMate (1.12.4r5614) Message-ID: <2137A80F-CC90-411B-A1AF-A56384ADE0B8@nvidia.com> In-Reply-To: References: <20190321200157.29678-1-keith.busch@intel.com> <5B5EFBC2-2979-4B9F-A43A-1A14F16ACCE1@nvidia.com> <20190321223706.GA29817@localhost.localdomain> MIME-Version: 1.0 X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL103.nvidia.com (172.20.187.11) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: multipart/signed; boundary="=_MailMate_9EF958FC-2C3D-4B16-B110-D853B6A94A0D_="; micalg=pgp-sha1; protocol="application/pgp-signature" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1553214054; bh=Uz5tWnTog3rM6fg5Ngw8SgW9XsFI4Vq/7X9KTfiskDU=; h=X-PGP-Universal:From:To:CC:Subject:Date:X-Mailer:Message-ID: In-Reply-To:References:MIME-Version:X-Originating-IP: X-ClientProxiedBy:Content-Type; b=OUWf6Gw+d25DOwwrZFr8B4l1S5/2+gmyz3HbCPNqAa4MSiYXlu8ARZSYctb5BL2t/ ot9UPDdEwhPokhvRnzRvkMZGTa/7rIX2HalP7qeLEq5UZ4q4V3MVF2V0otnN3j/Alz 1oo0GfW0NYhgstx5oShsn30j1gfd27IHxez8PRV8bjFX1O3RbnQNqVRqKBjWHrvEiQ foMCb7gqfL4DGkzr6W3WEl8KBVGvyVWwsF4qn2OQsED+Fax7AAU7J5mPSNabRKbHPl PM9A8+UfV/UIUSZRotgE92fXx/k+BakJbniNn5JxvVvKK8n6+4ddCuv6B8v6kbxCTj ZnLIxEnIuIFSg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=_MailMate_9EF958FC-2C3D-4B16-B110-D853B6A94A0D_= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 21 Mar 2019, at 16:02, Yang Shi wrote: > On Thu, Mar 21, 2019 at 3:36 PM Keith Busch wro= te: >> >> On Thu, Mar 21, 2019 at 02:20:51PM -0700, Zi Yan wrote: >>> 1. The name of =E2=80=9Cpage demotion=E2=80=9D seems confusing to me,= since I thought it was about large pages >>> demote to small pages as opposite to promoting small pages to THPs. A= m I the only >>> one here? >> >> If you have a THP, we'll skip the page migration and fall through to >> split_huge_page_to_list(), then the smaller pages can be considered, >> migrated and reclaimed individually. Not that we couldn't try to migra= te >> a THP directly. It was just simpler implementation for this first atte= mpt. >> >>> 2. For the demotion path, a common case would be from high-performanc= e memory, like HBM >>> or Multi-Channel DRAM, to DRAM, then to PMEM, and finally to disks, r= ight? More general >>> case for demotion path would be derived from the memory performance d= escription from HMAT[1], >>> right? Do you have any algorithm to form such a path from HMAT? >> >> Yes, I have a PoC for the kernel setting up a demotion path based on >> HMAT properties here: >> >> https://git.kernel.org/pub/scm/linux/kernel/git/kbusch/linux.git/com= mit/?h=3Dmm-migrate&id=3D4d007659e1dd1b0dad49514348be4441fbe7cadb >> >> The above is just from an experimental branch. >> >>> 3. Do you have a plan for promoting pages from lower-level memory to = higher-level memory, >>> like from PMEM to DRAM? Will this one-way demotion make all pages sin= k to PMEM and disk? >> >> Promoting previously demoted pages would require the application do >> something to make that happen if you turn demotion on with this series= =2E >> Kernel auto-promotion is still being investigated, and it's a little >> trickier than reclaim. > > Just FYI. I'm currently working on a patchset which tries to promotes > page from second tier memory (i.e. PMEM) to DRAM via NUMA balancing. > But, NUMA balancing can't deal with unmapped page cache, they have to > be promoted from different path, i.e. mark_page_accessed(). Got it. Another concern is that NUMA balancing marks pages inaccessible to obtain access information. It might add more overheads on top of page = migration overheads. Considering the benefit of migrating pages from PMEM to DRAM is not as large as =E2=80=9Cbring data from disk to DRAM=E2=80=9D, the ov= erheads might offset the benefit, meaning you might see performance degradation. > > And, I do agree with Keith, promotion is definitely trickier than > reclaim since kernel can't recognize "hot" pages accurately. NUMA > balancing is still corse-grained and inaccurate, but it is simple. If > we would like to implement more sophisticated algorithm, in-kernel > implementation might be not a good idea. I agree. Or hardware vendor, like Intel, could bring more information on page hotness, like multi-bit access bits or page-modification log provided by Intel for virtualization. -- Best Regards, Yan Zi --=_MailMate_9EF958FC-2C3D-4B16-B110-D853B6A94A0D_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBAgAtFiEEh7yFAW3gwjwQ4C9anbJR82th+ooFAlyUKmYPHHppeUBudmlk aWEuY29tAAoJEJ2yUfNrYfqKleMP/RceC2q7vQiOE19ilpxcSX4iAX7dUwtbkZg0 YVrSR3WceWx6L62+6B9RYCGPZEnMYGm1UJFKG+wBAO7QsWv11lt1baBqtNn6ORSX tvgRMOVNW65YfCy/6vciv+nRuLkK/87aOF2nfie+RUIv6yt+KK0sWm1qN0x6vvHH AXNXNSz0yUpcJqOhktVOCyAdLcI16afxmLdYDReOpMinToKySZVUswpA/BMoX/qP zUH/96JflS5p8QGs07A8M1kGxG9shQldIEQIkbuOy3JuqAA4dr7q3mB9Kz3RKgwg iPKMpEFEZWmwSJfYFrr/frlwlua3HP+NHpfvlP3lZQJcFUyB2TAIkIbUtsZcDJ9R Z2Nb4CEE8MDusB3Fqg3KQE9cGJ++PFAA+QN2Y8UNBngi1Gcpjxxxd5JSdjI27R2c xRrYZQy6BYW3WgMg+jKq/Gjf2PHRal+KDV+ttuxTFp6pPMJpdt3MdylptI8it8jZ ro5yeu6yeV+fe9QkvlTrRKcvndSwANvx/H9ZWRdwKiHAnWWxChzq2fRaezOjNLzP VB+8/5uST6eg5+r/Z7TIkkwOT9mNjrxfgRqW6jRTMOe15JAJlzh1Za9REQgCQtLI HxvHdp0z0JkFBLwrtWCFkHeJsJ1vs7r6Red1h1ZjDYwHWH1OQ3X7qml6P1DzyFtY qFY2/Suf =+UmC -----END PGP SIGNATURE----- --=_MailMate_9EF958FC-2C3D-4B16-B110-D853B6A94A0D_=--