Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp503916lqi; Thu, 7 Mar 2024 03:56:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUNvwoNZ9WxZKwMGmxrQKBx8cvLWmyGfkOli4XQYmhHTWp7iwDwAmvViEe5hAeJWwKLIimvjWqbZ9F62Inkr5GmHJYqDt6l/fuLlN4rZw== X-Google-Smtp-Source: AGHT+IGOXTA3tEnu56DZJ/pG/L9g3lZvMSpolAWXI73UPVlxyEfzphLCLMY1RyDqZfHwxy6KQE4I X-Received: by 2002:ad4:4ba7:0:b0:68f:a76c:1e0c with SMTP id i7-20020ad44ba7000000b0068fa76c1e0cmr7606284qvw.48.1709812619552; Thu, 07 Mar 2024 03:56:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709812619; cv=pass; d=google.com; s=arc-20160816; b=fiGqrohtxbfMp11GiDP4NawJpsVck+KFpAH6CYaVJXca4RItz65xnndHnDRjZH5H3W uJmfgxEZDCcCKdVRSpUO8lmpnwrCLu+JFANx2Ogv+G2gyuMNn3o4414Df6UvcXgaAHHk FA1pS6YZMP5FFLBpMRL1WHzKQ5ofHDdyc3eZM3jOkc2y6xoZIzVehrcvQEM9BZcPkXaB z63PNDK7+Wif9RbBsukm4iRQxvXw4U1igivT7prNWMaq2nFc40Mx8gjou/cj2R75/X1U Sm4TgO8AQRRM4luOkvxDNu8L/ZVTioQiHugmYQMY0ocuuqVTHd0sLpctexd95ac5l816 ARIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=NhVwienGq9UCohte3Fl/1NbuSOr4wdYxVIG0k9ZJA1c=; fh=XYU1TtztkhlQv09QXeN2KBUob9SKb70zLDJqeTijfhk=; b=OKN8F+OJ9QJxC8GP8n/t0sFcs0JceWBqZGK8gAdQFZsvWewMQyKVtUmxnKDF58rX+w OCLksG9DJscm+0SQ9qH5Yz2HWwXgEul9QiA6i5Qs44UBx1IYjJCArzi9SByy2qJMQ4Rz 51j9mwGcRuVGDAxQL6c8QU9GEEOBF/bAxygQW9Wu4YsEdhDEaVdLtPryCuKcKQb/mmwB Fvpvaux0OJXvzA2hzZ8mLKAOGAkEt+Brqu26by88WSXOOcAEOts2BpAwmA0884SS4rE0 iBzAFdH82om7ocYemCidEwZxByJX0BzmRWi51xIHRqhr+Z0zkc0I6eAIb6LVbDamvZmP 1tKA==; 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-95499-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95499-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. [147.75.199.223]) by mx.google.com with ESMTPS id jm10-20020ad45eca000000b0068ff18d7766si16888125qvb.47.2024.03.07.03.56.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 03:56:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95499-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-95499-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95499-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 492E41C228C7 for ; Thu, 7 Mar 2024 11:56:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3C021292F2; Thu, 7 Mar 2024 11:56: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 AB5E112838A; Thu, 7 Mar 2024 11:56:48 +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=1709812610; cv=none; b=mGCqCB/2E9NVAlpUqvAvMkFgYihjuJfpJw7xsFlADQS/cKSK/MFb7Ne8Z+ebbqAM3TT98FJvt3OpvnBbBXj/DaxESMlKLtT1dXMXgJxqBfkoWzWj4rdRW+B8NtYGpsoCQO+CIpLUB7Lk+S9XqMHdekMw64ZzB2BlQzLXCdd61+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709812610; c=relaxed/simple; bh=GzBkR5wUrIJZ2SFamcQUXYDvjXuy7pBgkL4X6DG3brU=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ayVYRATsxmubWBeNPU8k+QeIk10Jjir2osjqa1qfcJv46sv6FNY3SkWjA5j1DFzwAkyjWqjwtge03qhGbFGFQebBZByLku5FGrSRD77e8o3FJTObyUux/m74DGnt8droTyt/HCcGRCsA9oAgsEle7RX/m8PfGGm0JJ9G58Up64c= 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.88.214]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Tr75d5bqHz1xqC4; Thu, 7 Mar 2024 19:55:01 +0800 (CST) Received: from dggpemd200004.china.huawei.com (unknown [7.185.36.141]) by mail.maildlp.com (Postfix) with ESMTPS id A00401A016C; Thu, 7 Mar 2024 19:56:40 +0800 (CST) Received: from huawei.com (10.175.113.32) by dggpemd200004.china.huawei.com (7.185.36.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Thu, 7 Mar 2024 19:56:39 +0800 From: Liu Shixin To: Matthew Wilcox , Andrew Morton , Sasha Levin , Dan Williams , Naoya Horiguchi CC: , , , Liu Shixin Subject: [PATCH stable-5.4] mm/memory-failure: fix an incorrect use of tail pages Date: Thu, 7 Mar 2024 20:50:53 +0800 Message-ID: <20240307125053.2847205-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemd200004.china.huawei.com (7.185.36.141) When backport commit c79c5a0a00a9 to 5.4-stable, there is a mistake change. The head page instead of tail page should be passed to try_to_unmap(), otherwise unmap will failed as follows. Memory failure: 0x121c10: failed to unmap page (mapcount=1) Memory failure: 0x121c10: recovery action for unmapping failed page: Ignored Fixes: 85015a96bc24 ("mm/memory-failure: check the mapcount of the precise page") Signed-off-by: Liu Shixin --- mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index c6453f9ffd4d..0e7566c25939 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1030,7 +1030,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn, if (kill) collect_procs(hpage, &tokill, flags & MF_ACTION_REQUIRED); - unmap_success = try_to_unmap(p, ttu); + unmap_success = try_to_unmap(hpage, ttu); if (!unmap_success) pr_err("Memory failure: %#lx: failed to unmap page (mapcount=%d)\n", pfn, page_mapcount(p)); -- 2.25.1