From patchwork Thu Mar 7 12:50:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 13585492 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 C1DE0C54798 for ; Thu, 7 Mar 2024 11:56:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 50D096B015D; Thu, 7 Mar 2024 06:56:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BE726B0170; Thu, 7 Mar 2024 06:56:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3ABCC6B0171; Thu, 7 Mar 2024 06:56:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2B3FA6B015D for ; Thu, 7 Mar 2024 06:56:47 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C62951605DA for ; Thu, 7 Mar 2024 11:56:46 +0000 (UTC) X-FDA: 81870091212.07.D1C18C6 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf11.hostedemail.com (Postfix) with ESMTP id 6F6874001A for ; Thu, 7 Mar 2024 11:56:44 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf11.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=liushixin2@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709812604; a=rsa-sha256; cv=none; b=qNnP53vVlCCmNagyYLzOXAS5k1B9dM+1jbrr6vkIhORR4JExbNEwlN0JHBRg3lkrL+6OJH Em9k8z+u8gT9+qmKf5C+rc99ud/oOEfTJBPc5VXDARPgLVNiLduUcBvn+AKpt+/HVerMcX oNzPn/cJcQvMKeCjA1FhsFAtvRo6Rgk= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf11.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.190 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=1709812604; 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=NhVwienGq9UCohte3Fl/1NbuSOr4wdYxVIG0k9ZJA1c=; b=6eV62Br1av5EHkkh2v3fgXficPLY4NlmlS+ncJH8g0Uno3Fl1zmevG85aOyDU3MjR8p80n Li+S9aEgoZqCb/BMX/k8hNqsEEy0X4gkUt/LA91k5LNUMYCCtUN9hlZAi79k2EDxBHMgDV znP7RUjMVUuaoOKqp55B53JQoRGzm8Q= 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 MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemd200004.china.huawei.com (7.185.36.141) X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 6F6874001A X-Stat-Signature: 7ocs8irsou59rgb64be3g1hikgd33h8e X-Rspam-User: X-HE-Tag: 1709812604-938735 X-HE-Meta: U2FsdGVkX1+BBLY29rEtOkVhzhdC47lnFvAfe+28seYcQamvmZlsUsYT5iwzoe3kQj8Y3+cAkCd7Dz6HNtWXRLK24/3VoykkB24IUjKoJpHlqzvQ4gqH8U2a3UAgh73QckY4d4S71zF5rq4o8bjJIFP0BYJZU/v3Wsq269hx39cV/cxdsEKDxW0XdoGEH4PxAwocvpmNhDUr6XYtGB3gG/LtX3zsfZ5eUdLmriAKuVi8SkB4IeBghWe8X00WnbMp4npycs/Z6sKxxpP6hDjW6z5dKEIu0135mhxAj6NwYngiNbQkUxzPPm75tComa2z1zmYfl8BUxnHZoY/99aVSYL7yPRwEm9cBAfkVg284reIuSBOdIazIumXHY4YRUJq3CebS8tLljGGGLBEPz5ey/VdN64HRXuEzSOJUCZszKUJ0t3KLPOnxXQKdKc3l9eBGgMGUaNwFSN1maO4fY83020vOyxw5ENqjHIGPa6Gip8oUChbIFiMDolkf/4/bpWjT1PXybpJuiOON/7mpVKMEzXBo+iQQmZQkgzW+T1R6I0WnIYd+kvIE0oM2xwigBJ5XCCJjuuIQVdartZwMW2Qi1TC/3AG1COrLkWR60MCe5dj2I6B/H1YaDdAomPjHNHhQbCJ36tH/dGzbqgSnQNm2O6i4Mf+xGslFzc2DbxHtN3bOf/4nLIbNlcdyHVkArmzRU2AlfVeaK7Ip8KPiVB87Qphs45GbuMYQrsDl/Oue/3wcCTrUuSzx6zUmPSFghLU2vbnO6UbUe5UCpQvFEaSjfPXvWIMRWiDurfOWn5kbZpg6pFPyO8G+cANoUmL5ZD7ISBoBU5SGWEMhoOANA7KBoeiX4yPACjGr8WlQSS+j42EIIowLPPFPWKT9fA8gLfPgv6rB09yforzck1NEkHhFO8pm+bErMd2w5cXo88fKNKsIVFyeEsfJN7sDdwQ5wKuTs8qNEKbQ3RT4S7qi+AH OVoEtj94 4rKyJjKqeEnQA6AWl3edNCbeQAj2XHln7WVC4uxah7VYcG/GqcJDoCUTj1GmtcIdwbVQb2HQZefQct1jqLWq3v0QHAuQVnnur1Qxi8wz6FWdw2ByuqtwUEwkWLeFRvUCBj+GeJNInM6wCy7IM2bfU8nIPhg== 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.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));