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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D98E9C433EF for ; Sun, 8 May 2022 00:31:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 261A66B0071; Sat, 7 May 2022 20:31:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E9416B0073; Sat, 7 May 2022 20:31:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03B1F6B0074; Sat, 7 May 2022 20:31:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id E1AA26B0071 for ; Sat, 7 May 2022 20:31:56 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B65E62F07F for ; Sun, 8 May 2022 00:31:56 +0000 (UTC) X-FDA: 79440698232.13.DB39D81 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf05.hostedemail.com (Postfix) with ESMTP id DE50E100066 for ; Sun, 8 May 2022 00:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651969915; 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=7oJ/pNGEcyEUOU4PfPLwqKmVyn82Hpz01lnvE5XFThg=; b=QXIeRfgzvt1lUO+2tFx08xj8+32wME8/0yjb8fncXOUe49PEu3T3p+SKYBzfamnLYhjglN hqPCjG3J5iaGIWArk7hZw59wZAZjf2298mFY/CrhYaW3rOLraF0+FWb8QqfruMTiCJQAPs hY9Q3WxJ/t96FiwQ6GVZiy+1LOkkrkM= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-lwS1QKgDOOS-jbF1JZh5hA-1; Sat, 07 May 2022 20:31:54 -0400 X-MC-Unique: lwS1QKgDOOS-jbF1JZh5hA-1 Received: by mail-qk1-f200.google.com with SMTP id 63-20020a370c42000000b006a063777620so821406qkm.21 for ; Sat, 07 May 2022 17:31:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=7oJ/pNGEcyEUOU4PfPLwqKmVyn82Hpz01lnvE5XFThg=; b=yaVhDIIKybQjHBTc5rZ0lnbOMgtUr7vT/yPuuTwkeWHI6+dI80LDCBf5uZ7yt5/R7a fscuXgRLIQ3FWv5oopwt/t8FYNfeM23wRsX8aYWnm/EY5zZ7skenoGw2oEUYx2U36hUs RO+xXpIx7oKxyky1C/gP8k/z0aE+Tp5zRpn98hRoL+cVOUowk7YwdhJurI2t+Elz86ZY qQPwlYWSXIc4Kni04wZ6VZceMEsfElnzUUa9hWJEnSVB0ysgiFxJ2naTpofr6yzSJ688 LoPUa2rm3XBr6BD9PCpLTl1EOqI7SSW1c+huAX7inde3VpsjoY7zuKS0X0+mpiQa10Tz harQ== X-Gm-Message-State: AOAM533bDDlT52IqyGKJacC+ZApbQpc40Zf3dN+LfWlvz6JSph5xrbPh U0rPM1Ci0StxCPgDICS9zoqp33dIVKZ+qg1u51FgRXAwMRlJuoHifZWzrR7KPWl6SYUVFezoDsi 3lT6lMxb2/ME= X-Received: by 2002:ae9:de47:0:b0:69f:8818:fe78 with SMTP id s68-20020ae9de47000000b0069f8818fe78mr7627078qkf.32.1651969914172; Sat, 07 May 2022 17:31:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYIJsa/PnyIM3Bnxy8zBrAyaPRSk7/RvDKyW0rFlL6k56vpQe0r5UM3VF5ScwkkDtgIa7QvQ== X-Received: by 2002:ae9:de47:0:b0:69f:8818:fe78 with SMTP id s68-20020ae9de47000000b0069f8818fe78mr7627071qkf.32.1651969913922; Sat, 07 May 2022 17:31:53 -0700 (PDT) Received: from [10.23.153.165] ([46.248.132.196]) by smtp.gmail.com with ESMTPSA id p185-20020a37bfc2000000b0069fc13ce24fsm4764442qkf.128.2022.05.07.17.31.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 May 2022 17:31:52 -0700 (PDT) Message-ID: <5480feb2-9b02-1c03-2396-d8cc75f981c9@redhat.com> Date: Sun, 8 May 2022 02:31:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] mm: fix is_pinnable_page against on cma page To: Peter Xu , Mike Kravetz Cc: Minchan Kim , Andrew Morton , linux-mm , LKML , John Hubbard , John Dias References: <20220502173558.2510641-1-minchan@kernel.org> <29d0c1c3-a44e-4573-7e7e-32be07544dbe@redhat.com> <08e9855c-395d-f40c-de3d-1ec8b644bfe8@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QXIeRfgz; spf=none (imf05.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: DE50E100066 X-Stat-Signature: pm6keyctw4e7zc4btukriyb7ow3r6pdd X-HE-Tag: 1651969900-650320 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 05.05.22 19:25, Peter Xu wrote: > On Thu, May 05, 2022 at 10:00:07AM -0700, Mike Kravetz wrote: >> Gigantic pages can only be migrated IF there is another (already allocated) >> gigantic page available. The routine to try and allocate a page 'on the fly' >> for migration will fail if passed a gigantic size. There 'might' be a free >> pre-allocated gigantic page. However, if the user set up CMA reserves for >> gigantic page allocations it is likely the free gigantic page is also in CMA. >> Therefore, it can not be used for this migration. So, unless my reasoning >> is wrong, FOLL_LONGTERM would almost always fail for gigantic pages in CMA. > > I'm probably not familiar enough with CMA, but.. I just noticed that if CMA > is destined to not be able to be pinned then maybe it'll lose quite a few > scenarios where pinning is a possible use case. It doesn't even need to be > the major use case, but as long as it's possible (e.g. hypervisors hosting > virtual machines with device assignment) it'll be a hard no to CMA, which > seems to be a pity. > Well, the same applies to ZONE_MOVABLE as well, unfortunately. Eventually, we might want to disable placing hugetlb pages on CMA areas if it turns out to be a problem. In case of ZONE_MOVABLE we can already fail "gracefully" when trying offlining (although that's really far from beautiful). -- Thanks, David / dhildenb