Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3655814pxj; Tue, 15 Jun 2021 05:57:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyvrP86HCRAaiCNM3/jzpzekZzkWenpTxxnDWOA+WrhRptHskddLpHx+X3MqowX68iIPFu X-Received: by 2002:a05:6638:151:: with SMTP id y17mr21565087jao.128.1623761878691; Tue, 15 Jun 2021 05:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623761878; cv=none; d=google.com; s=arc-20160816; b=tNf94LH+XpnWT9veNWpdwCjE+69xqdbSXmWi0WgDJeOGiPBQZpJZ8OThj+YVPQ3bqZ dqUHZ9OcmPhySPPq3TNXHQGbQtmIKOilPmEGanP92JMoIEP1dsHcwprc7MPSDSCUnu1x HHrZmtP3YTZdUsbJGTT6svMt0W0hCiT/1PXK3feIg23+RgcjYyFfHOr+xo8C5waBd09x 8cdk4EALnOdWz6/bbBR8laGBEBABDdZhCgoSL4YZreJlNT7mzdJ8x+4Xfd4Thuie4oDr rhTAHe3BrrCCQUVOxC/wreHN8XxO1a4laZZgYnKmhjPMp48uMeAuZ4zrHMNm1Jm+SPb0 EyAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=u3ZakH7ezXC1/ruuxXEYLCLfR7leQy1cNU6QiQEPmyM=; b=smHefUlfmW6dSkFH5bl+NVGtzr/rjBf8OzA3WhDYOBgXpWAryFDgzZVtzDqr/whTYt IivujU2nd8SagCoARg5HrqztijJlU6Vun7S9NORPDF3fkzAi10YR3zASJsnZXM9SlBlR +XZ2p2OKNRpd+uIXGUUFPB0PUOjPZyfJzDGJHNphS1JlnTCQ5lZNhNo3bwHPpJpBlNFw ZbAaH9CP0r/9voNIfjWH8rvqxFSzsOpvqUF/53kKZEzbJ+DAy4LY95tG/8TmR1+jlx2w X4zYEIErpZ22b4LaYxMWu8RoAmg0zvsx7AMWKH9Aj3MPHrgi9N2Yk0IPfbCHLqJcqyQP ZiOQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sangfor.com.cn Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w21si1242258jal.38.2021.06.15.05.57.46; Tue, 15 Jun 2021 05:57:58 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sangfor.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230184AbhFOM7S (ORCPT + 99 others); Tue, 15 Jun 2021 08:59:18 -0400 Received: from mail-m118208.qiye.163.com ([115.236.118.208]:48084 "EHLO mail-m118208.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230161AbhFOM7S (ORCPT ); Tue, 15 Jun 2021 08:59:18 -0400 Received: from [0.0.0.0] (unknown [116.24.56.76]) by mail-m118208.qiye.163.com (Hmail) with ESMTPA id 2A0CFE03EC; Tue, 15 Jun 2021 20:57:10 +0800 (CST) Subject: Re: [PATCH v1 2/6] mm/hwpoison: remove race consideration To: Naoya Horiguchi , linux-mm@kvack.org Cc: Andrew Morton , David Hildenbrand , Oscar Salvador , Michal Hocko , Tony Luck , "Aneesh Kumar K.V" , Naoya Horiguchi , linux-kernel@vger.kernel.org References: <20210614021212.223326-1-nao.horiguchi@gmail.com> <20210614021212.223326-3-nao.horiguchi@gmail.com> From: Ding Hui Message-ID: <25c69dc8-0ce2-8330-dfb0-506481dc9a53@sangfor.com.cn> Date: Tue, 15 Jun 2021 20:57:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210614021212.223326-3-nao.horiguchi@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZGU0fTlZIT0MdSBpPQ0hPTUNVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWUFZT0tIVUpKS0 hKTFVLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6KxA6Qxw4Kz8KK0hDTxY#PCxK GjQKFEpVSlVKTUlITE1KQ0hKTE5DVTMWGhIXVR8SFRwTDhI7CBoVHB0UCVUYFBZVGBVFWVdZEgtZ QVlKSk1VSU9VTk1VTE1ZV1kIAVlBSUxCSjcG X-HM-Tid: 0a7a0fbf46472c17kusn2a0cfe03ec Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/6/14 10:12, Naoya Horiguchi wrote: > @@ -1956,17 +1938,6 @@ int unpoison_memory(unsigned long pfn) > goto unlock_mutex; > } > > - /* > - * unpoison_memory() can encounter thp only when the thp is being > - * worked by memory_failure() and the page lock is not held yet. > - * In such case, we yield to memory_failure() and make unpoison fail. > - */ > - if (!PageHuge(page) && PageTransHuge(page)) { > - unpoison_pr_info("Unpoison: Memory failure is now running on %#lx\n", > - pfn, &unpoison_rs); > - goto unlock_mutex; > - } > - if a huge page is in process of alloc or free, HUGETLB_PAGE_DTOR can be set after __SetPageHead() or be cleared before __ClearPageHead(), so this condition may be true in racy. Do we need the racy test for this situation? > if (!get_hwpoison_page(p, flags)) { > if (TestClearPageHWPoison(p)) > num_poisoned_pages_dec(); -- Thanks, - Ding Hui