Message ID | 20220215144241.3812052-60-Liam.Howlett@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 1EED1C433EF for <linux-mm@archiver.kernel.org>; Tue, 15 Feb 2022 16:43:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9A8B16B007B; Tue, 15 Feb 2022 11:43:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9574F6B007D; Tue, 15 Feb 2022 11:43:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75C886B007E; Tue, 15 Feb 2022 11:43:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0094.hostedemail.com [216.40.44.94]) by kanga.kvack.org (Postfix) with ESMTP id 643E86B007B for <linux-mm@kvack.org>; Tue, 15 Feb 2022 11:43:53 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 222EE180AC357 for <linux-mm@kvack.org>; Tue, 15 Feb 2022 16:43:53 +0000 (UTC) X-FDA: 79145585946.15.11B832B Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf14.hostedemail.com (Postfix) with ESMTP id 56727100007 for <linux-mm@kvack.org>; Tue, 15 Feb 2022 16:43:52 +0000 (UTC) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21FEi0eL006569; Tue, 15 Feb 2022 14:44:08 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=eWYXErr3IcTSra7ghItXZ+6IrQl8bG2Uc7ZsQghCbHw=; b=jgqaFFCX3gvXdgPjSzdHa1+2kA6gSzbWEeN8zU4xlih3ewU2uetHkETCO5+eI0mQbtCt 0e1v+bfeYkVu8zf0kHJYo8MTjXoaOE2TnfL8/tmTuYXxpZlX7VCilan2DNnkvrD+kG0F cYILDSmPd1VYMII8k6CovQvGnnuO7VrOco1cSW8ewel+efeslEw3gQ9unObf+LXskxiG BgegB09oCtdhIePrCkGd12UXXoC8B180tfHKHIZ6B6yq8ZC6zQmNnyuczCTpajdpVmSz JaASwp6uZfbX2I8AZGoeFHnLyBsC124Shgh5c+rNIz3/DZLZgWucxtwUS7MVmxIHbsjZ 4w== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3e86n0hge5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Feb 2022 14:44:07 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 21FEf8lt016243; Tue, 15 Feb 2022 14:44:06 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3030.oracle.com with ESMTP id 3e620x7vn0-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Feb 2022 14:44:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AzM7bff0dexqLP71QZWvAfX8OU+bPb2eTxIr9gNnO2qHIUaE9NOxnU7Tt9YmpBZSeiT6mibOM82wxeKSbRJQ6ahub+UfX4TJZHQaQWSJQSOvAu6cFKqaX7DwFaY3X7ZRAiEIX7SbdnNM2TeloXoxF4cVMziMCbCwc+UirJiIfztfZiV4ofEZoap0hv+P3rC7+6auexftIXG+HOMglG1vAHwoW/imFRu+ElkcdmbFUFaU/XG8OwlGUn8VRzX+h5McleRVO72nh+FU73ZOv5Cg8+TVseLZwGnkKiY6Gs7viiS18VBVap6XDI3AiuyT3uhXSnElOCpYECX28NK6TgZUtg== 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=eWYXErr3IcTSra7ghItXZ+6IrQl8bG2Uc7ZsQghCbHw=; b=n1BjkWU2rV2yomxJIW+xyX2wgOMZKW2qPHWriWtVaewK7Y+tS8CWo0nlTJITrI10nmjsUo6YBLN1H6JtOTqcVfXD86tUtYgZ1lvvgELLHkyiy4fx46lqzVc5+JOWBSOrFFt9ipU+Q/YjJvtEHsJKaV5diXQoA+/46gZMhmZgfP8bxP832Rf/vowy8a+YjHbW4Zr67Pa8Y1LK0Ul3Jki7+XNTRMfgNENQyhhkdYVeu32B6vXU/EeRjwWkBE7sBh8IDesFPHjcf6PdCF2eAjMaEzeI3RCCXgHNSe6H5ZWzSZTHT+hYm0fkEKCEeFc6YI1i6720Ph0tDK4qX5Rq3e/SAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=eWYXErr3IcTSra7ghItXZ+6IrQl8bG2Uc7ZsQghCbHw=; b=nf3y3cz5sqTYGy8kspvx90sGzYz2Do8vt0bLMwynfqwFnTVuYV6lO5J4kKfJvGXiFh+dZPLsak5i7li14V086hpwFpqlziWlcP8Eh/hmFskZvXS9DXPdHLxnKvTxpZ7PBUPbPOtB7D++tuD7zDufjJtD94G2NYlaN5acPJeNMBg= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CY4PR10MB1863.namprd10.prod.outlook.com (2603:10b6:903:11e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.15; Tue, 15 Feb 2022 14:44:02 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::899e:951a:8129:8ef1]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::899e:951a:8129:8ef1%4]) with mapi id 15.20.4975.019; Tue, 15 Feb 2022 14:44:02 +0000 From: Liam Howlett <liam.howlett@oracle.com> To: "maple-tree@lists.infradead.org" <maple-tree@lists.infradead.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org> Subject: [PATCH v6 60/71] mm/mprotect: Use maple tree navigation instead of vma linked list Thread-Topic: [PATCH v6 60/71] mm/mprotect: Use maple tree navigation instead of vma linked list Thread-Index: AQHYInpjVDTwztuKTkutlmtP2b81LA== Date: Tue, 15 Feb 2022 14:43:25 +0000 Message-ID: <20220215144241.3812052-60-Liam.Howlett@oracle.com> References: <20220215143728.3810954-1-Liam.Howlett@oracle.com> <20220215144241.3812052-1-Liam.Howlett@oracle.com> In-Reply-To: <20220215144241.3812052-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.34.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ea684f74-28e7-4df8-fab8-08d9f0919bf2 x-ms-traffictypediagnostic: CY4PR10MB1863:EE_ x-microsoft-antispam-prvs: <CY4PR10MB18637EC7234AD8ACE7E8EB10FD349@CY4PR10MB1863.namprd10.prod.outlook.com> x-ms-oob-tlc-oobclassifiers: OLM:1303; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: u8Kb5BKQN3IA+J9riIJSnAtSOmOBlq7w1TRdmdukt1zmtnjxkToFI/AU38HshQ+HP63EObycumNPxczMeapttHDoJwz2rH1wOBBExjscRj3gWMaGOzAUPBevmITD2B0iV83UKQbifNVAUgAToiYfEi8rTVjZEw5wTSNchDceR6VK7mweHl0lypSw10ZEx7KfN1fE5Vwd9kp+/NaPTwfGpwPI+9Rw5kxeI7xwIuT81viULXWaf7jDDVgv9uaGZEWdDADJyPu7Wp2e4KNmOdMYf2vKbmn00Ix+sZZsx323J3gGyRHauS5xEtImNNO8lBTCpRrZP9PdZkhe+/E1Yzt2SLvQubwqhI8xtytEfazqdRgFqxivFrZDJol7UEAWqfjzCAp/YVPsBrb7q6xyIxCGGvKRr6q6j/qOPj6n1Z1yg23/aa8bhsKiVNpbs/Jd1vFjuCDnTGNel+LS0vX48P8rDkHiyWe0ocgwXJ40AyMZGSbBvTKsTSX4B+6ddPWrs0wNDbZvWKrWHjQT6VeJecX+0Dc7jIzCO3hmM/Wsx/MXBSUtTfC9+OxGfL+qYiNSpl+Chm4D6ZP/rm70DoXJHb3gEClxCIjFyhRtzlFsJa0aKh7N7xgK6RoXFboZ3h7sX9NaXb4Aldey383WrG03l9UccLYRei8+f7L94voV9IoWoCP/bXWDTV0oabh2vutYR9KXbwpfDCxuC8rwGX0UBz/m2g== 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:(13230001)(366004)(66446008)(86362001)(66556008)(8676002)(64756008)(316002)(2906002)(44832011)(122000001)(66946007)(66476007)(110136005)(38100700002)(76116006)(91956017)(6486002)(83380400001)(1076003)(5660300002)(8936002)(186003)(2616005)(38070700005)(36756003)(71200400001)(26005)(6506007)(508600001)(6512007)(6666004);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?27R9HXhrzNDrVeDOyS419Vm?= =?iso-8859-1?q?Tkw5loy31IT9yni46jbVnbOtTx6gXFXHn2Q4+DTl5kzitmB3AQJSk3kAjd1V?= =?iso-8859-1?q?NjiFhLyyUk24LuG2khCUbRGUzQrQZgQ/GtXBgZpGuL1nN1O7lcDqAr0NvJJN?= =?iso-8859-1?q?OQ5nQ8+1GSC2sOXaicqa0+Cx/RAP84r4W1lBRcKzDaUCcAGhfF/XZytP68Zg?= =?iso-8859-1?q?1d3FWGCBreFNc+dIFsVse9VWAEqMi8dvv+C3U8t7hQ1smmZWrXhc+cGBhtVE?= =?iso-8859-1?q?1IDr4L3Jxcc4XGmIIl9SNf29e2754lgVPoO05rcMBF+ZrP+EOHnZCa+89H+q?= =?iso-8859-1?q?22lJwrTz8Py9OSDvZq6VQK2gaNPfAcazemxGPkT5MIByK0nB3lRgiA4i0XYS?= =?iso-8859-1?q?UEd9jqMllNLeq4JwfuIVf+V728PJ2hor+kFIjAc5b49c+/Yxh26ipcksN6P4?= =?iso-8859-1?q?m1RfhgXS4OpWNT+fjZEuFm3doB1WFs/nnZ5rQtyngiS7Ie2odxu5Ph2mPyrD?= =?iso-8859-1?q?UcZjOXw5MNOxznvmHjseCgL0sino2tYO7Q/HLb0dTHKFtAiCcbW3UJ8Gaddd?= =?iso-8859-1?q?yKKTSZ1UswDvRvu+Lt0NGowC1iOoTt5YgybHzEbmVGqVkR+Aq3fVwO+r/KJW?= =?iso-8859-1?q?/xRO5CxqBsNHNQHQslwHKlsnbramYhOKFrc9fMxD6rYLMtScCFg00f6EfDzF?= =?iso-8859-1?q?bqvVPVAQdP/aU8liCQmQ8QfDZwEoV8IEzKzLlGZkl8rwPUUcPkiiL+DiR93X?= =?iso-8859-1?q?l1nBjJyCxveXxV6tt2afDhoF3juClsSX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Tu7NGAKgZvI?= =?iso-8859-1?q?=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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: ea684f74-28e7-4df8-fab8-08d9f0919bf2 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Feb 2022 14:43:25.5258 (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: E46mof+7TwNSWhOjof+TKHHBaCFlGWGeMTFdG1TgDgRik2Qwfp/2lNnUb8vKNYOAMov6CePAm54MN68to1aXGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1863 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10258 signatures=673431 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 spamscore=0 adultscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202150085 X-Proofpoint-ORIG-GUID: 8lPkbI4yEypqv7tZKkZW7Hlyv3UJHHgH X-Proofpoint-GUID: 8lPkbI4yEypqv7tZKkZW7Hlyv3UJHHgH X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 56727100007 X-Stat-Signature: gorrmnyq7n1ntbq6m41iprx4qc743e37 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=jgqaFFCX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nf3y3cz5; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf14.hostedemail.com: domain of liam.howlett@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=liam.howlett@oracle.com X-HE-Tag: 1644943432-74345 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: <linux-mm.kvack.org> |
Series |
Introducing the Maple Tree
|
expand
|
diff --git a/mm/mprotect.c b/mm/mprotect.c index 0138dfcdb1d8..51ef845df4c8 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -528,6 +528,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len, const int grows = prot & (PROT_GROWSDOWN|PROT_GROWSUP); const bool rier = (current->personality & READ_IMPLIES_EXEC) && (prot & PROT_READ); + MA_STATE(mas, ¤t->mm->mm_mt, start, start); start = untagged_addr(start); @@ -559,7 +560,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len, if ((pkey != -1) && !mm_pkey_is_allocated(current->mm, pkey)) goto out; - vma = find_vma(current->mm, start); + vma = mas_find(&mas, ULONG_MAX); error = -ENOMEM; if (!vma) goto out; @@ -585,7 +586,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len, if (start > vma->vm_start) prev = vma; else - prev = vma->vm_prev; + prev = mas_prev(&mas, 0); for (nstart = start ; ; ) { unsigned long mask_off_old_flags; @@ -647,7 +648,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len, if (nstart >= end) goto out; - vma = prev->vm_next; + vma = find_vma(current->mm, prev->vm_end); if (!vma || vma->vm_start != nstart) { error = -ENOMEM; goto out;