From patchwork Tue Jun 21 20:46:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 12889784 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 F10BFCCA482 for ; Tue, 21 Jun 2022 20:47:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B3FC28E002C; Tue, 21 Jun 2022 16:47:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ACA798E002B; Tue, 21 Jun 2022 16:47:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 942048E002C; Tue, 21 Jun 2022 16:47:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 779078E002B for ; Tue, 21 Jun 2022 16:47:19 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4FC4E3490C for ; Tue, 21 Jun 2022 20:47:19 +0000 (UTC) X-FDA: 79603428198.19.AAAB8BE Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf19.hostedemail.com (Postfix) with ESMTP id E682B1A0016 for ; Tue, 21 Jun 2022 20:47:18 +0000 (UTC) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25LJ2U9Z018663; Tue, 21 Jun 2022 20:47:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=vPwbpL22VIaeF3NTC3VFoBwAx7aF25Ak9varGQeFz40=; b=IaIjC6F9WIvAn7hGcb1a/PHDzz+vJeW/orbDeJ1W/lVhJpYbsPCTuhKBVE41Bj0pirud zpQ+z8seKhiAeozoClDIR+3V/FZiDxJlB8iM5D6Qb2i/AmLd7HrULUe6SjCXnfGEwwkB OBt7olU/4U99I2sjwx/EVmzX2k9PwDr3MDt1tawq5Lh7GG2dQMKM22py1ivivmnUX8hY /GTH4cgOC9YmXiEQHq8eVzVOq9dCJfq8HGCBfRQjFQLOGXjMvGJXKvrVvXevLtEbV5nI FZipNQSTb18jNR6POHB+8prMLxyGvzfAwULEk/CFIpIrgYjGscJ5QgPogbd+ACuR8hfd nA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gs6asxpwa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Jun 2022 20:47:15 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25LKeUgt027828; Tue, 21 Jun 2022 20:47:14 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2176.outbound.protection.outlook.com [104.47.56.176]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gth8wsp36-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Jun 2022 20:47:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T2rRltHjguxqx/FtM9rh8WamQfNDo8P/8L04RXO0iff4kR67uSw/wXmkKBQyOhONOa7DEsQIWKa3iSUDq+FZOXaDHSxK1tofMO614mX5Pa1CxjuiEQn0tFHx3xsrNiIqgfSQ5K5djbcTJ+D/vCPxdFB6hAUX49uORGJwiK8sb3WigoGKl/NbwdDZIa4+c5NWJP+eHBuOD76o68rcj8RSFuWmTAn0vzrVXIPhQ/KyYsaC9j9T0b/MvCQv7QxatMMVXZnMfzCWZl9K+zaN3BMogFTgykTPuhyBwgdmQYaRVg6dn3e4OYNYY9m7cVJITwbKjCNVJn6C0UzL5Svy2CY3Hg== 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=vPwbpL22VIaeF3NTC3VFoBwAx7aF25Ak9varGQeFz40=; b=cxog7GEJWm7QLAT8mzz6CVoriwcb1aCZpSgVCd3TYENERi8y1cIX1cTMSJtYfoQLXKSLk9Q1Ip9xArnqEt3r4DP4GXDWlP8zG5bQAJipZaNFzKxJfx0JeJQ57+ySlXeviMV7irmc33vESL29abUCozfuVO4qx23QeBYP0Na9gP70u61WB1RPvlRFceeJQXofqNG+7lt0XPDr6MwEuqd6repPDbp0CtjgmTRnF7Q4mPN+2OB4zj8u4l3KMM8Xkem+f+3WytZOlKUmw8WWefquanVuma5ZRY6Fq8PTr14AxZMoqc4tMTKSxaQ2I9myYNyp+/3emQQnmSdgI1JAaHHotA== 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=vPwbpL22VIaeF3NTC3VFoBwAx7aF25Ak9varGQeFz40=; b=0I5a9xQCi1jRsmHLVbky8kf4u2mGZHgbks9CQwS63FId9w0Rzujx5Q/Ln1UFXwpDuB8IhAWEiVm6eqcsXpyU0T2YXDcRrwsTdd+VFbXpgUQjDc5KXtqVUhLUCM3ONPP8E0n/U1CIHokLHJTNQBIXe6+HqkME+vW8ko5jUt+c7OM= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SN6PR10MB3085.namprd10.prod.outlook.com (2603:10b6:805:da::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.15; Tue, 21 Jun 2022 20:47:11 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::f59a:175d:d24:949c]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::f59a:175d:d24:949c%7]) with mapi id 15.20.5353.022; Tue, 21 Jun 2022 20:47:11 +0000 From: Liam Howlett To: "maple-tree@lists.infradead.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton , "damon @ lists . linux . dev" , SeongJae Park , David Hildenbrand Subject: [PATCH v10 26/69] mm: convert vma_lookup() to use mtree_load() Thread-Topic: [PATCH v10 26/69] mm: convert vma_lookup() to use mtree_load() Thread-Index: AQHYhbANxSE1TW84RU+pSInS/Ep6HA== Date: Tue, 21 Jun 2022 20:46:59 +0000 Message-ID: <20220621204632.3370049-27-Liam.Howlett@oracle.com> References: <20220621204632.3370049-1-Liam.Howlett@oracle.com> In-Reply-To: <20220621204632.3370049-1-Liam.Howlett@oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.35.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a233648c-cae9-4716-ce4f-08da53c73736 x-ms-traffictypediagnostic: SN6PR10MB3085:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EZrJCgZP33v0DUM2WNwlMAdgh5++Nr51FpZdXwsnm4y9lxF2hZt6yJZ+Wg77qJNPSZWsEoAlG19VPE+0Mi4Mw3/kkK3EVNPBNd/A62kU/uHNUawVHVvnsuSqdzc/ttRn9E1jNrQvW1nIXxxs+V20xv72vHN+RoPnMjphUpPCMIiwflCHkxx4HU8zmmp8YeshlFQzirGpVjxQMDAQKE0DbnUsLWRh2YYXNTFexMSzEPi9/Fkaix3VUefTgrdpb768WTpVhrJWfrAEKkaQpB72az2V+hgyhVHTtUAhRQUyOjZmXZ/TksUMRxaC5DdpaUZV9AeHyQ5XTCi5LYAmGhX4wVauFSOYK1Y/TKaGGX22xIOXp9hV2iAdytXDAoNkGFA9U6S7DakvjwenF+T0TDYAlPXKfqnjbdbdyjuLAHnuOern+itiHELpV2Q3vCjGHH0ag9fVASyh6dCQicnL1wwjC56LhFisoh8Ddrdrr1OLkx3hWQLUOJvsaokY/cgJeQyvOsJdKQ9KWSB3B/WX+WaUFmt1Xi7lzjmfGBEIxZYr+LLex6YYR88nWUTeuP0MlhNx4UaOaIMP8kG2LGc9j0Af2yy/WYQl9XXg3MgQtjBizm4rtRgJDpMN6afsGIyYhHPIiueSfgp76XARvF4215jNit73SsQhQv1vP6Pb9UESZiDyHxzsEqj/ozVo4GFbJ7C4HVuZXPpD80+XMEMiEFCXpQxd12rj9URo5+Jrkb7LjcSVs7cdU9+6Dk14Vq2qZxtRCUzRdiZNbpqNrFPA+PwlNatOrTToXdhc6BftHFWKzQw= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(366004)(376002)(39860400002)(346002)(136003)(2616005)(66446008)(6486002)(76116006)(66556008)(966005)(36756003)(64756008)(83380400001)(478600001)(66476007)(1076003)(71200400001)(316002)(186003)(44832011)(5660300002)(8676002)(66946007)(6506007)(2906002)(41300700001)(26005)(6666004)(86362001)(91956017)(6512007)(38070700005)(38100700002)(122000001)(110136005)(8936002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?UXt+UneDuNQ+U92AGHK/lO/?= =?iso-8859-1?q?iBzyYEr/3AUWYjKQHOlW5ApjAp3w4StSkIbrUDd4BRGexR9uLm2Svj5ey9HH?= =?iso-8859-1?q?u19C9LoBoonODx5yI2yBGyO4XFwAMeZxN/JLOjRIrkCSwp1bWyb8SAv7XTWf?= =?iso-8859-1?q?Nt+tN7ACpf2N7kwBHuufxASNkXgZSxc7R+19KwsCQ8YRWAvnSGzLagVUOX+i?= =?iso-8859-1?q?+g+GcjuahKjWPoE3eRsA+HfIex+0O4KtOPH+3g+ls+jTeyZhwjx44Zq4ailJ?= =?iso-8859-1?q?B4UTOTeo35newMp9mh2A/ims3XrV9dOmb8/Ac5+4alg/zc9hiuT9EIUnx5+t?= =?iso-8859-1?q?OquK1CsB3vmk/qKE9iMgD6yyhGh0/32ZJ+cQ3Yo2wAg9deVz6IPbH2mIsPVC?= =?iso-8859-1?q?H4bFjL/GSehtXwYzImvfk65ol/YsbM/5Sbnld0J2cNscjAYfWNkV3/ABiEu8?= =?iso-8859-1?q?KqbkH+qrpItPnt+wp9I77ZCDSdsq82T5tb41IANNPfQ5yYaFNpdtazdIoKhy?= =?iso-8859-1?q?1WZixcvYTU0Vfdo8C+Wu2bIl0kcHOmPd50L2rCwtV/9OlT4KwgajDKUiDFt6?= =?iso-8859-1?q?yov1YKVPUb5OzeVUZv3a5MSBBlFzxwfn6fAtIjoavWfvpRdUlO9oicA1RVbG?= =?iso-8859-1?q?3meE8EpN+V3SGs7YmyohM3Ngew2dr124hcJUnokUqk1KGpHeIksGdiCUtjsf?= =?iso-8859-1?q?LhXUAdF3mAFXz3Z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dFKBeyzrZ6YcyI8x+03jIjayQ5Xg3qbfo6?= =?iso-8859-1?q?4t1WmS++w+DjbUrr4WmxgVrwzKDSDasor5TkbkUIr43CtDOcvGbbS4Aj85Yr?= =?iso-8859-1?q?yZ8yyIPNqRCaYCOm3mG0Cb8LY5Ig4sJuusV4WLhpguMfIcQkitZKB31TxVeg?= =?iso-8859-1?q?4qu4JWjU21sMxN+TsTdYim8DvY8Wir0smOOCegtOzxE4nZ4Y9+TdBzNWf09m?= =?iso-8859-1?q?sz+wPbng=3D?= MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a233648c-cae9-4716-ce4f-08da53c73736 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jun 2022 20:46:59.6290 (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: 4tl664p+SNR4k6eZQoWk2wiJZkx9RTiMHxK8GZN8Q4mzCKtP8lHJHhxKLMdQvBAKw9XX7LkrEvStvmF5+Xow2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB3085 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.883 definitions=2022-06-21_09:2022-06-21,2022-06-21 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 mlxscore=0 phishscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206210087 X-Proofpoint-ORIG-GUID: F68_5PxoM3jBY-0zcAug1Yz7gMG0Dq7C X-Proofpoint-GUID: F68_5PxoM3jBY-0zcAug1Yz7gMG0Dq7C ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1655844439; a=rsa-sha256; cv=pass; b=k/UjzTESjkn105e+Z4rZmlhi1/NdVoLWcZHMyBuG+SKdXSc/RzdlJizUODBk0atUQsDOcW Cr2R4ZNasbDvXFqe+Wt3l59lTMJIgunBrCYmk+eF4xCpmCJep3QVrdkHO2kQm/wJ++dykq 311Mwouh/wSsu0AyEYFVWIuKtn8YgsI= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=IaIjC6F9; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=0I5a9xQC; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=none (imf19.hostedemail.com: domain of liam.howlett@oracle.com has no SPF policy when checking 205.220.177.32) smtp.mailfrom=liam.howlett@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655844439; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vPwbpL22VIaeF3NTC3VFoBwAx7aF25Ak9varGQeFz40=; b=SFMc4k0QXW8yZ37Lo+YtpopTFVc2UnirtV8Ygvc0L5GBsNACZi9dhHlHZOLLGpho4P5JXc 3qou/6xCooIMqITg51zVlKWhjbnqnwGKK7ubj8cTtFK/mK1UIusK2gSbvfHlHo/iTJmmdf RMW+j2E7UeF+I3kQj7qnrufU6KMF+DU= Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=IaIjC6F9; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=0I5a9xQC; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=none (imf19.hostedemail.com: domain of liam.howlett@oracle.com has no SPF policy when checking 205.220.177.32) smtp.mailfrom=liam.howlett@oracle.com X-Stat-Signature: zrug16fen5jo7ta3a1p5jq64fzsoj38p X-Rspamd-Queue-Id: E682B1A0016 X-Rspam-User: X-Rspamd-Server: rspam03 X-HE-Tag: 1655844438-335703 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: From: "Liam R. Howlett" Unlike the rbtree, the Maple Tree will return a NULL if there's nothing at a particular address. Since the previous commit dropped the vmacache, it is now possible to consult the tree directly. Link: https://lkml.kernel.org/r/20220504011345.662299-11-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Vlastimil Babka Cc: Catalin Marinas Cc: David Howells Cc: SeongJae Park Cc: Will Deacon Cc: Davidlohr Bueso Signed-off-by: Andrew Morton --- include/linux/mm.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index b0a84f7c79fe..1b02988b6fc8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2808,12 +2808,7 @@ struct vm_area_struct *find_vma_intersection(struct mm_struct *mm, static inline struct vm_area_struct *vma_lookup(struct mm_struct *mm, unsigned long addr) { - struct vm_area_struct *vma = find_vma(mm, addr); - - if (vma && addr < vma->vm_start) - vma = NULL; - - return vma; + return mtree_load(&mm->mm_mt, addr); } static inline unsigned long vm_start_gap(struct vm_area_struct *vma)