Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1471282pxb; Mon, 22 Feb 2021 02:52:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJykk0mG8SHndrDXwfDmMOFTvaFxZR7Yo7w2F4++3o1YF7bOsNBf6LVZaWP5KKpI5zet9BjM X-Received: by 2002:a05:6402:2707:: with SMTP id y7mr21249904edd.5.1613991157326; Mon, 22 Feb 2021 02:52:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613991157; cv=none; d=google.com; s=arc-20160816; b=fqrc5F6NUiYPelDvgsjZHRTNuVlYsfWweRxQr0BAgpyw2PY4aAfhuxCe6knrajcBLo OXn5uT2gBD/TkvH9yPYnSXVaYQIjE9lMdOQ6EMvVjj2BMdpI6rkOa/f3+9Iy9OL1jWih g8AwUYudhjwu+22yYAC5AZDhq3RZv+nU8EvWE7SsjfSBkgqDZznNh5ePNWg0ESyqKiui KnJTb8BU5P1a7CLpGlzj2ZcixxFQAsThcl+z+FtEsDhQvGgJziWxdCduwUUcRauJ0TZ/ RpMSxe3rDXPtrrsBNSvp4y/Vt8iVWAOseMeAcbJrkWGkM2Ee3or2FEfGEIoMOFq/J4YN zLnA== 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=JMk/wCl4KqkpvzsQMigw75mDAzfA0+azS29od+YK8mY=; b=auvxY8Z4B+5Fl8szKkG5oi8RuSJUy92OTVUfsNWisoNuhymC792sO+rJO0z7IbMFfC hvkJiifrKjvqS6O44xZFVOh5zVOMsiABeUxx0L2czfd2OnPGJ79AkrVzRcpuvigbmGXS APO1s2H+o1wFYYBrwjiMMQIzbeMdc+h74RB6POsKczwUa4YTQ9s3uQ/qd5Gy0WsOpuRr CP0KPIdi23wxE9TrH3q4wxNCxtZRMJAztgbi0A+dlflv3z+2nwXDRZTtB/Y2Mj8nmBh/ gGI3IUb48HnmOw93/me0bTzMzBnG6FSqvg08VXKvos6hxR6uAn/NNyQDE3hcmakh1kIq 0sRQ== 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 g12si12085904edj.22.2021.02.22.02.52.14; Mon, 22 Feb 2021 02:52:37 -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 S230318AbhBVKvq (ORCPT + 99 others); Mon, 22 Feb 2021 05:51:46 -0500 Received: from mx2.suse.de ([195.135.220.15]:45744 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230270AbhBVKvo (ORCPT ); Mon, 22 Feb 2021 05:51:44 -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 5B719AFE1; Mon, 22 Feb 2021 10:51:02 +0000 (UTC) Date: Mon, 22 Feb 2021 11:50:56 +0100 From: Oscar Salvador To: Muchun Song Cc: Michal Hocko , Jonathan Corbet , Mike Kravetz , 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 , "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: <20210222105051.GA23063@linux> References: <20210219104954.67390-1-songmuchun@bytedance.com> <20210219104954.67390-5-songmuchun@bytedance.com> 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 Mon, Feb 22, 2021 at 06:31:12PM +0800, Muchun Song wrote: > On Mon, Feb 22, 2021 at 5:25 PM Michal Hocko wrote: > > > > On Sat 20-02-21 12:20:36, Muchun Song wrote: > > > On Fri, Feb 19, 2021 at 10:12 PM Michal Hocko wrote: > > [...] > > > > What about hugetlb page poisoning on HW failure (resp. soft offlining)? > > > > > > If the HW poisoned hugetlb page failed to be dissolved, the page > > > will go back to the free list with PG_HWPoison set. But the page > > > will not be used, because we will check whether the page is HW > > > poisoned when it is dequeued from the free list. If so, we will skip > > > this page. Not really. If the huge page is dissolved, we will take the page out of the the freelist. See take_page_off_buddy in memory_failure_hugetlb. In an ideal world, we should inspect that page in free_pages_prepare(), remove the HPWpoisoned page and process the others, without letting that page hit Buddy. And not only for hugetlb, but for any higher order page. See how memory_failure() happily disengage itself when it finds a higher order page. It does it because we have the premise that once that page hits Buddy, it will stay there as the check_new_page guards us. But this has been proofed to be quite a weak measure, as compaction does not performs such a check, and so the page can sneak in. I fixed that for soft-offline, and for memory-failure in some cases, but more needs to be done and is it in my TODO list. > > Can this lead to an under provisioned pool then? Or is there a new > > hugetlb allocated to replace the poisoned one? > > Actually, no page will be allocated. Your concern is right. But without > this patch, the result does not change. e.g. The HW poisoned page > can fail to be dissolved when h->free_huge_pages is equal to > h->resv_huge_pages. But no one seems to have reported this issue so > far. Maybe this behavior needs improvement in the feature. Yes, something to improve. I shall have a look. -- Oscar Salvador SUSE L3