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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 00B60C433DB for ; Mon, 22 Feb 2021 10:51:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6714764E5C for ; Mon, 22 Feb 2021 10:51:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6714764E5C 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 D626E6B006C; Mon, 22 Feb 2021 05:51:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D10256B006E; Mon, 22 Feb 2021 05:51:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C26F48D0001; Mon, 22 Feb 2021 05:51:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id A956C6B006C for ; Mon, 22 Feb 2021 05:51:04 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 67FC21802ED98 for ; Mon, 22 Feb 2021 10:51:04 +0000 (UTC) X-FDA: 77845586448.09.0352676 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf06.hostedemail.com (Postfix) with ESMTP id 08475C0001EA for ; Mon, 22 Feb 2021 10:51:04 +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 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) X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 08475C0001EA X-Stat-Signature: y9oe5b8m8k7ykgp3id6ae5c9ot6ez6f7 Received-SPF: none (suse.de>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1613991064-470265 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 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