Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1201367lqe; Mon, 8 Apr 2024 01:32:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUtoXDwc6xDBfn+95FKqjhwm3bm3+zFGmg0nrwMMansch/pKHSGpsGqMhlxdFUTqC/CATgHfCU8nvkXBfNv6mogNd4dXfqracJH7EGE9Q== X-Google-Smtp-Source: AGHT+IH3YCv0GviynoHV5fdDZhk5y1BxCZN7p2uCjGXRsAro9474csUzyEmMFZ1JTYvX3aQaRHZ6 X-Received: by 2002:a0d:ea8b:0:b0:615:79f1:8297 with SMTP id t133-20020a0dea8b000000b0061579f18297mr7414001ywe.0.1712565157298; Mon, 08 Apr 2024 01:32:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712565157; cv=pass; d=google.com; s=arc-20160816; b=jixdRFlQNWozP5vSgvXRg7NBKWZb5137O4qlFD2cxbpy0M2ZQ0Sbc5smgQNH2IKSfn kKA9ok4klEO+4Ip1vi5WbzjdI6FjFa1XnFykdoONbXQD9sXfn7BWzfS75qnrPLfqsquL GX+jPko5XLfIhmek40JkUtkoqMLVQKZcXF0+BMk/6YweYo4xLq4OHuejdhzzllojaGi7 r8+X2SA9lBjyZ5rA+fqcM5QBPOuM51lRQwhjaVDKBrr3aAyinl3OhSJFvYAztqJGMJMj O/3SOkYPyFYi+XZ0SNlqs112vZs0zW12tor0COFQPa209JvoxVYWMrbJefcbjpaTnXVP ieAw== 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=2pY8oWkHbDSd61fhfHuDufnTCsO5ZnIy9x1GrwC8r14=; fh=bI49YtyAAAXNekuDJQqIPKOWfRZLeoJAnJMYOI3PFdA=; b=vy4/imVKl31ReB8CQySV2qu+BiFrshPdNgX/RI+MBJQWstKLi6rDRIhuhDffCVndqf CyDCSlBCxc+/74kTrk8wAVuYRWt28ua60B7nX9bWQpOqdoCMAb4Mqghee0FF1k4ASQv+ tunGr4SPAKY+hB4pgM/3uUWk76dDxs72FRWZjZ6m8RNNi+C197j7UrmwpytppJcjr2Ep ZMMW1LMpO7zJ+arTwNxo8y/kB1eiKYeoNtMM4QMp+X8AkODoj0PUPlO8uXpFsC3+iye7 5Gy4c3KSsONWiqyIU9sGo8PpZikRRKmiK3FhyWijP/nlg4BhSjiP5Gw42QOTJ/5awRbJ U4Eg==; 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-135045-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135045-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id b2-20020ac87fc2000000b004315aa17914si7755150qtk.311.2024.04.08.01.32.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 01:32:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135045-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-135045-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135045-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 624E61C21967 for ; Mon, 8 Apr 2024 08:32:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AFA9837149; Mon, 8 Apr 2024 08:32:04 +0000 (UTC) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (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 4086A39FFB; Mon, 8 Apr 2024 08:32:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.32 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712565124; cv=none; b=MvCN9Qi527H580GkGXX9cK3Tu5Z+IZtXlIukRbymHiNFP5s0KsRgYcAdzYNxAZrUrf9Mr2pMaSYc2jrX3uA4++4B+xXjmO/GNYeP52YmzbYW/xLbPcpQUVhbYr8gZsb4Sggn2dNalfPJVj+i0XYnXk2zetYI8xjjGrqBzmYM3hw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712565124; c=relaxed/simple; bh=uAmL+spAxj/+wCS8qccqTLgGxz6q90iFWSXXWlUjztM=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=BueAgU+vR9anFMhaPUx0UknRSNq9/RBtbrdRVRjVtiL7B1TRPcQ90yoMYBFzTtfFitIvTkBM5GGQ0MgLCEt+JIQb4Nr9W5clpKhprjO26OYEvwJptqEdfLEmIucICqnotzkdSkVjVL4X0/3tJ0ycfNjle5/T2+/pa3Ya5ArOOqM= 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.32 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.163]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4VCj3Y0W4Cz21kdL; Mon, 8 Apr 2024 16:31:05 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 95CA918002D; Mon, 8 Apr 2024 16:31:59 +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; Mon, 8 Apr 2024 16:31:59 +0800 Subject: Re: [PATCH] mm,swapops: Update check in is_pfn_swap_entry for hwpoison entries To: Oscar Salvador CC: , , David Hildenbrand , Peter Xu , , Tony Luck , Andrew Morton References: <20240407130537.16977-1-osalvador@suse.de> From: Miaohe Lin Message-ID: Date: Mon, 8 Apr 2024 16:31:58 +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: <20240407130537.16977-1-osalvador@suse.de> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) On 2024/4/7 21:05, Oscar Salvador wrote: > Tony reported that the Machine check recovery was broken in v6.9-rc1, > as he was hitting a VM_BUG_ON when injecting uncorrectable memory errors > to DRAM. > After some more digging and debugging on his side, he realized that this > went back to v6.1, with the introduction of 'commit 0d206b5d2e0d ("mm/swap: add > swp_offset_pfn() to fetch PFN from swap entry")'. > That commit, among other things, introduced swp_offset_pfn(), replacing > hwpoison_entry_to_pfn() in its favour. > > The patch also introduced a VM_BUG_ON() check for is_pfn_swap_entry(), > but is_pfn_swap_entry() never got updated to cover hwpoison entries, which > means that we would hit the VM_BUG_ON whenever we would call > swp_offset_pfn() for such entries on environments with CONFIG_DEBUG_VM set. > Fix this by updating the check to cover hwpoison entries as well, and update > the comment while we are it. > > Reported-by: Tony Luck > Closes: https://lore.kernel.org/all/Zg8kLSl2yAlA3o5D@agluck-desk3/ > Tested-by: Tony Luck > Fixes: 0d206b5d2e0d ("mm/swap: add swp_offset_pfn() to fetch PFN from swap entry") > Cc: # 6.1.x > Signed-off-by: Oscar Salvador Acked-by: Miaohe Lin Thanks.