Message ID | 20230505185301.534259-1-sidhartha.kumar@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp634707vqo; Fri, 5 May 2023 12:12:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ52mE8jb6HE0xo3+zF0Q6tslchs+P4c9n0aZqgFGwwlz2PfOiAyz2XBYQSe4RT3t9psn8YX X-Received: by 2002:a17:90b:4b07:b0:234:31f3:e00f with SMTP id lx7-20020a17090b4b0700b0023431f3e00fmr2468411pjb.43.1683313962509; Fri, 05 May 2023 12:12:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683313962; cv=pass; d=google.com; s=arc-20160816; b=pgeluein0+fli79/EOwweAqtdmJcxRNaP83FQznniFfrT24z3SqRC9T5bsx0wyTQcX kFirkz2lLIdOXjyqPWUts29AYHFviGZU5Ftulml+L7OsmbECXUZilMqAj39JvKJpESro OlO50pL9VV0fYcgB78JnIdPDAXbioVLXPagL43J9XSv16gE2CZMQ4yCJfw/QgINx3bkh CFVD0tzsCLaaSa4OGDvMqXLPbNs/uQmr61lc6GlMFoalT9wsrHMcg0JlFeqCITHAKKuR dXqZ+gHiQobllBKTkvBky8WlBIcqAmrGjnI/alophOAWj30SSiy3p4fdxf/qNR56prEc vtMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=3JFE7JTZQEZVbITtu4To1mTTVgp5EqXafMon6dsn/KI=; b=Xgn9+hE5kiFXqknkJSZbL/mm/VfMdnJmvCbOGxnRlVl0BhOTvyaspkDhgff+MauXNV O/IGPdrJxfb8YTYrH/i4u3D8Hix1+uTLWaZbbbL1VakLvlTKP3QVW1ONlsGCG3qLoRPh r2ZpKYEmyGbRfi3M8Omobx9czlGTXN7EPnyMZIqRqGpDhVcbJBBKwOmSzsKEEtQ9jk9S DRx6Ul7RAuWSwTRUTRfJVuKB9/haoNHamWX/O11ktynTZlpP4MK5rCguoHH8y9FbqCyW iAnFOJv+yr+J1jQiy2ekckus8sW993ddVVgjhfMwi1c1VIdtBvc16UGuD4XSjeqANm9F neWA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=gT54edic; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=sOABoNNR; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o66-20020a17090a0a4800b0024e03b1f374si6846048pjo.22.2023.05.05.12.12.29; Fri, 05 May 2023 12:12:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=gT54edic; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=sOABoNNR; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233378AbjEESyI (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Fri, 5 May 2023 14:54:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233372AbjEESyG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 5 May 2023 14:54:06 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 167591891B; Fri, 5 May 2023 11:53:50 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 345HhLE8014783; Fri, 5 May 2023 18:53:26 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-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=3JFE7JTZQEZVbITtu4To1mTTVgp5EqXafMon6dsn/KI=; b=gT54edic2HsURDmNedENNfdQ6E/LZE0G3j/RtyUydCHsXrsENHOo45bFN/O6sulay9RO +BHnO+KoYxGDintluBO0KN9/Wu3AwRXB60O11SrzTdG7JBINEutTTOtenKy79yYC8tgY sV7ADUGZEntV8A2Lg2BRI81IvTG3cfHW//Ma5+1yLNTGibBPTiW6xzVbR7yed5d3HHni OdmOSv6TEx9UlSJVImeyVXHcF/sA+v3ZzfUIMX47gZF4esXyhn7cWL2AdmQK24grWHsB crHQ86bJ6O6CcBHC+kWpOYMAI0IRG18i2djUvCfD//v6pCMBoRx96CBIMJoTJWrc6JN7 EQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q8snedhwg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 05 May 2023 18:53:26 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 345HX60k040484; Fri, 5 May 2023 18:53:26 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2174.outbound.protection.outlook.com [104.47.57.174]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q8spa9dwq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 05 May 2023 18:53:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nf9QSQszVc9Tkuxi3JTnB5iqV5Mf88S0Cem+on4kJu9EmDNfIigzXPUkzWpkdYeOxIP5qJAnFyBvrBPASNNrYEN+T5Kq0Y+MOa9v9SK+GHwrL/LqIHMJti43nMriFVhVXWJzTf6Tt8xzO2Zn+VP5n8+8f4LiyItGKgM+LednQ8QBAneOmLtVGqGeJ6Xh6aaedYiPEAclSqNeXAtVx/an4jHPh4iNeAZ2hxU85beko6+Om88+KTS4o79d41ZpNl2/BwVaLKj+KgVjPAr0CHjgF3B+qbj7qBnKd7PHRbBJGQ1JU3somF5m8c1eyhbHhiPrhMgRZglPC78GJBMYEKXi7Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3JFE7JTZQEZVbITtu4To1mTTVgp5EqXafMon6dsn/KI=; b=Xe/tKCTzoUELXT62kkQ/iutMIHczCIPLEj89xNeSMKLuRV2i5Om3FJ0E4YTcQZtKj8RZND/VJzMNeR+eFIMogn4rfI0ZYztBwGXC4sTATFP9CjxpklOuZgL0kFQDx3nh1NoHU+1gNfPsp/8unaq0SXUpvSlDGtx8VJ6PzS41+pWHJRG65LEQZpAfUr8Vq8H0Py7dsVozdGYbaWimBgbfvcTmRu1k30DGD0/uj+MADNBTfglv8nZubdmvGiFpVG9ynpDp6ZU2zAiUg3G9i/mXiqecOcv1HSQnKv/vujz/Z0yOoeK2hp5FF65BRT72N5k73nZTguslOa2CY/hbfFksBg== 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=3JFE7JTZQEZVbITtu4To1mTTVgp5EqXafMon6dsn/KI=; b=sOABoNNR8S9ExxDAYfSIZhWP0zFjEjSi3+vsa5af7GOueC9rCua1UQOVBXveKI0uXoqeBn09kiohkIhhhnJ9vZ+2nchm8Cvj1SjtEY9wd/gslEFw8Mer4CA7Q8InEKZlFUvsqkhRjatIxv+NHSjVtcdXqcjRTdnzDXtkH4tNt6E= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BY5PR10MB4241.namprd10.prod.outlook.com (2603:10b6:a03:208::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.27; Fri, 5 May 2023 18:53:11 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::12d3:3f71:5b55:c342]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::12d3:3f71:5b55:c342%4]) with mapi id 15.20.6363.027; Fri, 5 May 2023 18:53:11 +0000 From: Sidhartha Kumar <sidhartha.kumar@oracle.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, songmuchun@bytedance.com, mike.kravetz@oracle.com, willy@infradead.org, ackerleytng@google.com, vannapurve@google.com, erdemaktas@google.com, Sidhartha Kumar <sidhartha.kumar@oracle.com>, stable@vger.kernel.org Subject: [PATCH] mm/hugetlb: revert use of page_cache_next_miss() Date: Fri, 5 May 2023 11:53:01 -0700 Message-Id: <20230505185301.534259-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230504233858.103068-1-mike.kravetz@oracle.com> References: <20230504233858.103068-1-mike.kravetz@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0157.namprd03.prod.outlook.com (2603:10b6:a03:338::12) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|BY5PR10MB4241:EE_ X-MS-Office365-Filtering-Correlation-Id: a4d1b379-2167-4d3f-d900-08db4d99f960 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TXaRPR1wVnQo4551hndWj5zh/Luv1QIObHerxhYmhdXvxkJX71KztOo10ncb35AccfMukT1okNAHejXokyjYPDeZSytVZQNDN19kdw9Xt/kMbOj+aCVu1LIPFoPOGLfRgSnP250MXda1NojALKAxIJyyJiBUUDKCYZFE19xN/2NvvQRp0UnQZopGHDnvB1kkQNq7qHg5ksjMLcz18kd0gowCxnx/gpaicK9BPY2mKq2wMoP2JIpPAFEHV+U+UaBbA4+KJzSfghF3N7T6C8J9IoJCn49KHj8SeqVLLrZ1PDaFfe+qnUTfhfC1e7X+fD4dkPfQ+BEo2hqQmRggMjbvcZuidFKXu3JS4c84TGg6YbkChs1IqccMMPT7upVaVPm0cnWXy5yJE4Z+C88O6Oj8AEaF2m1ZQ+bl4FHwLf6H98qM90BzD8Tee7ZjFIQXfINB54gpS5mo1iK9+BgZWB63z/MASby0IEowFq/vO6yH/0TrfnryrPNpPNw6MsF7WIjwBCfI50/mw4D2VxOkQ5iEF9U4u2M21ClOLfPgN1RZu6g= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(136003)(39860400002)(366004)(346002)(396003)(451199021)(86362001)(36756003)(6486002)(316002)(66946007)(66556008)(66476007)(966005)(478600001)(4326008)(6666004)(41300700001)(8676002)(8936002)(5660300002)(44832011)(2906002)(38100700002)(186003)(2616005)(6506007)(6512007)(1076003)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gNEuzgbOS/GMQWRBSe3uMWPM6nce9Jhace4sk2E17JEbUMZ3ZFKnFxAs0yvKYtGLXuGa6H2YLzE1UBU9Z0RkBXHEmsd4tLDg1bqAEiC00A4O4bL1VjKVpRnzTZpOyPQAVOU5Pv5oDpoh7mgG1vJI3u0edpVJhHVYzYBVigITqqpnqpZeBgoB8sIAV4BXXI1ZvXD7nXONL2ljWvL3WTovVIUoqS4gO5XrA12Qb7GyClMMI1yLV/+hluWR3OWIdqQ08afNDc0ULLS9s9rGFBRHqvpdjDMMhgBPIYfhNEewqmtUbzAvTtn9cP/OnQsYRPMxLu1lACOnLPkFECudj06C1NM5YJ8NRHW+V1nSBTS0YInQ6ZHInhpgShIHrUOGWsgH8RDA5QhsDMlafSIv3c0h+tafoqaZu7EgEh4msK03+3612Takn8L3Rdj/AZl+bK13q6NmWCrdoZ7II3Y+bBYmnGQWVRFboUal+LjReHwWfzUdBuAIHwnJthYdwTod8EBxpT+u5NLMdBRFD7+RLWT+uCXE1yp5Bocq1V/aX3u2kfayBSYcF9DdDBzvJfBasiheRS+T0Gf5/hF8CdFTPKmfSXhuh2yNdlBwap887GXR6Npn8Dbho5qnifz/GHu9vEZHLB55yhFM6N29W1OFjEGxmxYUzh6A5TD60xy6BAgeqTDqg/Emoc0LQhwpOednQoLlb4x7CdLyhFGVrRQhASwjSJBIwqPEzNKEVYSfDyou7/shDp98CqqeKeKzTq4QqV4/lDkoaW7Mc6mIc2GM+p7sTT5t2YPRBLyAJvFBFDI5PqQLA04AUEPR4BV33rqAyzPKBeQ+KVxA6XxD/RwbKCz9+nmBS9CDotDPtJ/gzSGjDWsTfoG2SnVcxx3ma9liMWvUaxpzqqcEC6m6tHNo31CQseuYE6b1waSTCf5zMBDDB/2+K0zP4cXsUAQ/t/bAosQyYSzXOmb2ekHKiipNzUlRYHKNnxXr+TJYzhWczHP3Fem8Ss8V/+Hz9klV2OPKMZ7HJYqoAFNPr2Rw1ymTa2BF0glZBBAIhQRtsKpFZZUs47arTIG7GSlqss/JvL3G37eq1tIH+JQngMV8j8SVGqNL5K2dGXN1oPeZ4xwY7F/o2kIz4Xd1C3bHQdzAvYWGRLnsowsZ1xG3IreJyuVLIItzN+0o0rHnNDufPHHVHXFpDdoqqEia7YDG9dkYwnyKtKl9f1n1ZCbha16CVLDyrcU4D5YSL5NV1d95p/jh2pRQMUFNoNx65VKRR5TzxcDY0e8Vj/igmcQL78c9ebpkSby1wHHb5bQ+92b1lnS8ilz2cWcpW1GHCk45gilzHihoZgGwSPlcCg7SDsKbyXNWpAeSwBpEle+wWcZqI6/xlWUv9TZvFfjSS7Jn/ibYl0szw5EZUcozNp++uyVxkvoO6PR4+70qU65XF+pgX9P8/iz68/1YNfUxFYxOjhiIRJpAoKB2VcsKaqplqjMbFhdslX1xNRwwjEksGx5NBgG/P7I8yVrIM7euMZiA7fUUWHGFDg63o1AMn+PLlZDxP35JHNhqZln3H6/87PNWD9DwcvKveB4jFafuhjg6defDvIH46393YJambwCsvgUPIyl3O1Eld2vVsqfdnX9aKkUljhrC6f0= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: NrYhwtlquKJN71dI1sVfchq5CKhZpZsuqCj2u2shMAxsgLq0dbxevNd4Jt2m/GndiIfX6/gaAgmuLkt83RubNt+6/bWggM8st6pSW3X97U3dWanD7VP1pJwa8LExKBH8rTzC8CduzcrTg9WSEIP/I+dW9NwEw9uwmcRi4Wr9Dx1jCP6syNN0KHXamNEuqqb7Ioa7Pw6SpeGrcF1gT6AkF+6CRVVFUHJhY93NnHdnjJnDh6HweDlLK2go6r4wSRMOY49gLAOspZLJSUq3pur7xkD1Q/Q9onVZY7sHDQQps5Jl4Y4t5B4J1HY2xgisalJ7kv1bkmL9LTMZ8c38kYJpMS/xjtyaycu1swQ93IoA4AP08ufmm0S47aIniY/LLQULQagqCFshM1+EGbFLN2tLLdpYG1V3qw/vrffDDdjlL4xEBcHk1ssH68xneYwlUUJYRHCP+YOZ3dH8jin/XowOU6Ubd34dDH6RT23e8LUo44p+/pyZnx5k6+qpcEj1KY5pqb04py4aOkqY+Jm2RSHIvaszi/0gQxpFq95zs/MycElUatABS58nunOGD9g38XcFOn6fBbCRziFMVDxHICKHjjm4NjNokt15fQ+9vBv+w9uJCHj/ne8oCqd+xkycGp+7YUM2RmDX72vpML5RZFwXq70elZF77nKNmBZoMd1lphuHy9O+DoBJU9EzLbSYghxMXYIL4T6JCmdaXMv8tKGJCB7WPoa+sgMKoGtutVl0zssiFkh3w+8f2qCIyUgUnCnYkUxpcrPRhg9d5c8PcBn+wNAw9sqLvqIzFt7pEZ9/GBV0/YSeWuiNmpz1VheDM7G8RXmz7WZuTTD2krR5dOJ+qBzG6nIm+YxFKN2lVTV2hkxdwuYbHgWDjYy6/4dg8FrIqYwl68IHKoxg7rG5wK7BmnWEwfZO1KjROUbTl4U8EdGpZIXoLpAW5CEb1t+keHAH X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4d1b379-2167-4d3f-d900-08db4d99f960 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 18:53:11.6429 (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: RHixF7LQy4vHQXUPmUDvPGU0lo4BuFr580POU6j9ts75NpdM4GCpf4dKC/UdGfQzWXwt7zTAsC53lbeScPLQFui0a3ZB8Ay8+gCA27NwbEE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4241 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-05_25,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=813 phishscore=0 bulkscore=0 suspectscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305050155 X-Proofpoint-GUID: QireeGlPyHFyajjyL4MsUHNy5Ly204iv X-Proofpoint-ORIG-GUID: QireeGlPyHFyajjyL4MsUHNy5Ly204iv X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765082621367100674?= X-GMAIL-MSGID: =?utf-8?q?1765082621367100674?= |
Series |
mm/hugetlb: revert use of page_cache_next_miss()
|
|
Commit Message
Sidhartha Kumar
May 5, 2023, 6:53 p.m. UTC
As reported by Ackerley[1], the use of page_cache_next_miss() in
hugetlbfs_fallocate() introduces a bug where a second fallocate() call to
same offset fails with -EEXIST. Revert this change and go back to the
previous method of using get from the page cache and then dropping the
reference on success.
hugetlbfs_pagecache_present() was also refactored to use
page_cache_next_miss(), revert the usage there as well.
User visible impacts include hugetlb fallocate incorrectly returning
EEXIST if pages are already present in the file. In addition, hugetlb
pages will not be included in core dumps if they need to be brought in via
GUP. userfaultfd UFFDIO_COPY also uses this code and will not notice pages
already present in the cache. It may try to allocate a new page and
potentially return ENOMEM as opposed to EEXIST.
Fixes: d0ce0e47b323 ("mm/hugetlb: convert hugetlb fault paths to use alloc_hugetlb_folio()")
Cc: <stable@vger.kernel.org> #v6.3+
Reported-by: Ackerley Tng <ackerleytng@google.com>
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
[1] https://lore.kernel.org/linux-mm/cover.1683069252.git.ackerleytng@google.com/
---
This patch is meant to fix stable v6.3.1 as safe as possible by doing a
simple revert.
Patch page cache: fix page_cache_next/prev_miss off by one by Mike is a
potential fix that will allow the use of page_cache_next_miss() and is
awaiting review.
Patch Fix fallocate error in hugetlbfs when fallocating again by Ackerley
is another fix but introduces a new function and is also awaiting review.
fs/hugetlbfs/inode.c | 8 +++-----
mm/hugetlb.c | 11 +++++------
2 files changed, 8 insertions(+), 11 deletions(-)
Comments
On 05/05/23 11:53, Sidhartha Kumar wrote: > As reported by Ackerley[1], the use of page_cache_next_miss() in > hugetlbfs_fallocate() introduces a bug where a second fallocate() call to > same offset fails with -EEXIST. Revert this change and go back to the > previous method of using get from the page cache and then dropping the > reference on success. > > hugetlbfs_pagecache_present() was also refactored to use > page_cache_next_miss(), revert the usage there as well. > > User visible impacts include hugetlb fallocate incorrectly returning > EEXIST if pages are already present in the file. In addition, hugetlb > pages will not be included in core dumps if they need to be brought in via > GUP. userfaultfd UFFDIO_COPY also uses this code and will not notice pages > already present in the cache. It may try to allocate a new page and > potentially return ENOMEM as opposed to EEXIST. > > Fixes: d0ce0e47b323 ("mm/hugetlb: convert hugetlb fault paths to use alloc_hugetlb_folio()") Small nit and a question for people more familiar with stable backports. d0ce0e47b323 added the usage of page_cache_next_miss to hugetlb fallocate. 91a2fb956ad99 added the usage to hugetlbfs_pagecache_present. Both are in v6.3 and d0ce0e47b323 (referenced here) comes later. So, I 'think' it is OK to fix both instances with a single patch and reference the commit where both are present. Or, should there be two patches which is more technically correct? > Cc: <stable@vger.kernel.org> #v6.3+ > Reported-by: Ackerley Tng <ackerleytng@google.com> > Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> > > [1] https://lore.kernel.org/linux-mm/cover.1683069252.git.ackerleytng@google.com/ > --- > This patch is meant to fix stable v6.3.1 as safe as possible by doing a > simple revert. > > Patch page cache: fix page_cache_next/prev_miss off by one by Mike is a > potential fix that will allow the use of page_cache_next_miss() and is > awaiting review. > > Patch Fix fallocate error in hugetlbfs when fallocating again by Ackerley > is another fix but introduces a new function and is also awaiting review. > > fs/hugetlbfs/inode.c | 8 +++----- > mm/hugetlb.c | 11 +++++------ > 2 files changed, 8 insertions(+), 11 deletions(-) IMO, this is safest and simplest way of fixing v6.3. My proposed changes to page_cache_next/prev_miss have the potential to impact readahead, so really need review/testing by someone more familiar with that. If a fix is urgently needed, I would suggest using this for backport and then either use my patch or expand Ackerley's proposal to move forward. As a backport to stable, Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
On 05/05/23 14:58, Mike Kravetz wrote: > On 05/05/23 11:53, Sidhartha Kumar wrote: > > As reported by Ackerley[1], the use of page_cache_next_miss() in > > hugetlbfs_fallocate() introduces a bug where a second fallocate() call to > > same offset fails with -EEXIST. Revert this change and go back to the > > previous method of using get from the page cache and then dropping the > > reference on success. > > > > hugetlbfs_pagecache_present() was also refactored to use > > page_cache_next_miss(), revert the usage there as well. > > > > User visible impacts include hugetlb fallocate incorrectly returning > > EEXIST if pages are already present in the file. In addition, hugetlb > > pages will not be included in core dumps if they need to be brought in via > > GUP. userfaultfd UFFDIO_COPY also uses this code and will not notice pages > > already present in the cache. It may try to allocate a new page and > > potentially return ENOMEM as opposed to EEXIST. > > > > Fixes: d0ce0e47b323 ("mm/hugetlb: convert hugetlb fault paths to use alloc_hugetlb_folio()") > > Small nit and a question for people more familiar with stable backports. > > d0ce0e47b323 added the usage of page_cache_next_miss to hugetlb fallocate. > 91a2fb956ad99 added the usage to hugetlbfs_pagecache_present. Both are > in v6.3 and d0ce0e47b323 (referenced here) comes later. So, I 'think' it > is OK to fix both instances with a single patch and reference the commit > where both are present. Or, should there be two patches which is more > technically correct? > > > Cc: <stable@vger.kernel.org> #v6.3+ > > Reported-by: Ackerley Tng <ackerleytng@google.com> > > Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> > > > > [1] https://lore.kernel.org/linux-mm/cover.1683069252.git.ackerleytng@google.com/ > > --- > > This patch is meant to fix stable v6.3.1 as safe as possible by doing a > > simple revert. > > > > Patch page cache: fix page_cache_next/prev_miss off by one by Mike is a > > potential fix that will allow the use of page_cache_next_miss() and is > > awaiting review. > > > > Patch Fix fallocate error in hugetlbfs when fallocating again by Ackerley > > is another fix but introduces a new function and is also awaiting review. > > > > fs/hugetlbfs/inode.c | 8 +++----- > > mm/hugetlb.c | 11 +++++------ > > 2 files changed, 8 insertions(+), 11 deletions(-) > > IMO, this is safest and simplest way of fixing v6.3. My proposed changes to > page_cache_next/prev_miss have the potential to impact readahead, so really > need review/testing by someone more familiar with that. If a fix is > urgently needed, I would suggest using this for backport and then either > use my patch or expand Ackerley's proposal to move forward. > > As a backport to stable, > Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com> > -- > Mike Kravetz Any objection to using this patch to fix v6.3 while we decide what is the best way to move forward?
Hello, kernel test robot noticed "BUG:KASAN:null-ptr-deref_in_hugetlbfs_fallocate" on: commit: 1f944358dbb5e9a6493fd7b1f77ee64376d2bdf1 ("[PATCH] mm/hugetlb: revert use of page_cache_next_miss()") url: https://github.com/intel-lab-lkp/linux/commits/Sidhartha-Kumar/mm-hugetlb-revert-use-of-page_cache_next_miss/20230506-025434 base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git 78b421b6a7c6dbb6a213877c742af52330f5026d patch link: https://lore.kernel.org/all/20230505185301.534259-1-sidhartha.kumar@oracle.com/ patch subject: [PATCH] mm/hugetlb: revert use of page_cache_next_miss() in testcase: trinity version: trinity-x86_64-abe9de86-1_20230501 with following parameters: runtime: 600s test-description: Trinity is a linux system call fuzz tester. test-url: http://codemonkey.org.uk/projects/trinity/ compiler: clang-14 test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G (please refer to attached dmesg/kmsg for entire log/backtrace) If you fix the issue, kindly add following tag | Reported-by: kernel test robot <oliver.sang@intel.com> | Closes: https://lore.kernel.org/oe-lkp/202305231207.35d53791-oliver.sang@intel.com [ 144.098719][ T1547] BUG: KASAN: null-ptr-deref in hugetlbfs_fallocate (inode.c:?) [ 144.099404][ T1547] Read of size 4 at addr 0000000000000032 by task trinity-c1/1547 [ 144.100071][ T1547] [ 144.100282][ T1547] CPU: 0 PID: 1547 Comm: trinity-c1 Not tainted 6.3.0-13165-g1f944358dbb5 #1 1f0cfaa9708c3e99bb7e2ecf8f7fd22c51fc3e3b [ 144.101310][ T1547] Call Trace: [ 144.101602][ T1547] <TASK> [ 144.101858][ T1547] dump_stack_lvl (??:?) [ 144.102269][ T1547] print_report (report.c:?) [ 144.102655][ T1547] ? start_report (report.c:?) [ 144.103044][ T1547] ? hugetlbfs_fallocate (inode.c:?) [ 144.103497][ T1547] ? hugetlbfs_fallocate (inode.c:?) [ 144.103937][ T1547] kasan_report (??:?) [ 144.104270][ T1547] ? filemap_get_entry (??:?) [ 144.104656][ T1547] ? hugetlbfs_fallocate (inode.c:?) [ 144.105082][ T1547] kasan_check_range (??:?) [ 144.105503][ T1547] hugetlbfs_fallocate (inode.c:?) [ 144.105921][ T1547] vfs_fallocate (??:?) [ 144.106317][ T1547] ksys_fallocate (??:?) [ 144.106702][ T1547] __x64_sys_fallocate (??:?) [ 144.107121][ T1547] do_syscall_64 (??:?) [ 144.107521][ T1547] entry_SYSCALL_64_after_hwframe (??:?) [ 144.108022][ T1547] RIP: 0033:0x7fedb9a039b9 [ 144.108398][ T1547] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a7 54 0c 00 f7 d8 64 89 01 48 All code ======== 0: 00 c3 add %al,%bl 2: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 9: 00 00 00 c: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 11: 48 89 f8 mov %rdi,%rax 14: 48 89 f7 mov %rsi,%rdi 17: 48 89 d6 mov %rdx,%rsi 1a: 48 89 ca mov %rcx,%rdx 1d: 4d 89 c2 mov %r8,%r10 20: 4d 89 c8 mov %r9,%r8 23: 4c 8b 4c 24 08 mov 0x8(%rsp),%r9 28: 0f 05 syscall 2a:* 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax <-- trapping instruction 30: 73 01 jae 0x33 32: c3 retq 33: 48 8b 0d a7 54 0c 00 mov 0xc54a7(%rip),%rcx # 0xc54e1 3a: f7 d8 neg %eax 3c: 64 89 01 mov %eax,%fs:(%rcx) 3f: 48 rex.W Code starting with the faulting instruction =========================================== 0: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax 6: 73 01 jae 0x9 8: c3 retq 9: 48 8b 0d a7 54 0c 00 mov 0xc54a7(%rip),%rcx # 0xc54b7 10: f7 d8 neg %eax 12: 64 89 01 mov %eax,%fs:(%rcx) 15: 48 rex.W [ 144.109953][ T1547] RSP: 002b:00007ffdf492f6a8 EFLAGS: 00000246 ORIG_RAX: 000000000000011d [ 144.110612][ T1547] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fedb9a039b9 [ 144.111233][ T1547] RDX: 0000000000000008 RSI: 0000000000000000 RDI: 000000000000011a [ 144.111870][ T1547] RBP: 00007fedb839a000 R08: 0000000000000020 R09: 0000000000000090 [ 144.112514][ T1547] R10: 0000000000000800 R11: 0000000000000246 R12: 000000000000011d [ 144.113168][ T1547] R13: 00007fedb9ad1580 R14: 00007fedb839a058 R15: 00007fedb839a000 [ 144.113814][ T1547] </TASK> [ 144.114073][ T1547] ================================================================== [ 144.114752][ T1547] Disabling lock debugging due to kernel taint [ 144.115284][ T1547] general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] KASAN [ 144.116161][ T1547] KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037] [ 144.116830][ T1547] CPU: 0 PID: 1547 Comm: trinity-c1 Tainted: G B 6.3.0-13165-g1f944358dbb5 #1 1f0cfaa9708c3e99bb7e2ecf8f7fd22c51fc3e3b [ 144.117939][ T1547] RIP: 0010:hugetlbfs_fallocate (inode.c:?) [ 144.118431][ T1547] Code: 84 9c 00 00 00 48 89 c5 48 8d 58 34 48 89 df be 04 00 00 00 e8 d5 83 ca ff 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <8a> 04 08 84 c0 0f 85 d8 01 00 00 83 3b 00 0f 84 3a 07 00 00 48 89 All code ======== 0: 84 9c 00 00 00 48 89 test %bl,-0x76b80000(%rax,%rax,1) 7: c5 48 8d (bad) a: 58 pop %rax b: 34 48 xor $0x48,%al d: 89 df mov %ebx,%edi f: be 04 00 00 00 mov $0x4,%esi 14: e8 d5 83 ca ff callq 0xffffffffffca83ee 19: 48 89 d8 mov %rbx,%rax 1c: 48 c1 e8 03 shr $0x3,%rax 20: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx 27: fc ff df 2a:* 8a 04 08 mov (%rax,%rcx,1),%al <-- trapping instruction 2d: 84 c0 test %al,%al 2f: 0f 85 d8 01 00 00 jne 0x20d 35: 83 3b 00 cmpl $0x0,(%rbx) 38: 0f 84 3a 07 00 00 je 0x778 3e: 48 rex.W 3f: 89 .byte 0x89 Code starting with the faulting instruction =========================================== 0: 8a 04 08 mov (%rax,%rcx,1),%al 3: 84 c0 test %al,%al 5: 0f 85 d8 01 00 00 jne 0x1e3 b: 83 3b 00 cmpl $0x0,(%rbx) e: 0f 84 3a 07 00 00 je 0x74e 14: 48 rex.W 15: 89 .byte 0x89 [ 144.120027][ T1547] RSP: 0018:ffff88812ba3fd48 EFLAGS: 00010206 [ 144.120545][ T1547] RAX: 0000000000000006 RBX: 0000000000000032 RCX: dffffc0000000000 [ 144.121198][ T1547] RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffffff8a927100 [ 144.121864][ T1547] RBP: fffffffffffffffe R08: dffffc0000000000 R09: fffffbfff1524e21 [ 144.122535][ T1547] R10: 0000000000000000 R11: dffff7fff1524e22 R12: 0000000000000000 [ 144.123214][ T1547] R13: 0000000000000000 R14: 0000000000000000 R15: 00000000fffffffc [ 144.123947][ T1547] FS: 00007fedb9ad1600(0000) GS:ffffffff87f0a000(0000) knlGS:0000000000000000 [ 144.124701][ T1547] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 144.125263][ T1547] CR2: 00007fedb95005fc CR3: 000000012dfd0000 CR4: 00000000000406f0 [ 144.125925][ T1547] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 144.126601][ T1547] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 144.127277][ T1547] Call Trace: [ 144.127584][ T1547] <TASK> [ 144.127848][ T1547] vfs_fallocate (??:?) [ 144.128251][ T1547] ksys_fallocate (??:?) [ 144.128646][ T1547] __x64_sys_fallocate (??:?) [ 144.129072][ T1547] do_syscall_64 (??:?) [ 144.129460][ T1547] entry_SYSCALL_64_after_hwframe (??:?) [ 144.129972][ T1547] RIP: 0033:0x7fedb9a039b9 [ 144.130359][ T1547] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a7 54 0c 00 f7 d8 64 89 01 48 All code ======== 0: 00 c3 add %al,%bl 2: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 9: 00 00 00 c: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 11: 48 89 f8 mov %rdi,%rax 14: 48 89 f7 mov %rsi,%rdi 17: 48 89 d6 mov %rdx,%rsi 1a: 48 89 ca mov %rcx,%rdx 1d: 4d 89 c2 mov %r8,%r10 20: 4d 89 c8 mov %r9,%r8 23: 4c 8b 4c 24 08 mov 0x8(%rsp),%r9 28: 0f 05 syscall 2a:* 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax <-- trapping instruction 30: 73 01 jae 0x33 32: c3 retq 33: 48 8b 0d a7 54 0c 00 mov 0xc54a7(%rip),%rcx # 0xc54e1 3a: f7 d8 neg %eax 3c: 64 89 01 mov %eax,%fs:(%rcx) 3f: 48 rex.W Code starting with the faulting instruction =========================================== 0: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax 6: 73 01 jae 0x9 8: c3 retq 9: 48 8b 0d a7 54 0c 00 mov 0xc54a7(%rip),%rcx # 0xc54b7 10: f7 d8 neg %eax 12: 64 89 01 mov %eax,%fs:(%rcx) 15: 48 rex.W To reproduce: # build kernel cd linux cp config-6.3.0-13165-g1f944358dbb5 .config make HOSTCC=clang-14 CC=clang-14 ARCH=x86_64 olddefconfig prepare modules_prepare bzImage modules make HOSTCC=clang-14 CC=clang-14 ARCH=x86_64 INSTALL_MOD_PATH=<mod-install-dir> modules_install cd <mod-install-dir> find lib/ | cpio -o -H newc --quiet | gzip > modules.cgz git clone https://github.com/intel/lkp-tests.git cd lkp-tests bin/lkp qemu -k <bzImage> -m modules.cgz job-script # job-script is attached in this email # if come across any failure that blocks the test, # please remove ~/.lkp and /lkp dir to run from a clean state.
On 5/22/23 10:00 PM, kernel test robot wrote: > > Hello, > > kernel test robot noticed "BUG:KASAN:null-ptr-deref_in_hugetlbfs_fallocate" on: > > commit: 1f944358dbb5e9a6493fd7b1f77ee64376d2bdf1 ("[PATCH] mm/hugetlb: revert use of page_cache_next_miss()") > url: https://github.com/intel-lab-lkp/linux/commits/Sidhartha-Kumar/mm-hugetlb-revert-use-of-page_cache_next_miss/20230506-025434 > base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git 78b421b6a7c6dbb6a213877c742af52330f5026d > patch link: https://lore.kernel.org/all/20230505185301.534259-1-sidhartha.kumar@oracle.com/ > patch subject: [PATCH] mm/hugetlb: revert use of page_cache_next_miss() > This test is using 6.4-rc1 as its base where __filemap_get_folio() has been converted to return an ERR_PTR() rather than null. I believe this report can be fixed by doing: if (!IS_ERR(folio)) { folio_put(folio); mutex_unlock(&hugetlb_fault_mutex_table[hash]); hugetlb_drop_vma_policy(&pseudo_vma); continue; } However, I was targeting this patch to be applied to stable 6.3 as it's the simplest way to fix the current user visible bugs mentioned in the commit. Because it's unclear the direction upstream will take to fix this issue, as there is also the option to take Ackerly's patch[1] rather than using this fix, I'm not sure if I should send a version of this patch with 6.4-rc1 context. Please let me know how to proceed. Thanks, Sidhartha Kumar [1]: https://lore.kernel.org/linux-mm/98624c2f481966492b4eb8272aef747790229b73.1683069252.git.ackerleytng@google.com/ > in testcase: trinity > version: trinity-x86_64-abe9de86-1_20230501 > with following parameters: > > runtime: 600s > > test-description: Trinity is a linux system call fuzz tester. > test-url: http://codemonkey.org.uk/projects/trinity/ > > > compiler: clang-14 > test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G > > (please refer to attached dmesg/kmsg for entire log/backtrace) > > > > If you fix the issue, kindly add following tag > | Reported-by: kernel test robot <oliver.sang@intel.com> > | Closes: https://lore.kernel.org/oe-lkp/202305231207.35d53791-oliver.sang@intel.com > > > [ 144.098719][ T1547] BUG: KASAN: null-ptr-deref in hugetlbfs_fallocate (inode.c:?) > [ 144.099404][ T1547] Read of size 4 at addr 0000000000000032 by task trinity-c1/1547 > [ 144.100071][ T1547] > [ 144.100282][ T1547] CPU: 0 PID: 1547 Comm: trinity-c1 Not tainted 6.3.0-13165-g1f944358dbb5 #1 1f0cfaa9708c3e99bb7e2ecf8f7fd22c51fc3e3b > [ 144.101310][ T1547] Call Trace: > [ 144.101602][ T1547] <TASK> > [ 144.101858][ T1547] dump_stack_lvl (??:?) > [ 144.102269][ T1547] print_report (report.c:?) > [ 144.102655][ T1547] ? start_report (report.c:?) > [ 144.103044][ T1547] ? hugetlbfs_fallocate (inode.c:?) > [ 144.103497][ T1547] ? hugetlbfs_fallocate (inode.c:?) > [ 144.103937][ T1547] kasan_report (??:?) > [ 144.104270][ T1547] ? filemap_get_entry (??:?) > [ 144.104656][ T1547] ? hugetlbfs_fallocate (inode.c:?) > [ 144.105082][ T1547] kasan_check_range (??:?) > [ 144.105503][ T1547] hugetlbfs_fallocate (inode.c:?) > [ 144.105921][ T1547] vfs_fallocate (??:?) > [ 144.106317][ T1547] ksys_fallocate (??:?) > [ 144.106702][ T1547] __x64_sys_fallocate (??:?) > [ 144.107121][ T1547] do_syscall_64 (??:?) > [ 144.107521][ T1547] entry_SYSCALL_64_after_hwframe (??:?) > [ 144.108022][ T1547] RIP: 0033:0x7fedb9a039b9 > [ 144.108398][ T1547] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a7 54 0c 00 f7 d8 64 89 01 48 > All code > ======== > 0: 00 c3 add %al,%bl > 2: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) > 9: 00 00 00 > c: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) > 11: 48 89 f8 mov %rdi,%rax > 14: 48 89 f7 mov %rsi,%rdi > 17: 48 89 d6 mov %rdx,%rsi > 1a: 48 89 ca mov %rcx,%rdx > 1d: 4d 89 c2 mov %r8,%r10 > 20: 4d 89 c8 mov %r9,%r8 > 23: 4c 8b 4c 24 08 mov 0x8(%rsp),%r9 > 28: 0f 05 syscall > 2a:* 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax <-- trapping instruction > 30: 73 01 jae 0x33 > 32: c3 retq > 33: 48 8b 0d a7 54 0c 00 mov 0xc54a7(%rip),%rcx # 0xc54e1 > 3a: f7 d8 neg %eax > 3c: 64 89 01 mov %eax,%fs:(%rcx) > 3f: 48 rex.W > > Code starting with the faulting instruction > =========================================== > 0: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax > 6: 73 01 jae 0x9 > 8: c3 retq > 9: 48 8b 0d a7 54 0c 00 mov 0xc54a7(%rip),%rcx # 0xc54b7 > 10: f7 d8 neg %eax > 12: 64 89 01 mov %eax,%fs:(%rcx) > 15: 48 rex.W > [ 144.109953][ T1547] RSP: 002b:00007ffdf492f6a8 EFLAGS: 00000246 ORIG_RAX: 000000000000011d > [ 144.110612][ T1547] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fedb9a039b9 > [ 144.111233][ T1547] RDX: 0000000000000008 RSI: 0000000000000000 RDI: 000000000000011a > [ 144.111870][ T1547] RBP: 00007fedb839a000 R08: 0000000000000020 R09: 0000000000000090 > [ 144.112514][ T1547] R10: 0000000000000800 R11: 0000000000000246 R12: 000000000000011d > [ 144.113168][ T1547] R13: 00007fedb9ad1580 R14: 00007fedb839a058 R15: 00007fedb839a000 > [ 144.113814][ T1547] </TASK> > [ 144.114073][ T1547] ================================================================== > [ 144.114752][ T1547] Disabling lock debugging due to kernel taint > [ 144.115284][ T1547] general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] KASAN > [ 144.116161][ T1547] KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037] > [ 144.116830][ T1547] CPU: 0 PID: 1547 Comm: trinity-c1 Tainted: G B 6.3.0-13165-g1f944358dbb5 #1 1f0cfaa9708c3e99bb7e2ecf8f7fd22c51fc3e3b > [ 144.117939][ T1547] RIP: 0010:hugetlbfs_fallocate (inode.c:?) > [ 144.118431][ T1547] Code: 84 9c 00 00 00 48 89 c5 48 8d 58 34 48 89 df be 04 00 00 00 e8 d5 83 ca ff 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <8a> 04 08 84 c0 0f 85 d8 01 00 00 83 3b 00 0f 84 3a 07 00 00 48 89 > All code > ======== > 0: 84 9c 00 00 00 48 89 test %bl,-0x76b80000(%rax,%rax,1) > 7: c5 48 8d (bad) > a: 58 pop %rax > b: 34 48 xor $0x48,%al > d: 89 df mov %ebx,%edi > f: be 04 00 00 00 mov $0x4,%esi > 14: e8 d5 83 ca ff callq 0xffffffffffca83ee > 19: 48 89 d8 mov %rbx,%rax > 1c: 48 c1 e8 03 shr $0x3,%rax > 20: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx > 27: fc ff df > 2a:* 8a 04 08 mov (%rax,%rcx,1),%al <-- trapping instruction > 2d: 84 c0 test %al,%al > 2f: 0f 85 d8 01 00 00 jne 0x20d > 35: 83 3b 00 cmpl $0x0,(%rbx) > 38: 0f 84 3a 07 00 00 je 0x778 > 3e: 48 rex.W > 3f: 89 .byte 0x89 > > Code starting with the faulting instruction > =========================================== > 0: 8a 04 08 mov (%rax,%rcx,1),%al > 3: 84 c0 test %al,%al > 5: 0f 85 d8 01 00 00 jne 0x1e3 > b: 83 3b 00 cmpl $0x0,(%rbx) > e: 0f 84 3a 07 00 00 je 0x74e > 14: 48 rex.W > 15: 89 .byte 0x89 > [ 144.120027][ T1547] RSP: 0018:ffff88812ba3fd48 EFLAGS: 00010206 > [ 144.120545][ T1547] RAX: 0000000000000006 RBX: 0000000000000032 RCX: dffffc0000000000 > [ 144.121198][ T1547] RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffffff8a927100 > [ 144.121864][ T1547] RBP: fffffffffffffffe R08: dffffc0000000000 R09: fffffbfff1524e21 > [ 144.122535][ T1547] R10: 0000000000000000 R11: dffff7fff1524e22 R12: 0000000000000000 > [ 144.123214][ T1547] R13: 0000000000000000 R14: 0000000000000000 R15: 00000000fffffffc > [ 144.123947][ T1547] FS: 00007fedb9ad1600(0000) GS:ffffffff87f0a000(0000) knlGS:0000000000000000 > [ 144.124701][ T1547] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > [ 144.125263][ T1547] CR2: 00007fedb95005fc CR3: 000000012dfd0000 CR4: 00000000000406f0 > [ 144.125925][ T1547] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > [ 144.126601][ T1547] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > [ 144.127277][ T1547] Call Trace: > [ 144.127584][ T1547] <TASK> > [ 144.127848][ T1547] vfs_fallocate (??:?) > [ 144.128251][ T1547] ksys_fallocate (??:?) > [ 144.128646][ T1547] __x64_sys_fallocate (??:?) > [ 144.129072][ T1547] do_syscall_64 (??:?) > [ 144.129460][ T1547] entry_SYSCALL_64_after_hwframe (??:?) > [ 144.129972][ T1547] RIP: 0033:0x7fedb9a039b9 > [ 144.130359][ T1547] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a7 54 0c 00 f7 d8 64 89 01 48 > All code > ======== > 0: 00 c3 add %al,%bl > 2: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) > 9: 00 00 00 > c: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) > 11: 48 89 f8 mov %rdi,%rax > 14: 48 89 f7 mov %rsi,%rdi > 17: 48 89 d6 mov %rdx,%rsi > 1a: 48 89 ca mov %rcx,%rdx > 1d: 4d 89 c2 mov %r8,%r10 > 20: 4d 89 c8 mov %r9,%r8 > 23: 4c 8b 4c 24 08 mov 0x8(%rsp),%r9 > 28: 0f 05 syscall > 2a:* 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax <-- trapping instruction > 30: 73 01 jae 0x33 > 32: c3 retq > 33: 48 8b 0d a7 54 0c 00 mov 0xc54a7(%rip),%rcx # 0xc54e1 > 3a: f7 d8 neg %eax > 3c: 64 89 01 mov %eax,%fs:(%rcx) > 3f: 48 rex.W > > Code starting with the faulting instruction > =========================================== > 0: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax > 6: 73 01 jae 0x9 > 8: c3 retq > 9: 48 8b 0d a7 54 0c 00 mov 0xc54a7(%rip),%rcx # 0xc54b7 > 10: f7 d8 neg %eax > 12: 64 89 01 mov %eax,%fs:(%rcx) > 15: 48 rex.W > > > To reproduce: > > # build kernel > cd linux > cp config-6.3.0-13165-g1f944358dbb5 .config > make HOSTCC=clang-14 CC=clang-14 ARCH=x86_64 olddefconfig prepare modules_prepare bzImage modules > make HOSTCC=clang-14 CC=clang-14 ARCH=x86_64 INSTALL_MOD_PATH=<mod-install-dir> modules_install > cd <mod-install-dir> > find lib/ | cpio -o -H newc --quiet | gzip > modules.cgz > > > git clone https://github.com/intel/lkp-tests.git > cd lkp-tests > bin/lkp qemu -k <bzImage> -m modules.cgz job-script # job-script is attached in this email > > # if come across any failure that blocks the test, > # please remove ~/.lkp and /lkp dir to run from a clean state. > > >
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 9062da6da5675..6d6cd8f26d76d 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -821,7 +821,6 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, */ struct folio *folio; unsigned long addr; - bool present; cond_resched(); @@ -845,10 +844,9 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, mutex_lock(&hugetlb_fault_mutex_table[hash]); /* See if already present in mapping to avoid alloc/free */ - rcu_read_lock(); - present = page_cache_next_miss(mapping, index, 1) != index; - rcu_read_unlock(); - if (present) { + folio = filemap_get_folio(mapping, index); + if (folio) { + folio_put(folio); mutex_unlock(&hugetlb_fault_mutex_table[hash]); hugetlb_drop_vma_policy(&pseudo_vma); continue; diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 245038a9fe4ea..29ab27d2a3ef5 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5666,13 +5666,12 @@ static bool hugetlbfs_pagecache_present(struct hstate *h, { struct address_space *mapping = vma->vm_file->f_mapping; pgoff_t idx = vma_hugecache_offset(h, vma, address); - bool present; - - rcu_read_lock(); - present = page_cache_next_miss(mapping, idx, 1) != idx; - rcu_read_unlock(); + struct folio *folio; - return present; + folio = filemap_get_folio(mapping, idx); + if (folio) + folio_put(folio); + return folio != NULL; } int hugetlb_add_to_page_cache(struct folio *folio, struct address_space *mapping,