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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 2917BC433FE for ; Fri, 4 Dec 2020 18:10:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A295322C7D for ; Fri, 4 Dec 2020 18:10:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A295322C7D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B75AD6B0036; Fri, 4 Dec 2020 13:10:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B4C146B0068; Fri, 4 Dec 2020 13:10:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3CE36B006E; Fri, 4 Dec 2020 13:10:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id 8D10B6B0036 for ; Fri, 4 Dec 2020 13:10:44 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 568CD181AEF1D for ; Fri, 4 Dec 2020 18:10:44 +0000 (UTC) X-FDA: 77556390408.20.mind90_0f01a8f273c6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 14FDC180C0614 for ; Fri, 4 Dec 2020 18:10:43 +0000 (UTC) X-HE-Tag: mind90_0f01a8f273c6 X-Filterd-Recvd-Size: 5078 Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Dec 2020 18:10:42 +0000 (UTC) Received: by mail-ej1-f67.google.com with SMTP id lt17so10015984ejb.3 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=n3mQEF9wWkz/MkI15aPD8WsLI9j9WcbkucnErE8jDZYMojRbp+JINPdZFy1re/cB+N ghROGaGWeEHTzEB2QpLvnkVtwTEhe3PXQpaA2UX4TU4VAUU9DH8ZOOjTy7+TcW7nHefv NX/yToFl+G2dmrWCzqv2nzeEDIvgyX+B9zLU1BloVF2FHevNC0rAV3gDG7JiRxex5Kvy wfE4spc2sYJSp/Q+WI8UlW/OtwIwtbOSu9x4lTg9dCSdn9jQuXDTBuRTa3pvmsvpM1Cl oDVxgeKIHJEYTgdQpivgKJ419eluXrPfsz44DS//11lCIqOWAlxe43vnUkBwVxBdxmJe Z+0A== X-Gm-Message-State: AOAM53047It3FcrR9kZOjqDzQQI6xSAE8M9AnZ0QX7HB9AB4wLPTcjfC zbBO9nN2fiyXQMnQo5O5NoAOtpbOOcM5a5TlGWdHYA== X-Google-Smtp-Source: ABdhPJwyUfWpho6yeil7W1EbhJnZVgB2REj45sCW4XZOBjgooF8hN9QNnxzvInK3hs8HyzZtXisHnOWp+/7+p9LG8y0= 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" 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: > > 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