Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7471802pxb; Thu, 18 Feb 2021 10:54:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxoxi2Jhh6LDUOiworXS7atOzrCzCNqEq28uMG2WIrMQ+EWDMdwZQ2zjvz8eb0fpjZBA0A2 X-Received: by 2002:a05:6402:5211:: with SMTP id s17mr5407898edd.312.1613674473452; Thu, 18 Feb 2021 10:54:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613674473; cv=none; d=google.com; s=arc-20160816; b=aKvIxKgY0tAKXVnudOfNNkLkpJoI2FdltGvxPhjWBmsWHxVtEDPB4qupggujq9bi3O wS1BrOLCMa3h2wJ0DqAQ3A/QxdRvJLU6vrUzmmS5sswYYkjz3y9fXRplJR1EvTOem0HR mDEEI7ZNwRJodCeZlIi0YVyGEr9kSiV+Ca/dGMOWRLnvs2it3GMFP0xEY+WjG4YYcMGz XdjuMEaO4dcUV0nzLDTTPNE87/Bu8SRUZN3uNwG2nskW4OYdQCgyWYsidIK0+mFqNjIQ Bp4lxBhk8PpwyA6coKX/h3hTY93RdcG0Zs5U82/xBCjsvo2YGWSij2EdQLvmLKhYL5pr nQyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version; bh=X60HXNa6NQousdkpL1/9NT0HZE/9KZaNP/MCpN/1jN4=; b=jHb5/nYvuHXWPwiguO90uqakuy2F+aj/8GKGVnHQ9WyB1he+9cjhHVVbWij0XKLSXy oEE9ENdHjJOnfbyXzNGyf+Rkl/sCKGz+twykb6b9J8DgYXUWVFRYj4FbCBQX3AwLCPh1 HcUK/eAcGWZcDGw/FFLS3vPIpEKz5yJJ2IrkNQnJtpzKbH1E0aubwpC/B+BdbHSM+6J2 18ylSp23z/8S2Be7lTXnU0iQL1+R3Iwk36psJIEO+NeaUs/pNWfVlp5GLmc8GcylDKr5 c8FI57FPvlgAzBcnD0dv3mKwzPbfMUfIkEve2EgjU1gP0bSEb/QxARh0oUXfbSXovlzJ uG7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d15si3967794edq.404.2021.02.18.10.54.09; Thu, 18 Feb 2021 10:54:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230196AbhBRSxa (ORCPT + 99 others); Thu, 18 Feb 2021 13:53:30 -0500 Received: from mx2.suse.de ([195.135.220.15]:39468 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233430AbhBRQyJ (ORCPT ); Thu, 18 Feb 2021 11:54:09 -0500 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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