Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp385343pxb; Wed, 24 Feb 2021 05:03:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWwpYHYNTlHhgbRzZirwceoIG+S8AifKH+RPkGg7vf2wQseWuY/GYtg5CYuf4xcbLfhOLG X-Received: by 2002:a17:907:728b:: with SMTP id dt11mr30796864ejc.321.1614171799836; Wed, 24 Feb 2021 05:03:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614171799; cv=none; d=google.com; s=arc-20160816; b=o+bNIZRdNUJnzZdG/lhyIvFaon52YN0tbi/F4hHh6onS9ThfHMYkMeVEGTQs0KXXHM 56Z2qrhT4bbBzaCPWZGNfLo/HdmB9wNrORte7jjpqg5anmsXNhoN8WrZWY0DWq/jRmBC I7T/5SFBSDIvsTcmcV64oQvcOr9HBA3UkBll85eXECuJA0bLfc34YLulXGB6anaXuvgW 8Rcwz6iifxPYvBVE0GlwB/rSiZXNX3vPCtKMfQouRjqHNHJEJQZhf4ZvMLrVlYTyZIh3 V8jJeX4abBdnfisdx7hQdzplWovO/H8LXpgzMrCChXjf6DgB6VgULm+bcTrn/WguIAcd HxXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=PYsuo7Kcb71h5w7IjLqRE+pJATpUBbhpEgY70EwAiLA=; b=afRB5L0KGxuoTXY6ahOWiFFZL5qm+Sip6a4lH1YCfdoDI5Jv1wFrGU38cFPYLbhZVG rn6sid1BBmRUPwJEnA9Fd0q8bpCZB/7bCo7fD6ucmDQfw6fZtkh1FFN3xw+xqjj1HMlK qUnpoiSALlQNcTHJwyGydHW8ELp2AaYzRmEDnJm3e5YdhxxA1ecIOzmfMmnG0XfTKmsW y6Xfwl+CMOPaei+hA5Cxttw5OcHhlmu/Sr7w0RwTc+R6R+Pul/XMnEJzdhnzZawlyxYg hQdoD3fTJv00TyIBk/3LEj06Fia8eUx3B16HqYBKx9PhJpX2moZ3aBaNrwNAws6Wc+2V 5tcw== 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 8si1265467ejz.244.2021.02.24.05.02.54; Wed, 24 Feb 2021 05:03:19 -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 S234274AbhBXIdL (ORCPT + 99 others); Wed, 24 Feb 2021 03:33:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:44288 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232563AbhBXIcj (ORCPT ); Wed, 24 Feb 2021 03:32:39 -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 F39D9AF3E; Wed, 24 Feb 2021 08:31:55 +0000 (UTC) Date: Wed, 24 Feb 2021 09:31:49 +0100 From: Oscar Salvador To: Muchun Song Cc: Mike Kravetz , Jonathan Corbet , Thomas Gleixner , mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, Peter Zijlstra , viro@zeniv.linux.org.uk, Andrew Morton , paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, Randy Dunlap , oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, Mina Almasry , David Rientjes , Matthew Wilcox , Michal Hocko , "Song Bao Hua (Barry Song)" , David Hildenbrand , HORIGUCHI =?utf-8?B?TkFPWUEo5aCA5Y+jIOebtOS5nyk=?= , Joao Martins , Xiongchun duan , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel Subject: Re: [External] Re: [PATCH v16 4/9] mm: hugetlb: alloc the vmemmap pages associated with each HugeTLB page Message-ID: <20210224083145.GA14894@linux> References: <20210219104954.67390-1-songmuchun@bytedance.com> <20210219104954.67390-5-songmuchun@bytedance.com> <13a5363c-6af4-1e1f-9a18-972ca18278b5@oracle.com> <20210223092740.GA1998@linux> <20210223104957.GA3844@linux> <20210223154128.GA21082@localhost.localdomain> <20210223223157.GA2740@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 24, 2021 at 11:47:49AM +0800, Muchun Song wrote: > I have been looking at the dequeue_huge_page_node_exact(). > If a PageHWPoison huge page is in the free pool list, the page will > not be allocated to the user. The PageHWPoison huge page > will be skip in the dequeue_huge_page_node_exact(). Yes, now I see where the problem lies. hugetlb_no_page()->..->dequeue_huge_page_node_exact() will fail if the only page in the pool is hwpoisoned, as expected. Then alloc_buddy_huge_page_with_mpol() will be tried, but since surplus_huge_pages counter is stale, we will fail there. That relates to the problem Mike pointed out, that we should decrease again the surplus_huge_pages. I think hwpoisoned pages should not be in the free pool though. Probably we want to take them off when we notice we have one: e.g: dequeue_huge_page_node_exact could place the page in another list and place it back in case it was unpoisoned. But anyway, that has nothing to do with this (apart from the surplus problem). -- Oscar Salvador SUSE L3