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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 9BD82C433FE for ; Fri, 4 Dec 2020 18:02:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1E24322BED for ; Fri, 4 Dec 2020 18:02:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E24322BED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 47DCA6B0036; Fri, 4 Dec 2020 13:02:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 42CE06B0068; Fri, 4 Dec 2020 13:02:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31C596B006E; Fri, 4 Dec 2020 13:02:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0119.hostedemail.com [216.40.44.119]) by kanga.kvack.org (Postfix) with ESMTP id 1C1906B0036 for ; Fri, 4 Dec 2020 13:02:15 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id CB8A5363C for ; Fri, 4 Dec 2020 18:02:14 +0000 (UTC) X-FDA: 77556368988.26.tank40_300beb2273c6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id A986A1804A305 for ; Fri, 4 Dec 2020 18:02:12 +0000 (UTC) X-HE-Tag: tank40_300beb2273c6 X-Filterd-Recvd-Size: 5224 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Dec 2020 18:02:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607104931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y+BVWlwmMR3/aIwVc1YDREePfrqw3RI1zvIRL+z1PQU=; b=a/ipt5zHUETGLOsQjJQpB9DTqS31Rj7Nynl/G/zaf3JMEH5JgxdAgi86/1cWzmYYzD4y6Z pY0ni7NrmfQuq5QmIF9mhT1Bn1LA1/t4z9hQ3r5Etz1/ZvQTc4qjaorRjKJgpb1i15475i hpjTkgSpLk7AdpwicZSZlIqDwpIOMkQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-138-PzeVPaOdO6GNlahLGsOC3w-1; Fri, 04 Dec 2020 13:02:06 -0500 X-MC-Unique: PzeVPaOdO6GNlahLGsOC3w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8ADAD1005513; Fri, 4 Dec 2020 18:02:03 +0000 (UTC) Received: from [10.36.112.162] (ovpn-112-162.ams2.redhat.com [10.36.112.162]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76B7C5D6A1; Fri, 4 Dec 2020 18:01:59 +0000 (UTC) Subject: Re: [PATCH 0/6] prohibit pinning pages in ZONE_MOVABLE To: Pavel Tatashin , Jason Gunthorpe Cc: 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 References: <20201202052330.474592-1-pasha.tatashin@soleen.com> <20201204035953.GA17056@js1304-desktop> <20201204161005.GD5487@ziepe.ca> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <593822e5-4e1a-fdca-5500-4138d0f2b728@redhat.com> Date: Fri, 4 Dec 2020 19:01:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 04.12.20 18:50, Pavel Tatashin wrote: >>> Yes, this indeed could be a problem for some configurations. I will >>> add your comment to the commit log of one of the patches. >> >> It sounds like there is some inherent tension here, breaking THP's >> when doing pin_user_pages() is a really nasty thing to do. DMA >> benefits greatly from THP. >> >> I know nothing about ZONE_MOVABLE, is this auto-setup or an admin >> option? If the result of this patch is standard systems can no longer >> pin > 80% of their memory I have some regression concerns.. > > 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." 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. -- Thanks, David / dhildenb