Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1708359lqe; Mon, 8 Apr 2024 18:55:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+53V0Gsspskh5NVJ/BBAaKqHOK0rD93LdcO01TAPeQDA3kPgmlMoCNfU9fVImnXGLNzjOPTesHAg2gdzQBMZldsBo/UnO93Cyj2TCNQ== X-Google-Smtp-Source: AGHT+IGrD7zgDA9vg7tu7pKDdnMul5CkG5Chz/G98ihT5oOKsXlFiNY+cQdyV/r+YO57KZ09rW8k X-Received: by 2002:adf:f345:0:b0:33e:dbc0:773 with SMTP id e5-20020adff345000000b0033edbc00773mr9790264wrp.44.1712627757293; Mon, 08 Apr 2024 18:55:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712627757; cv=pass; d=google.com; s=arc-20160816; b=MeFsuxKtx/BCpaVITmS/T6YNQm/jLW7GqP/CgRlwoEKOaFqhNQDb9yugogBNGirC+r YUKqkIj9wWfzKqs0j5+h7mGBB7bYSeSDY28vN9sof/Y7TuCdmF0xHS8+86Kx9iy8S1YL KqhiiLTpHyXYzVoVxlVhDyQ+B7E/X+hMNg9sMMhqvG0Y3M1x2OTXYoKrOaO5mBpnqq2+ F+XQmb9xypUHsfFGcIz82XdFAv0n+h+BIFtucSxjhRfqBqdtkKTeD/DR93L5sEj977bL 4v8QKXrl7RsPpAhf/QI/VbkLhzNtRomRbV7cst13pEZCN9BKhd8IAuwk4Oncr7+E89CC MFvA== 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=WpB83Q6jtVrxpnbYwwxE7cxIiuFnaD0VzOFqDs3ujpQ=; fh=FHb5E1C8uemG+okaligTsb9xRsdxwU5AdKg7LABjUFo=; b=jLO8u/F0BJX3K+Gg/9P3XNAOMI/5Ntu4IB3JZlmAfTKGhMVN4DOwFsipDFAPL26e9H GW9zodUgj4Co2EwZiUE1d5oyFuorQu7igzsB71C2QLmav3wWimHhacRWRUXrzmfAkFu/ btLKAkKu9OIHIlzXb994HBi3X0r3mtoUEU8YG6TDta05Sw74nii+gufhPKhH/R3I9VEQ 5gsBpWFvOz3cTj816VGXeEtXGIbMALUUgh8SRYJ5PWYNXrUpAu7ggiOGVzvDyJjTsrws EJTgQQjG/9ISki7CVkQ4+V7u/h6JLjwbLm1f0ORAwREjvWl8n1syByrZM6V5VrKAti/m WOkg==; 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-136107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136107-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 js18-20020a170906ca9200b00a4e254fb272si3911792ejb.10.2024.04.08.18.55.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 18:55:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136107-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-136107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136107-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 07BAF1F23C2D for ; Tue, 9 Apr 2024 01:55:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FA0A4F606; Tue, 9 Apr 2024 01:55:51 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 003C44F5E6 for ; Tue, 9 Apr 2024 01:55:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712627751; cv=none; b=U/stSp5luHONg90Msbwu4zrAVu7EP5WCZsuqOYuWG+U8UgMNCb4Cz60v+z5qBi9p7UFXLcs+MrUs14dlYYTvGfx/UOomfMiiZNb7LTW84Asc+/OegISyMv4jhTyF46MCmDsPjOz+GzZOSdIPug6bKGmicoeFKwSD9hwnkyw1tXk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712627751; c=relaxed/simple; bh=QrWo7VVMPlVdZGBAfIR9p/74O2Cx2ajkw1xngK+YWt8=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=jDbpqZkB2B6/gc1FgQegykBiWBD7Mnpf/42syBgRFb6WY1om7AJZQFCR8MyPh7KXN8ZxbmJ8fvyYFRxOdSzDmAQx+Eq0lcYcMfNR+cC9eB7y6y6WnvrfUbqeTVFHt4wOKsX2e4HazWXP4S+8pvHKBvHWlRu0cnBcgfRuuXHffoc= 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.187 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.88.105]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VD89r6mytztRxm; Tue, 9 Apr 2024 09:53:04 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 9A210140124; Tue, 9 Apr 2024 09:55:46 +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; Tue, 9 Apr 2024 09:55:46 +0800 Subject: Re: [PATCH] mm/memory-failure: fix deadlock when hugetlb_optimize_vmemmap is enabled To: Andrew Morton CC: , , References: <20240407085456.2798193-1-linmiaohe@huawei.com> <20240408122955.82183316d06cfe32fbacad0e@linux-foundation.org> From: Miaohe Lin Message-ID: <7a0bdaac-73cc-fb90-d323-aa68444c7e54@huawei.com> Date: Tue, 9 Apr 2024 09:55:45 +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: <20240408122955.82183316d06cfe32fbacad0e@linux-foundation.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) On 2024/4/9 3:29, Andrew Morton wrote: > On Sun, 7 Apr 2024 16:54:56 +0800 Miaohe Lin wrote: > >> When I did hard offline test with hugetlb pages, below deadlock occurs: >> >> ... >> >> Fix this by calling drain_all_pages() instead. > > Thanks. I propose > > Fixes: 510d25c92ec4a ("mm/hwpoison: disable pcp for page_handle_poison()") IMHO this issue won't occur until commit a6b40850c442 ("mm: hugetlb: replace hugetlb_free_vmemmap_enabled with a static_key"). As it introduced rlock(cpu_hotplug_lock) in dissolve_free_huge_page() code path while lock(pcp_batch_high_lock) is already in the __page_handle_poison(). So it might be more appropriate to use: Fixes: a6b40850c442 ("mm: hugetlb: replace hugetlb_free_vmemmap_enabled with a static_key") > Cc: Thanks for doing this. > > . >