From patchwork Wed Jul 14 19:35:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joao Martins X-Patchwork-Id: 12377775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0649C47E4B for ; Wed, 14 Jul 2021 19:36:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4B461613CB for ; Wed, 14 Jul 2021 19:36:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B461613CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E7D856B0081; Wed, 14 Jul 2021 15:36:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E548B6B0083; Wed, 14 Jul 2021 15:36:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7F7E6B0085; Wed, 14 Jul 2021 15:36:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id A0B946B0081 for ; Wed, 14 Jul 2021 15:36:18 -0400 (EDT) Received: from smtpin34.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8AD93274C2 for ; Wed, 14 Jul 2021 19:36:17 +0000 (UTC) X-FDA: 78362199594.34.2BE8B02 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf21.hostedemail.com (Postfix) with ESMTP id 1BA41D008A56 for ; Wed, 14 Jul 2021 19:36:16 +0000 (UTC) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16EJVVjd010180; Wed, 14 Jul 2021 19:36:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2021-07-09; bh=8lJ7EDg3tbbYqO7fNYtskGSK8ysuHvu4xJBz1wDuqS8=; b=pb3p4lDDgNBXmBNCgIWSQIIi1gAH25Zud6KNr6SSi/HBYOM1s4PxTRRGWtJpPoRHNIbG POJRW74XeZsw6hrbuvIGzd6qUvaOx8vfh40dgp8KpJEk9/jsB5iJM0MiEgNlcrsf0+Nm W/IAEuED00mPHJKU6I9gPQ+vPH1+XYlJFMGLde9k4d0E0se9lxXPNsk0HsASbc4eRH/7 xqQQ2RK+nlHIHbg8XeYkQTB8kspfXv0hH/Fd2CbqT9XnUN2GuggJegwpipRezpeDTdL0 DWffh7Ec8mEHWohVHwwJWTz2fUKw03IW+xMqZ7fZ04LaVyUPVArZcBNJAzTIBK7BFgqq KA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=corp-2020-01-29; bh=8lJ7EDg3tbbYqO7fNYtskGSK8ysuHvu4xJBz1wDuqS8=; b=sAXUvwPHsaJB2dqyYmATcXocB1opgmdoQP4hYaY81nFjZDc5xOkf1MsrEaZJqt6wD2uX 5mCO5kEL0rrayuftJTeFHUs0AVrV/ZgKaCjQYlEt8yX7LtXqxnyVBciBXhDaU/yeXEX5 0we23+pdlxayFdoNigqDl15ulTDXciev4S04FOnQrXtrK35S1dh0/RL6AOhxO06o9w/e rhqsOWAmfRk/C860yUrHWhzA0Kb6+NeOZJeia4zqnfsYaS+kCDHvyD9+4ux6sYJvUTPk 2pZx56TglU5c1RiIPZGiLrO1w2lOqxOA/Cp15RYBGBBuhAGOPFrPNOwNzieeLFcnry1F EQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 39t2mc0fga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Jul 2021 19:36:02 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16EJUwDl187323; Wed, 14 Jul 2021 19:36:01 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2174.outbound.protection.outlook.com [104.47.55.174]) by aserp3030.oracle.com with ESMTP id 39qyd1c5c6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Jul 2021 19:36:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tkb5DNyy1XuZPaa07HmFdVkJ/YlWQt+wjH44X6TwAzzeMb5Oh4WKwAmHn+DXNxOa8W1K2S/qwPQv66S1fGV+uaUzj3BgXLM/ZD3CgrmosrNmhmh86+oD/2WrjZcnfPCW2kmn1IqNxV1tyHQu6wLNaYALUCdRliztcRJQge6MI0gzEYGupntZdwyYaX1BWqi4xMh9bHPo7mRfzyRlVsBNQQEQlbXd346FDmCPfnrWOPxXOaI3ECOiCF5MSUShvPErdRv6YnO/Q/rcs7Dg6dftO6K8rxkd4oA2I5lF6vF4tVba8zkPdyyB7Nm1h9n/jsFy+cLBX24A4090jFQGAAD+Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8lJ7EDg3tbbYqO7fNYtskGSK8ysuHvu4xJBz1wDuqS8=; b=FWfz8XuU6LNCDNjB5i8ctz0q1P1zVb7i8KpuuWpJaO3zKaLhgxM2iPuzqM7Z3ix4bJzjJVGxiFlr2YqHVa4P0oT4D1b4tpbCMostkMgosThior1gcAHjjeoT1eZlDVLnJK55gJtx1Sz34oEjHnIqG4w1HXQ20gCsy0KVC+gbkJNPi66oKS3ojqrA4R4aT2HoKWiLAfH7ySOs2cIoVVGeroRalcR8FQLAFbbf8Dehid6OHTb90Syi5Z2OGoZyQAzlxp2Pro65CQlWAtEKEs4katVNCprwzn5DjRXo/yf5+7THLanXu+Z530EFDovzgH3XU+P8rvvHtNPDT/idMTyDIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8lJ7EDg3tbbYqO7fNYtskGSK8ysuHvu4xJBz1wDuqS8=; b=T7Nr1YRNIDghhVBGq+HBHqLkarpJ3O5FLIj8iNx60bdPMAPelrbWltKLvkVMwSmchsI321HY6Slv5eA4NhZhoa2TtgU+jjkvJYxGSxWya46jwk6CGjeNrnoVi02I+I9LmuFFil36btnn2GEnMyCfHf+FKFvBylIlePWay8FpKjo= Received: from BLAPR10MB4835.namprd10.prod.outlook.com (2603:10b6:208:331::11) by MN2PR10MB4080.namprd10.prod.outlook.com (2603:10b6:208:185::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.22; Wed, 14 Jul 2021 19:35:59 +0000 Received: from BLAPR10MB4835.namprd10.prod.outlook.com ([fe80::5833:5ab2:944c:7360]) by BLAPR10MB4835.namprd10.prod.outlook.com ([fe80::5833:5ab2:944c:7360%9]) with mapi id 15.20.4331.022; Wed, 14 Jul 2021 19:35:59 +0000 From: Joao Martins To: linux-mm@kvack.org Cc: Dan Williams , Vishal Verma , Dave Jiang , Naoya Horiguchi , Matthew Wilcox , Jason Gunthorpe , John Hubbard , Jane Chu , Muchun Song , Mike Kravetz , Andrew Morton , Jonathan Corbet , nvdimm@lists.linux.dev, linux-doc@vger.kernel.org, Joao Martins Subject: [PATCH v3 01/14] memory-failure: fetch compound_head after pgmap_pfn_valid() Date: Wed, 14 Jul 2021 20:35:29 +0100 Message-Id: <20210714193542.21857-2-joao.m.martins@oracle.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210714193542.21857-1-joao.m.martins@oracle.com> References: <20210714193542.21857-1-joao.m.martins@oracle.com> X-ClientProxiedBy: AM4PR0101CA0048.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::16) To BLAPR10MB4835.namprd10.prod.outlook.com (2603:10b6:208:331::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from paddy.uk.oracle.com (94.61.1.144) by AM4PR0101CA0048.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4331.21 via Frontend Transport; Wed, 14 Jul 2021 19:35:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36ddd624-a9d2-4e06-5a6d-08d946fe9b6f X-MS-TrafficTypeDiagnostic: MN2PR10MB4080: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: czqebY0y8Qi1zlKIYb3HVr/8JbmWw83aN1ag8Goln0gWCdBhmpOmT8KzFgwagRse7/HMWjyXWXwwK5memxOyd2Ud0m9kJbBB2xk3XOBknMHfZKtVgjSdzDia9fPk0zMaBRNI0nRM/ybpuVhiniKgSOTe8AVTly3GF8rzGyTL1He5pIr5IOZdSWlCtHTC1DJCzmIxQDmaaGy0XUAOuxuoShMWbMBDoB3hNfCJ9x7KMGA50/IkYE6B3iqM/R96k69LKRiglmw0R/a6kmjAsjchzm3BhVcyPKcsOcsa5qcB6Wkm799lYYzZzSLDtVGL/oHuCA6UP4GlxSWZSggedYi+tFa2JjDssopIUq2C+mePd5wle/Qi6vbikPN0NUEb6zD+vNJE4tbck+3Kyj+Gq5vxLZnONkx6GaMavwDOdwzekeJTDT9YITqyw+Xux5BhQRejQwsAW0ZnJz/WyMlBOBOdyuE5ZbtuJnXtCjR4wJi+LsxR/pxOD5P/HQaK81ijtmYEjIprRZV3GhdbI3sfUt0tc8g0YbWEus7I1+wRcjzUJAA256FwPYXEewE4NKbZFFcosSPGNDiSCE/FbcoAiDv2nfRxRecNv7Ac8dgpUh2Hm3gXL3kE15qdvEOZp2YfxNo1AORwGvTky3euXAbs/QhYVkQAr6pb3CG9pYDactbe9fCGg03ck7Q8FzMOALONcxCVzQGLNumbuV0m1Zzfwcm9NQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB4835.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(346002)(366004)(376002)(39860400002)(136003)(6486002)(8676002)(54906003)(86362001)(5660300002)(36756003)(478600001)(186003)(6916009)(8936002)(4326008)(316002)(83380400001)(52116002)(107886003)(7696005)(66946007)(6666004)(1076003)(2906002)(26005)(38100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a3APSGVNF2ueiJzC5xW52ln6UCFBQy753YbriahTEgXNr8bkCeNGbxQoEuJftzYtxKn/fAfHQs8bpLRU7S6tz9kS0VTAnS12JcIx6gKlzg+rs84FfQdIYS95p/lXNB+zg7q3m0oMQiysy0+tDEX04YVhp217VGTkixcYhpsCi9ZHP4TT0PIg61Rr5yoRly7PMtlU0J1pyqz4CQLsNdPwbH9Z1qdlYzK/jFJULDbL3pF9fqJ2wgZswbEA9q1/4GCsy3qT2mfwrW0BpDvpVvjM1r6jVL4SCWzPHkydJ2d3nnbOQ3q+llqcSd4Yy/A9oEshka8OAx46ui5+U9PCFDiNdGtM93/VkznSHdoHyFRW1QR2/iAAzzheE9d3RwvVyHTyJWBEnfjfulJ6rILrG4mt X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36ddd624-a9d2-4e06-5a6d-08d946fe9b6f X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB4835.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2021 19:35:59.5847 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2pp/3YptwSx5UhxTA5t7nCs1gywm50Z3MPd1r68mzTx6v4PlaROpyVhtDSFYQTH9Afv3ULKIqkFxqvlpTzx/oUQUXnRaBscZIoPRIRtbGjw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4080 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10045 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 bulkscore=0 mlxscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107140115 X-Proofpoint-ORIG-GUID: iOIbAJE7mU0kga6Z5JOSybjdCA6_YZjU X-Proofpoint-GUID: iOIbAJE7mU0kga6Z5JOSybjdCA6_YZjU Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=pb3p4lDD; dkim=pass header.d=oracle.com header.s=corp-2020-01-29 header.b=sAXUvwPH; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=T7Nr1YRN; spf=none (imf21.hostedemail.com: domain of joao.m.martins@oracle.com has no SPF policy when checking 205.220.177.32) smtp.mailfrom=joao.m.martins@oracle.com; dmarc=pass (policy=none) header.from=oracle.com X-Rspamd-Server: rspam05 X-Stat-Signature: z9wqtpitc3zndt1kr73rtwtmuhqtisg6 X-Rspamd-Queue-Id: 1BA41D008A56 X-HE-Tag: 1626291376-16616 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: memory_failure_dev_pagemap() at the moment assumes base pages (e.g. dax_lock_page()). For pagemap with compound pages fetch the compound_head in case a tail page memory failure is being handled. Currently this is a nop, but in the advent of compound pages in dev_pagemap it allows memory_failure_dev_pagemap() to keep working. Reported-by: Jane Chu Signed-off-by: Joao Martins Reviewed-by: Naoya Horiguchi Reviewed-by: Dan Williams Reviewed-by: Muchun Song --- mm/memory-failure.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index eefd823deb67..c40ea28a4677 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1532,6 +1532,12 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags, goto out; } + /* + * Pages instantiated by device-dax (not filesystem-dax) + * may be compound pages. + */ + page = compound_head(page); + /* * Prevent the inode from being freed while we are interrogating * the address_space, typically this would be handled by