Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp732555ybf; Fri, 28 Feb 2020 06:40:07 -0800 (PST) X-Google-Smtp-Source: APXvYqx0dmyEPfxW1h5G6wAq4uA1Eh5S7gxI86TXtcuogWr/cPekcZSD52NTbxY+mQCVhmaYRihl X-Received: by 2002:a9d:7d87:: with SMTP id j7mr3432841otn.159.1582900807282; Fri, 28 Feb 2020 06:40:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582900807; cv=none; d=google.com; s=arc-20160816; b=YbWZIaiTTgw+FCB6tXJiiGpjz6V6qkgVhnrpZ49peo6DJlGSF/gD6a4V0dQsbhOKvP LzeVVcYmLI1/JhHSUNWgzwaWqufzgdSAO3ynXL4ajbYlGVGkD67AXaNDTeS0BValFYty wKrWFz94uBmfmW7qc029OBnFbNBwLkx4MTfBBVbyh4bkhZT3g2Dx2KHudHph0SbmHBdY Kr3UPzXxW5C7ySvXBbmq1WT1UjTfL/Ic4Dg6o3jWX5QBY+Fiep3Qboh2s1e4bZIKtRZB ScP7agbkeDU1S4jNpWV4de5EX0Swyflrm4dbu16hkW9VOzEW7UkSyJVPJUtNLpnrQzN/ LflQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=aAGl6zzpnbWRdkzxsFtfErLrdN8rFjMnOGgIN8GcdeM=; b=YKjVoUWko3jN6X969qARclMt2JCYt4IO1NdtnZeKPAEx5oi6SNDH1Xt8P0bPEPReOX HImXsI4KHO1Nzi5quM6dBaNHiEbvCnBdj9EhBOuP1P/P2Kg2RsFKWxmQK76Ibv7sGlV6 42vqmPPzDASpyO85JW66tc1q+dsQHUJkAWeSW7zhJYusy9+ZsVtJ2+mQBw90p4ekFhMM uBjSNgWw5BrIqRyBmpVA9H0O77IBMJlnYQKfInC544HHQzrCbQWssKhQXwGRau3fRE0O pPC1qYgxdpu4T8NXORJqsr/72FB2OYRo/NH/ICGYVmn1PHC6xXMypq5yrKRPg2ydoRQM Y43w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a22si1693381otp.84.2020.02.28.06.39.53; Fri, 28 Feb 2020 06:40:07 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726805AbgB1Ojl (ORCPT + 99 others); Fri, 28 Feb 2020 09:39:41 -0500 Received: from mx2.suse.de ([195.135.220.15]:54742 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726682AbgB1Ojl (ORCPT ); Fri, 28 Feb 2020 09:39:41 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0DBC1B147; Fri, 28 Feb 2020 14:39:39 +0000 (UTC) Subject: Re: [PATCH v2 2/2] mm,thp,compaction,cma: allow THP migration for CMA allocations To: Rik van Riel , Mike Kravetz , linux-kernel@vger.kernel.org Cc: kernel-team@fb.com, akpm@linux-foundation.org, linux-mm@kvack.org, mhocko@kernel.org, mgorman@techsingularity.net, rientjes@google.com, aarcange@redhat.com, ziy@nvidia.com References: <20200227213238.1298752-2-riel@surriel.com> <7800e98e3688c124ac3672284b87d67321e1c29e.camel@surriel.com> <67185d77-87aa-400d-475c-4435d8b7be11@suse.cz> <47198271414db19cecbfa1a6ea685577dad3a72c.camel@surriel.com> From: Vlastimil Babka Autocrypt: addr=vbabka@suse.cz; prefer-encrypt=mutual; keydata= mQINBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+ 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97MVsQ+q2SYjJRBBH4 8qKhphADYxkIP6yut/eaj9ImvRUZZRi0DTc8xfnvHGTjKbJzC2xpFcY0DQbZzuwsIZ8OPJCc LM4S7mT25NE5kUTG/TKQCk922vRdGVMoLA7dIQrgXnRXtyT61sg8PG4wcfOnuWf8577aXP1x 6mzw3/jh3F+oSBHb/GcLC7mvWreJifUL2gEdssGfXhGWBo6zLS3qhgtwjay0Jl+kza1lo+Cv BB2T79D4WGdDuVa4eOrQ02TxqGN7G0Biz5ZLRSFzQSQwLn8fbwARAQABtCBWbGFzdGltaWwg QmFia2EgPHZiYWJrYUBzdXNlLmN6PokCVAQTAQoAPgIbAwULCQgHAwUVCgkICwUWAgMBAAIe AQIXgBYhBKlA1DSZLC6OmRA9UCJPp+fMgqZkBQJcbbyGBQkH8VTqAAoJECJPp+fMgqZkpGoP /1jhVihakxw1d67kFhPgjWrbzaeAYOJu7Oi79D8BL8Vr5dmNPygbpGpJaCHACWp+10KXj9yz fWABs01KMHnZsAIUytVsQv35DMMDzgwVmnoEIRBhisMYOQlH2bBn/dqBjtnhs7zTL4xtqEcF 1hoUFEByMOey7gm79utTk09hQE/Zo2x0Ikk98sSIKBETDCl4mkRVRlxPFl4O/w8dSaE4eczH LrKezaFiZOv6S1MUKVKzHInonrCqCNbXAHIeZa3JcXCYj1wWAjOt9R3NqcWsBGjFbkgoKMGD usiGabetmQjXNlVzyOYdAdrbpVRNVnaL91sB2j8LRD74snKsV0Wzwt90YHxDQ5z3M75YoIdl byTKu3BUuqZxkQ/emEuxZ7aRJ1Zw7cKo/IVqjWaQ1SSBDbZ8FAUPpHJxLdGxPRN8Pfw8blKY 8mvLJKoF6i9T6+EmlyzxqzOFhcc4X5ig5uQoOjTIq6zhLO+nqVZvUDd2Kz9LMOCYb516cwS/ Enpi0TcZ5ZobtLqEaL4rupjcJG418HFQ1qxC95u5FfNki+YTmu6ZLXy+1/9BDsPuZBOKYpUm 3HWSnCS8J5Ny4SSwfYPH/JrtberWTcCP/8BHmoSpS/3oL3RxrZRRVnPHFzQC6L1oKvIuyXYF rkybPXYbmNHN+jTD3X8nRqo+4Qhmu6SHi3Vq Message-ID: Date: Fri, 28 Feb 2020 15:39:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <47198271414db19cecbfa1a6ea685577dad3a72c.camel@surriel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/28/20 3:32 PM, Rik van Riel wrote: >>> Does that need to be the following, then? >>> >>> if (PageTransHuge(head) && !PageHuge(page) && !PageLRU(head) >>> && >>> !__PageMovable(head)) >>> return page; >> >> I would instead make it an "else if" to the "if (PageHuge(page)...)" >> above. > > That was my first thought too, but that could break on > pages that are PageHuge when hugepage_migration_supported > returns true. Right, so then if (PageHuge()) { if (!migration_supported) return false; } else if (!PageLRU(head) ...) { etc... IMHO it's better than adding more tests to the second if.