From patchwork Thu Mar 7 12:48:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 13585491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 576ADC54E49 for ; Thu, 7 Mar 2024 11:54:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C5E096B016E; Thu, 7 Mar 2024 06:54:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C0DEA6B016F; Thu, 7 Mar 2024 06:54:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD6756B0170; Thu, 7 Mar 2024 06:54:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 9BCFB6B016E for ; Thu, 7 Mar 2024 06:54:48 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4607F41170 for ; Thu, 7 Mar 2024 11:54:48 +0000 (UTC) X-FDA: 81870086256.17.EEC51EE Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf24.hostedemail.com (Postfix) with ESMTP id 3F05918000A for ; Thu, 7 Mar 2024 11:54:44 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=none; spf=pass (imf24.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709812486; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=pcXtOWPz16HWhJUASXmPpZnq98eUxm5CtO64rVArYqs=; b=gXJrQw3qApSAbO6D7z2MqwevrI/9eL6WiBLPaqU6mnApl+ghMgNKegrTuoMfQHKLOzbbzw InygXyhD6/+JkZ5eJ3jHf93Q4tsGG4qRcOO0ChS2G7gVKFO+1jKR9AWUEOdr5c4XUvJWKD uV0BQCvny7y7pS5mYqc7CcDzJMBHSzU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709812486; a=rsa-sha256; cv=none; b=l8RW5vMimptkTxiyMN2cnEPqse8b6jbXuicdjnYVou1fUYF2S75aJnUdvwnWFlK70piqco nOOu5DwwZn5f1q8Qezg3CCumu7HbVi4RQ9eotywt53zmmHpXzYksMti06mM1Lz3qZoANq3 IvR1DcC+upg88oY/20eww/8ahugcGnY= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; spf=pass (imf24.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Tr72Z4LcNzwPH3; Thu, 7 Mar 2024 19:52:22 +0800 (CST) Received: from dggpemd200004.china.huawei.com (unknown [7.185.36.141]) by mail.maildlp.com (Postfix) with ESMTPS id 43500140134; Thu, 7 Mar 2024 19:54:41 +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:54:40 +0800 From: Liu Shixin To: Matthew Wilcox , Andrew Morton , Sasha Levin , Dan Williams , Naoya Horiguchi CC: , , , Liu Shixin Subject: [PATCH stable-5.10] mm/memory-failure: fix an incorrect use of tail pages Date: Thu, 7 Mar 2024 20:48:41 +0800 Message-ID: <20240307124841.2838010-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemd200004.china.huawei.com (7.185.36.141) X-Rspamd-Queue-Id: 3F05918000A X-Rspam-User: X-Stat-Signature: fnmf6d75sfu3mewnyep7m3ssra53g1hf X-Rspamd-Server: rspam03 X-HE-Tag: 1709812484-75432 X-HE-Meta: U2FsdGVkX19xV28V3cBrHE/R1jh8Tu+cuwMJ+cyqBNxJtLiTY3TQMTPZrAiMlZC9fmkdkAPfLAK5N+pHh1KlfieXwby1BV2pgH9ybxhvEaUALmSPJxCLfMLMMhmGGQ6Ddj3wkE4R3xlNsFQE2RGKMsA2shsLWfF4lW6YkqnIvAneMWDTorSsmOE808++Q55clDSRzP9fFSGJYkeOfsu0x/QaZQJKgCtt9l9VZ3QyUiDhHgQxX0CJKMyhltYxUNLdtBB+Awi0rgQ4ZzVdxUPrRDlWQRS7gUzyj3lMNWaLT1BJMK6dIBKAWXEKBB7WBz1R3bExTcGzig6NmjPLRwG2MZHubBBWkMsq47qVET2UA6wsHNgSGQo8a5o+Aur45LI+xVADG2X8xDmWl5aX0S9AYjVCQWLNrKjJT8lklQ8MbEAu+979byWWmC6XExo52f8KgKpVyAoYW32Bgq5JGGOIODK8kHQujCTo9YUYDOP4ZtcjTEAHYG5xcR7oJG14b+cFMBi6+Wd5HkhQTWbDKPQaIU8ZBxqmHkxXWAHlgE1CXjDBfRJ8ZMt0a2z8OTPsArg6ZMbEQ3CKS5m1qj2kbyiE2rL3HkyIGRjFV7IrW65IOygLWoXHFwZgpgGx55m5s4Ki35psVu4y3SgjeWkHJA+3HPRygfbuwWCLUaAwUvq+fthxwxvNwSiB7fmfzmkFN0n1L9myrlqGXRkwwgA2PxIsdjRafoUZ0yq2THKUM2xVOQFgrRl2Wx1IzYMIc+5JIF2M+ukGyFYSeZAwyco4Lm5l986aKXp68go7Ydz6tC9rzWfeO6K+D07GzdfF/cDDcrd3UuBFu+i4aHLAjFv6zTf5rgm6S++owgOv X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: When backport commit c79c5a0a00a9 to 5.10-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: 70168fdc743b ("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 f320ff02cc19..dba2936292cf 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1075,7 +1075,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn, unmap_success = false; } } else { - unmap_success = try_to_unmap(p, ttu); + unmap_success = try_to_unmap(hpage, ttu); } } if (!unmap_success)