Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp584873pxu; Fri, 4 Dec 2020 10:15:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzY+JKKEKfrCGVkvcYWtDeLlHpGWZsRFLiMsnpjeO4x1KXO1FkLOFLKSMNIIUUdgqjIAGHN X-Received: by 2002:a17:906:c45:: with SMTP id t5mr8204635ejf.370.1607105737954; Fri, 04 Dec 2020 10:15:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607105737; cv=none; d=google.com; s=arc-20160816; b=q82pkR2UNcPnP1QcdTamCbCPxqZjwKzhwyWArao/o2Oa2NIs2ZqemMnAYYofy9kSOk ajDj3sJ9A9Zictq6/RaaR7q9upWuDmJaL2z7eEsHvKqArOdtyFRG6coJD8SGTHp48tgm 0L006cVx/khXPe1c5s+V9cUppYELzhKEZiShzPvpfNe6Qv0pB2D8/US8Rxp6xseE9HEk w1BQwrHanYfnWB5umPG0P+it1JtL/9z/k6DvoyK1jijn1u9fXOA/C+zoYB8wTRcg2+Ib hFRkDkVXOkjLm3GM1TBzGJU3L24XXkcewe1thSzVjmdypB+OxU/CiSf/Y3m8qBoiX8jv AV0A== 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=7TbFtICM9MnAP10o9hujRLIgAYJwsDBNhsbYS5a5Dto=; b=I6lklgTR0hSAgzwJE634hBj3QP1ZZZDDcQA0guqwpgO9qD2+lf2bEqftEKzStYggLv nuB4sC9UhkQhQaPLZhWhU9i7KTaANKMYbFZ4Yr4bxyFJBmcNMCMmGdKGrOEtM/GGqW+4 obO4GE2rsKPwZ5fRY+Ew6fYDPbZf9Wo7ecgdjFNl91mtjOQ1mIXOCcuBtJEAcO7tviRA SmyX+MHZvSViL0f0LzpSmoNSMEU0lD4KU+drWPGCQuPqCVNm1sLsml7kIFd1iKXQw7v7 S9PamM5ioqJL2HP7snyESSrHI8H2JBUKgtEM/zeSwRKrhw0F0r1fwWm+lJrrAW/VYXRW YHEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=SX1y7EcH; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h13si3286220edv.588.2020.12.04.10.15.14; Fri, 04 Dec 2020 10:15:37 -0800 (PST) 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=@soleen.com header.s=google header.b=SX1y7EcH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729047AbgLDSLX (ORCPT + 99 others); Fri, 4 Dec 2020 13:11:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726330AbgLDSLX (ORCPT ); Fri, 4 Dec 2020 13:11:23 -0500 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93E82C0613D1 for ; Fri, 4 Dec 2020 10:10:42 -0800 (PST) Received: by mail-ej1-x644.google.com with SMTP id a16so10009004ejj.5 for ; Fri, 04 Dec 2020 10:10:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7TbFtICM9MnAP10o9hujRLIgAYJwsDBNhsbYS5a5Dto=; b=SX1y7EcHXJayxKB8wtz/I8F9ALqJlaLjkODLmZJcstDxiZmULC5nPLi9CQSh9J+d1s Ub4CCvLajGP8zKEzRIFEDx+9badI+tboymw1jJLi/0zFO511ABr2TD/mKEGoSm6gpZST HgwsLdK10Rn26FMa6ma74KmX5TLQn+kc4PecOAtajNx7M8qtV512thjDI6NvD/Iuro3K b6fDTClObrh4LdUWHhFRlbF12ULvTZWEGWBY+sCJ8j+v4QTPPvZylwOJ6P65jfmI2Rrk NWSCE8jfmwVgt1Te99bn6n+tWhzCITNbEeQpX6rLPnEN0/JmBQ5INlXGZOTwMSTtcgSO KKFg== 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=7TbFtICM9MnAP10o9hujRLIgAYJwsDBNhsbYS5a5Dto=; b=ZToUTXpqL6twK9L/ohWIYRHeChYIu6Ph2mQN/5RmHVHlVrknXa/LX7o5+Z/c6FbZJU 6aG4VvPkL9VORiSxzEIkifb2Kj5KuR8+1rLiD+8pTuKEgcfBkaWf7FQtOFCzTsxXxAII 9DJs2eYLqkfKkfbFxd1Hnzuxnd0oArL8jVgQ8EEbdaIXiR2SflOe7r3/8nM8rcS4VI3W rp7KXAhqyOpBGAUvU8CVCoUwC+gTp1SkJdRBoFzpyIb8SYRH2webrA1H+ouA1iZIkE5D N2ZjaM9qg3FJVEHn6rcvkok+rUXi/AUAzqxPb7xzIESbVqOuQkCUePIedj0apz+DL84z YNdg== X-Gm-Message-State: AOAM532BnBiiasmjAuW+C3onZsvPD6V0Nm+vKjyu6XeiVpOHFEpYEc5c XKS/+n4MwM0nRiKSgORrVAndVuzzjEb6Gx91e63EGg== X-Received: by 2002:a17:906:d41:: with SMTP id r1mr8080974ejh.383.1607105441362; Fri, 04 Dec 2020 10:10:41 -0800 (PST) MIME-Version: 1.0 References: <20201202052330.474592-1-pasha.tatashin@soleen.com> <20201204035953.GA17056@js1304-desktop> <20201204161005.GD5487@ziepe.ca> <593822e5-4e1a-fdca-5500-4138d0f2b728@redhat.com> In-Reply-To: <593822e5-4e1a-fdca-5500-4138d0f2b728@redhat.com> From: Pavel Tatashin Date: Fri, 4 Dec 2020 13:10:05 -0500 Message-ID: Subject: Re: [PATCH 0/6] prohibit pinning pages in ZONE_MOVABLE To: David Hildenbrand Cc: Jason Gunthorpe , Joonsoo Kim , LKML , linux-mm , Andrew Morton , Vlastimil Babka , Michal Hocko , Oscar Salvador , Dan Williams , Sasha Levin , Tyler Hicks , mike.kravetz@oracle.com, Steven Rostedt , Ingo Molnar , Peter Zijlstra , Mel Gorman , Matthew Wilcox , David Rientjes , John Hubbard Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > ZONE_MOVABLE can be configured via kernel parameter, or when memory > > nodes are onlined after hot-add; so this is something that admins > > configure. ZONE_MOVABLE is designed to gurantee memory hot-plug > > functionality, and not availability of THP, however, I did not know > > about the use case where some admins might configure ZONE_MOVABLE to > > increase availability of THP because pages are always migratable in > > them. The thing is, if we fragment ZONE_MOVABLE by pinning pages in > > it, the availability of THP also suffers. We can migrate pages in > > ZONE_NORMAL, just not guaranteed, so we can create THP in ZONE_NORMAL > > as well, which is the usual case. > > Right, we should document this at some place to make admins aware of > this. Something like > > "Techniques that rely on long-term pinnings of memory (especially, RDMA > and vfio) are fundamentally problematic with ZONE_MOVABLE and, > therefore, memory hotunplug. Pinned pages cannot reside on ZONE_MOVABLE, > to guarantee that memory can still get hotunplugged - be aware that > pinning can fail even if there is plenty of free memory in ZONE_MOVABLE. > In addition, using ZONE_MOVABLE might make page pinning more expensive, > because pages have to be migrated off that zone first." Thanks, I will add this. > > BTW, you might also want to update the comment for ZONE_MOVABLE in > include/linux/mmzone.h at the end of this series, removing the special > case of pinned pages (1.) and maybe adding what happens when trying to > pin pages on ZONE_MOVABLE. Will do it. Thank you, Pasha