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=-3.8 required=3.0 tests=BAYES_00, 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 0412CC433DB for ; Thu, 18 Feb 2021 16:53:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 541C364EB4 for ; Thu, 18 Feb 2021 16:53:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 541C364EB4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9FC7A6B0006; Thu, 18 Feb 2021 11:53:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9ADBD6B006E; Thu, 18 Feb 2021 11:53:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 826B46B0071; Thu, 18 Feb 2021 11:53:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0106.hostedemail.com [216.40.44.106]) by kanga.kvack.org (Postfix) with ESMTP id 649346B0006 for ; Thu, 18 Feb 2021 11:53:30 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2CBFF6D67 for ; Thu, 18 Feb 2021 16:53:30 +0000 (UTC) X-FDA: 77831984580.17.value90_251124227656 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 14786180D0180 for ; Thu, 18 Feb 2021 16:53:30 +0000 (UTC) X-HE-Tag: value90_251124227656 X-Filterd-Recvd-Size: 2410 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Thu, 18 Feb 2021 16:53:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4BDE2ACD4; Thu, 18 Feb 2021 16:53:28 +0000 (UTC) MIME-Version: 1.0 Date: Thu, 18 Feb 2021 17:53:26 +0100 From: Oscar Salvador To: Michal Hocko Cc: Andrew Morton , Mike Kravetz , David Hildenbrand , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] mm: Make alloc_contig_range handle free hugetlb pages In-Reply-To: References: <20210217100816.28860-1-osalvador@suse.de> <20210217100816.28860-2-osalvador@suse.de> <20210218100917.GA4842@localhost.localdomain> <20210218133250.GA7983@localhost.localdomain> User-Agent: Roundcube Webmail Message-ID: <21c17c7429896cc259255340c6e3d61b@suse.de> X-Sender: osalvador@suse.de Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit 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 2021-02-18 14:59, Michal Hocko wrote: > As I've said. Page allocator can cope with NULL nodemask just fine. > I have checked the code and now remember the tricky part. It is > alloc_gigantic_page which cannot work with NULL nodemask because it > relies on for_each_node_mask and that, unlike zonelist iterator, cannot > cope with NULL node mask. This is the case only for !GFP_THISNODE. Ok, thanks for the clarification. > OK, I see the problem now. And your above solution is not really > optimal either. Your put_page would add the page to the pool and so it > could be used by somebody. One Yeah, that is right. > way around it would be either directly > manipulating reference count which is fugly or you can make it a > temporal page (alloc_migrate_huge_page) or maybe even better not > special > case this here but rather allow migrating free hugetlb pages in the > migrate_page path. I will have a look into it to see how what would look. Thanks for the feedback -- Oscar Salvador SUSE L3