Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp138903lqg; Wed, 10 Apr 2024 19:26:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXcnQQZk1UzyhnoWJRkM9m79NUB31F9Ej0vCo/V5+PZOlsEO5X2HmDCKK4yODUf/0DeJAHeIWT4t+9UsaHPsxpXDShCK374Fx5hMvx/Hg== X-Google-Smtp-Source: AGHT+IEAzptpT/3Jkkn08w/p8bnWhDp8lVCfPmNdS5igU5P/1800n1AQ08RTjIc0uwH59XXZ+LoE X-Received: by 2002:a50:f61a:0:b0:56e:2f39:c5d2 with SMTP id c26-20020a50f61a000000b0056e2f39c5d2mr2746295edn.7.1712802417766; Wed, 10 Apr 2024 19:26:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712802417; cv=pass; d=google.com; s=arc-20160816; b=SVu2ZRtXAhfDBVtrFgd/1fmgKSRoRd0Fi/2FTiPplhS8W3mQDIAIDwHPguBHRll8vD lo4Wkb/3mg+eYfsTrZmMdM53SQbEM5fFtcgRIUU30A3BkeKFAsKNf6hwQcdZX2A9IL3A mUxe74LEswjpP5rk6PIyjUGT/welFpAdDtxO0PBXmoFGeOgDy1xbnXLsKmbdpFmunA23 ZEVkv0l7diDNSqGln6bizha9fua9mEpj6sAElNAILquvmDmN+Lgxb6LFZkIGeKhkL2ZG D8W+qllMrGQ32xh6CQXEM4ivjW++yJ1LdqKcdDwpa7mLk0wpoX6/NziG2oaJZ1kgFycQ L2eA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:from:references:cc:to:subject; bh=l2ldr2Es4HV3nvdLxpT5S1zh2OUmYjlZ4Mb/WHKn5ak=; fh=VXFtQsvYI8tG2mzszSxlgyVSnbxDrGbKH9ru67Txkdw=; b=yYREECmbeLNVOYfw+uHgtbPwhxJhLzyeSeTNDBu/emsuvf/lsBkodk5emWPTUFucOj rP0f+wUf8Utlf0YSEp+d2KfXlRtbEipZKS0VWZz/SvTjAMoSJhGpVTtodfHCtlji0LYz np3hjX8nnDgNy/51IiLp2JCIAGkeT6lp2OqHwpx16ZLWxYYohewPNajQZRBRzy4wGfqS SgRHMPlWwtsL+D4iek6etXqPIHRPNU+jp+11bDCUNLjbyulstIM0GTrV6uxhW9T/WkzY ApJPs24zVbmWup9Du9B3vjNECcmp9fsXeMYgO+e+hPm/IjBgtQEX44QYftxU/HWuMMWh dh+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-139652-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139652-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l2-20020a50d6c2000000b0056e33366ec1si261468edj.399.2024.04.10.19.26.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 19:26:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139652-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-139652-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139652-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7E0F61F24EE4 for ; Thu, 11 Apr 2024 02:26:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 355D364CC0; Thu, 11 Apr 2024 02:26:50 +0000 (UTC) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83D1163417 for ; Thu, 11 Apr 2024 02:26:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712802409; cv=none; b=W9Zv5/fy1jVdhB9OTE01GBpsenCdZpJjBBcVe8cDXOEWM2Uoklngu6Hsb2W2GZpYNt1T8li1bpdj5MkeIwhhguN62s3sEV643EBTuI+Afkyb0KdcgU0urrOmaMHj/2Yzb9xZXsB4wDXKVgSV7CxTaDELxNFxXp/M9h+Ythaya50= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712802409; c=relaxed/simple; bh=8vXXG+d8ZnqIckkv5izWLMGEUrINe2wkChJeqUn5G2k=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=PWHBg82h1lm36yG9WfEMNNlp1bs6LHnVlau7JPlbC5soCzxyk3l7MwL5c1meKJRZaVZnttBONQ1ZvVC8JV+J3C9L3ngK+f4clLj69P7YrvLQ3rC6OWr7PjmcjEtZD2Lr2ZqCv3DNq/E+l9Wv2TjCsaKHJX+fjDSlJNXO90KUlO0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4VFNn84QNyz1ymsY; Thu, 11 Apr 2024 10:24:28 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 082B21A0172; Thu, 11 Apr 2024 10:26:45 +0800 (CST) Received: from [10.173.135.154] (10.173.135.154) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 11 Apr 2024 10:26:44 +0800 Subject: Re: [PATCH] mm/memory-failure: fix deadlock when hugetlb_optimize_vmemmap is enabled To: Oscar Salvador CC: , , , References: <20240407085456.2798193-1-linmiaohe@huawei.com> <13aa38af-46a1-3894-32bd-c3eb6ef67359@huawei.com> From: Miaohe Lin Message-ID: <247259aa-9c78-d1ae-c829-aa72adc75922@huawei.com> Date: Thu, 11 Apr 2024 10:26:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) On 2024/4/10 16:52, Oscar Salvador wrote: > On Wed, Apr 10, 2024 at 03:52:14PM +0800, Miaohe Lin wrote: >> AFAICS, iff check_pages_enabled static key is enabled and in hard offline mode, >> check_new_pages() will prevent those pages from ending up in a PCP queue again >> when refilling PCP list. Because PageHWPoison pages will be taken as 'bad' pages >> and skipped when refill PCP list. > > Yes, but check_pages_enabled static key is only enabled when > either CONFIG_DEBUG_PAGEALLOC or CONFIG_DEBUG_VM are set, which means > that under most of the systems that protection will not take place. > > Which takes me to a problem we had in the past where we were handing > over hwpoisoned pages from PCP lists happily. > Now, with for soft-offline mode, we worked hard to stop doing that > because soft-offline is a non-disruptive operation and no one should get > killed. > hard-offline is another story, but still I think that extending the > comment to include the following would be a good idea: > > "Disabling pcp before dissolving the page was a deterministic approach > because we made sure that those pages cannot end up in any PCP list. > Draining PCP lists expels those pages to the buddy system, but nothing > guarantees that those pages do not get back to a PCP queue if we need > to refill those." This really helps. Will add it in v2. Thanks Oscar. > > Just to remind ourselves of the dangers of a non-deterministic > approach. > > > Thanks > >