Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp504235lqi; Thu, 7 Mar 2024 03:57:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVSTP71xfhDFo3geR/JpVK9aX0+xgZU4QME+54eHSeLT2LV8KMhZrJPB2VXdlfCF/26UwIXxRapQRW1pV8KUaDfwdqO7FmV3aEvO9vhzA== X-Google-Smtp-Source: AGHT+IFcx+oNjDT7CLMjnKRlUuSQxV1I4DM7PZc0ejbr00/z8uiuc8dGkis7cxJFiMbypyp4wqAL X-Received: by 2002:a05:622a:14ca:b0:42f:2008:f8cb with SMTP id u10-20020a05622a14ca00b0042f2008f8cbmr944329qtx.17.1709812665577; Thu, 07 Mar 2024 03:57:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709812665; cv=pass; d=google.com; s=arc-20160816; b=v7pP5/py4lwRdgpOxQsnIQTgkISO+WWsGY2o8i8awlzZopAzv75W+ARS8sRIEbenyQ 5BFAfgNvVMXiufFokb8UXDqbN1bquR4tr7qOlKRPEP8NdNN4TQW8j6hTJcaWchS0PIi+ JFE3KY3iTSI9I0W81gFsGvi3Ih1r3vz5SNeW7N04o3YpN7MELtu+gM6RP69P3X9D5nfK Vmm/vVlFxXqnLfGeYBxDsbO5niwwGEmkWKNMp3vfa4PGzbLAqcRMUmQKsmBpf6Gej9j3 unZmDfWyH07GKEUMlsAZSyYfoMUlhjxD4VTlk2TIhmYt9VnLGB/iqXeaoRgja7vuoTTH wqDQ== 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=uZZUK917JP5BYPLcib29i+kfZM6ZKxfTozu6hdCHWS8=; fh=XYU1TtztkhlQv09QXeN2KBUob9SKb70zLDJqeTijfhk=; b=iGXgi6uGhzN07h4IR8xCU3CzlSy6j5Xs1Udn0+w6PO//4FGlyjsVX5StxpXrVgHxq+ RPa/BAVGS5G85Imva+YVGisYLU+bNfiN1ZTAL24fEjeIWfzDoxEbuMOwgELM2NSUGlSf INCs0ZFcDHufFlMngEFHXZsIeEK8nrCzglQLgVdAH+HC+n1KMFLcAe99Tm36LOGJ5VQL cdLCsOWJ6MLnWp1gSdKRE+BbS9j4kIJe6NTHbP6YQhWuSMpQiIgbpQINLEP3GMCjVxER eopJC0y1gNZNdti2rqV8SoddVgONbRnOEGOGJ08VrxsDilLzWES1Y5Oog0uOuEjeYeVd rtUw==; 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-95500-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95500-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 fg17-20020a05622a581100b0042ef5da9019si9278030qtb.167.2024.03.07.03.57.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 03:57:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95500-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-95500-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95500-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 1C0801C2391F for ; Thu, 7 Mar 2024 11:57:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D93851292F3; Thu, 7 Mar 2024 11:57:36 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 CA3BE83CBB; Thu, 7 Mar 2024 11:57:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709812656; cv=none; b=TFiiM6KgT1awwfzdQzezJAUWdQENKbqLInfQBEiGqnZz5u+18sJepME8DEObNA+FNvqfzNmd+7OZPxojBfFV9WlKySMbPK81XbuuRq56jTkw9SBNR1x6ljD5ZaJqcNFBrey1Hjk15YlCUTtkx6223nskrK5ySqDDGNwQPejkM6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709812656; c=relaxed/simple; bh=IJzK0lL+HEy35FuIvy8l6UaUj1238JQWdpdC7XIA37s=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=VdW4wTc8+Sn8HtkzL/6XGEBPGY6orEdfJ08nBh69OQBOMBXC3DSdhM77ib3nVp6Pktj/HmV8NpoE2D7tP/0yacStv1M6Tz/ugj42712dWizYcicqsjdLjEns5GFZ5Op4pfs34KFOfvUa4OXgz+gb0zF+jPX+Z5+3u3RSD1XmJlI= 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.187 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.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 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: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemd200004.china.huawei.com (7.185.36.141) 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)); -- 2.25.1