From patchwork Thu Mar 7 12:51:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 13585493 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 888A1C48BF6 for ; Thu, 7 Mar 2024 11:57:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B2916B0172; Thu, 7 Mar 2024 06:57:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1635B6B0173; Thu, 7 Mar 2024 06:57:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 051F86B0174; Thu, 7 Mar 2024 06:57:38 -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 EAFCD6B0172 for ; Thu, 7 Mar 2024 06:57:38 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B9C611A04B3 for ; Thu, 7 Mar 2024 11:57:38 +0000 (UTC) X-FDA: 81870093396.10.053652E Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf20.hostedemail.com (Postfix) with ESMTP id CBA1D1C000A for ; Thu, 7 Mar 2024 11:57:36 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709812657; 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=uZZUK917JP5BYPLcib29i+kfZM6ZKxfTozu6hdCHWS8=; b=blTH4duBhppzIKAQLiNBEY62MdlAgRcbBcc8BJAbJx2FT/29ENhtg1dQfHWDvgTd85TNKh IEsYtf3yFcOJPDAVTJX/T0oi9lYO8dKVFXx+wIMBRXDsFZk0HxlHiJR2SSXOarcJCGvVw4 IoIrefDnFg1JkonCfZVJGwaS9ePsH5w= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709812657; a=rsa-sha256; cv=none; b=TejmHJ0N5OzYUV2RNJC8uiICepMX232AmWJS2udv56pEzIOVI8M6xE6Nbbz0ekvnTBURpX MBJ+QYWLlxfDQ00ekqzePrEpoYsW4MYxR/ZWS2RlfXTJ3P/ZCNH9xPdNjKS5iug6IP7cP2 ezkDP+hj61dBQaXXkniT9/eKe5ZlBbk= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Tr75t0pjwzwPFH; Thu, 7 Mar 2024 19:55:14 +0800 (CST) Received: from dggpemd200004.china.huawei.com (unknown [7.185.36.141]) by mail.maildlp.com (Postfix) with ESMTPS id BED06140134; Thu, 7 Mar 2024 19:57:32 +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:57:32 +0800 From: Liu Shixin To: Matthew Wilcox , Andrew Morton , Sasha Levin , Dan Williams , Naoya Horiguchi CC: , , , Liu Shixin Subject: [PATCH stable-4.19] mm/memory-failure: fix an incorrect use of tail pages Date: Thu, 7 Mar 2024 20:51:50 +0800 Message-ID: <20240307125150.2849068-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: CBA1D1C000A X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 7gtiyzueraw7h7sgw5as35dysxm4kt6d X-HE-Tag: 1709812656-303231 X-HE-Meta: U2FsdGVkX1+Cki5LA1Ax00HWyIr0UiJJiiY8wqg9s7jvlTipGxK8wV2EHS8DimasfV8QM2DH4fepyHb7ZQuSIFwkWl/dcHn7mSgnlLSkc+6F86tYqBK1g6MGUpAgY/uGaPilLqXmuVJazCSb41Xnzd1VbcP2zZdC7kNwSbWzOnj9Ogf5LyJ13bKqQXHqgI5PDYwYDb5FQ0R7lYVTIiIGyNQYSQUFu2T9xNsW/LKhgqqbcPnQMLSXPx40RWR9J1u4ZkkJtPL5ETcVZRjlhgkwy6I6HRXa/OJa7yeYTGutE7m1/dc/B+ske4pcfkJgf3Gvj3p2KvDO9+Qba8uGUD4mpU1yNa19OzPzse8kTM0EKN/edOQJSJb9DmZmqgZqkvBSUGUwmnY6H43rp9B7UD6iZNj/in+BcjAB8rfwMmB4A9+HP8kVRTyvHtVJC5CZ/U5Adq0fEt1KUvx9a4WLvdxbq/X+uCYeJrDvrTCmO/jjG4kF8kQIDYEldS8RRQAXOtmE5fFqN6Q4oX6z1RVmE8RGs9Mw4Uv4gyTbGxWZcv3+6QpSAbM4E2fAlCrcJpVFmx+0sefczvhchOv7QuSDhuZdyFZ59eJDmD6WR0RWOdG2a66/pURrG9Gw5TJyvA7ZSEklaA9/XBKNemb1fkSfl5j192hJylxOzNQr3OgMZK+1x3ZHQ/x8nOto0Ara4hBzRssg4ep7ip9Sx6sdlFx+MFCr6TAKSyop8fWDGYQ42whzY50g30g5+sfy/RiMROXlZ4UHAWNi9jFuPvhuw+klK2SqBuULlgi0Xlm+fX8rsyMjdw8FVzqYUfgynlz+Zh49XyARVyVmUdkjFkBDyaDlQUSFgQRJr5vyIr1O 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 4.19-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: c6f50413f2aa ("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 c971d5e11f93..5fce5df0fe35 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1033,7 +1033,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));