Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5608529rwb; Tue, 17 Jan 2023 16:26:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXsiAqtSjHkqaV0zF794g3c3mNGQ3qkaczblTz5x674TmavPBVOiC5TLr/nf8lt+pxt+hLmG X-Received: by 2002:a17:906:85cf:b0:870:159f:c515 with SMTP id i15-20020a17090685cf00b00870159fc515mr5501009ejy.21.1674001576106; Tue, 17 Jan 2023 16:26:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674001576; cv=pass; d=google.com; s=arc-20160816; b=ZjjE9Fu/ULTIgX9UEXgUbTtccYAoiJsQDzXEzD6sLS0p+2xd1YM/yBa3YFU1R3pkGp N7fGiBZRGNHaZs4++F1GvKCK3a1GFgpLhHlMZ7RI7Hv85FmnY4JDBwy7IihttMX/gOz2 exmgBnwUFaGEBPODtWureeYkaOicbVW2I1xsHrRInNGavB9ZEB8d96C9PMbwNm8mVxen 1Th8fBR/TkQp0N2qBj7mvLhFV45DQMq198FlTjuMjvf+TihZ/FMcoEO34YKkS5+f4hId RYII7PZLCu6hsq9zkgOr3uHBYz131kDWA+RzR0VC49llzai0hwwJznCz5FHdr1jlOneq FyXg== 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 :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature:dkim-signature; bh=il1+Ve7oMpWk67CFQoiC2P+ktHpCT7TD996Nn3Ca6As=; b=pf24OV3+Fosuixd6DfJkmFeuQ+cogHnizb8qn00ZX8K592VwtXcY8v45p9c4PK3xNK +6SlGQv6afKhEKpgIDTeZwMUsWVFbDJYVxGzw5luHex2aRRY86/iP7ucLFaNQF0j6u5y x5GymZCvB23mn1uRlewhbIaTeZiupm9E9l4dkgJG/I4da/6rHd1UpCXVxNZw0WwkG19U JsFutA5As+AwXRa5jrlerBC2PaUYpWMF78dA1GgAMcpxeQ4yCdk8o/g3SFOmTgEdmquw HEyT/6XX3hziv++X1u8aPKTVcrNXNBt49+ZJrb3/Q8Zn49nQn9pFgdaqGiZB0Nd/ULqe MURA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b="u6/j1KQG"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tOCS6Hax; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb19-20020a1709071c9300b0086f90a36bfdsi9716076ejc.369.2023.01.17.16.26.03; Tue, 17 Jan 2023 16:26:16 -0800 (PST) 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-2022-7-12 header.b="u6/j1KQG"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tOCS6Hax; 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 S229638AbjARAGz (ORCPT + 46 others); Tue, 17 Jan 2023 19:06:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229558AbjARAGc (ORCPT ); Tue, 17 Jan 2023 19:06:32 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC2FAC638D for ; Tue, 17 Jan 2023 15:19:24 -0800 (PST) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30HLxCsH003616; Tue, 17 Jan 2023 23:18:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=il1+Ve7oMpWk67CFQoiC2P+ktHpCT7TD996Nn3Ca6As=; b=u6/j1KQG6eenuB+T+UGnOSABZ2F8mS4OG2UlZOacCFdPHTuPsjvNMNpOfBtTpLXhjVmZ hWx0lsK7yQypWydMZ4yhOMjn8Z5ywUkUD26fAeuyaRmj5sEBVaIePZZxs8jzkS+Ci44M sxBZr1zijTORDunrVve+h4KtCT4xAgXGpeVElWZnq9YIFhKANij0PjjAzZ+4mbQwtLXq BRTqmK5sJkEqhKXqC3cU5+U8Ld+LXzYLjhqedM9JU68UQ7JVavVg+8MNFnYdxt647oTu OC93vsk5EGq9tmFOmD6brnSyiFiVaY+TbWhHlSgQNxVt1Xgn/Hb/kBfRzD2u8qc/clOu oA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n3mxt686h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Jan 2023 23:18:08 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30HMrxuT021206; Tue, 17 Jan 2023 23:18:07 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n64vcrq4u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Jan 2023 23:18:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=llloJSNS0vdQR1FzzgWuZlpdUt1XdWl+VyAdQyJhaSQLxLW7wqWmc6JJ+KNfQWiCGntuAKMrRqngetZcd2jZx0S2AUlP61w88l7m782fgJ88srtD0WY0NXhwhb5JL9XjiPdsx1IW/nc3lTzsOiYeP2t6SOzjfD2kV1oB+0k1ZTHNRd/noGBs4mYphkc7kCxqsGPaZneEqZNEwflRg3ptzSzPWthrJHzRIZDienp6KlWK+6b/Kh0RqPmQ9NaKsx32nLuXzN2tXpeQkJhSErxY90g+2zXpMj1NpmMJ7tgMzl6/2YSpPp/uTXF6+5rIfTcFxmpCf6L5SN3dvCh5tfZpqw== 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=il1+Ve7oMpWk67CFQoiC2P+ktHpCT7TD996Nn3Ca6As=; b=QUzjrM3C/ETIh64bNJOfjlNRMNofV028RRUO8By09w5EyPu50/QHARDtJBe41VDa2VjgyVPVDrSIP84MyrwqW2adUjkJZ8W/tNgIT1DII4a35G6ysUT1Q8MzsLyySqyj76iXLlTPnvFVrt9O1Jl5EC/tUnv2swGvS/PCsK0je7WlMsW4yAmsSXMGoZXlQXZbFig9zzxHgtpnIgcik4qfc52cj84NOTZijoEn7aD3HaV6n8tJC98YJJgtz2fvPkNWp3/P8ZjIGTHt6k7a1bk6cIRvMaq8dpHqxdKWPe+/6qco+DBHCVv+t2giR6mssEd6VCav3s8v3fEfp/vcAPHU+g== 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=il1+Ve7oMpWk67CFQoiC2P+ktHpCT7TD996Nn3Ca6As=; b=tOCS6HaxZbA5kkGupl1QMLIoXQHSClsnWL3rMBi8oq10/gsqpJccDKYB8WDOt/3Uz/Zwg5vH8VrOyLRlQe0eWkooISWtK9G91LApCoYtJQLo2zBQckRVO4qXi5Iu8LftnJC8UlyJH+HCtjCegveUqMoQEnKEWotbIVI9tPXOulk= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by BL3PR10MB6017.namprd10.prod.outlook.com (2603:10b6:208:3b0::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.9; Tue, 17 Jan 2023 23:18:03 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::a02:2ac8:ee3e:682]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::a02:2ac8:ee3e:682%4]) with mapi id 15.20.6002.012; Tue, 17 Jan 2023 23:18:03 +0000 From: Liam Howlett To: Jann Horn CC: Suren Baghdasaryan , "willy@infradead.org" , "akpm@linux-foundation.org" , "michel@lespinasse.org" , "jglisse@google.com" , "mhocko@suse.com" , "vbabka@suse.cz" , "hannes@cmpxchg.org" , "mgorman@techsingularity.net" , "dave@stgolabs.net" , "peterz@infradead.org" , "ldufour@linux.ibm.com" , "laurent.dufour@fr.ibm.com" , "paulmck@kernel.org" , "luto@kernel.org" , "songliubraving@fb.com" , "peterx@redhat.com" , "david@redhat.com" , "dhowells@redhat.com" , "hughd@google.com" , "bigeasy@linutronix.de" , "kent.overstreet@linux.dev" , "punit.agrawal@bytedance.com" , "lstoakes@gmail.com" , "peterjung1337@gmail.com" , "rientjes@google.com" , "axelrasmussen@google.com" , "joelaf@google.com" , "minchan@google.com" , "shakeelb@google.com" , "tatashin@google.com" , "edumazet@google.com" , "gthelen@google.com" , "gurua@google.com" , "arjunroy@google.com" , "soheil@google.com" , "hughlynch@google.com" , "leewalsh@google.com" , "posk@google.com" , "linux-mm@kvack.org" , "linux-arm-kernel@lists.infradead.org" , "linuxppc-dev@lists.ozlabs.org" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "kernel-team@android.com" Subject: Re: [PATCH 28/41] mm: introduce lock_vma_under_rcu to be used from arch-specific code Thread-Topic: [PATCH 28/41] mm: introduce lock_vma_under_rcu to be used from arch-specific code Thread-Index: AQHZJGyfeVOZgHFEukOrFFAlqbUFgq6jJWgAgAAlmwA= Date: Tue, 17 Jan 2023 23:18:03 +0000 Message-ID: <20230117231756.tlfk7zjtpk6uio4j@revolver> References: <20230109205336.3665937-1-surenb@google.com> <20230109205336.3665937-29-surenb@google.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR10MB3022:EE_|BL3PR10MB6017:EE_ x-ms-office365-filtering-correlation-id: 09e1b42e-7711-48eb-b972-08daf8e1150f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gtotweTpGl8EtuUoSNOhGKwwwPHfP0ibtnzyFhoLciE0kVvEMwWxkaZH0CoqGWGA+7GFw2v3EFJ8lAKBW3pUJXvUNbL58+eNv6mAyMySWj5NEYmxFp3GXMESPIBF5tuc3291zmHI9R0Tirz8aIb/YFXkRcSBKrMeU2d8SKIMXv4wM8lDB0+Mkgx/od7FEgww2I41JqQEcRLtWuVH0fV6nJoiXjqognxrzPTNT3vvBzR2SOmmQhUgSyrqiB9Pio9gg/OCWHIa8vvHUZc4J0x+0UP5ViuX+MQZUcB+KJDbo50aaNqB7rtjdTEUtDEJsmS2J50lhr/cflLhjLS32w4R+Gr6sWERdj9T8BqePyO0KQ76oAmfD3oryrJVqjmX3xUJZ9gHiXzNZQLO2e8eYxogon1wyRb11BPklVpqRyKBixmU3hPLJSYcIjJL7zAZJyLAa0SwGIsSGqmj3yd5JWUt3PoLv01zlpWlTqe0xTnPS3VsOA7hP/TE8kC4lTIpIXBw7TbgbV6tJx8K62rYpyUV009sZH9rGACnFyE2NN1IjxzJQEOGAZJIUEA/+GrFwqFCzViC7cfcHx7Xi1MjE9TXcf/1QLuDF7k4dcVVaaDs/8DbzSsAnrg/Zc5lx1U/ePRPXyAAwDyiHvSTWAWL8YqcoIDZsnS7Adou3EYzttku+EYK/frSJc0HGiZoHR885uaMzb+yWvcD0WCPLlcFJE5hHg== 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:(13230022)(7916004)(376002)(39860400002)(346002)(396003)(366004)(136003)(451199015)(33716001)(66446008)(66556008)(66946007)(66476007)(186003)(76116006)(64756008)(41300700001)(91956017)(8676002)(6512007)(53546011)(26005)(9686003)(6916009)(4326008)(86362001)(8936002)(5660300002)(7416002)(83380400001)(7406005)(6506007)(54906003)(478600001)(1076003)(71200400001)(316002)(2906002)(6486002)(44832011)(122000001)(38070700005)(38100700002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunk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ag7S6RQ9JuvM68x+d7CF+K26JPwMBAihbGa82KP89p8VoLnLhHaY5jJ0X5?= =?us-ascii?Q?5z+r8bcR1VtD09iMK+V8KTgqQqsflYb909u58Ciu40u3nH0pEAg4YIhcgCmU?= =?us-ascii?Q?EljDAsFY6IS3tir+vKgqOV9eZDwf58AWTocVyRsJzcMNUZtUP3XWtIo0yEBf?= =?us-ascii?Q?j5vJKnMH5V5IeBjzwlbpPWq+J5eqeI88oRYCvJr5Dv9lUxyFjqF+OX+veR7C?= =?us-ascii?Q?CqBzGVH1M6+xp8XYqAYg5Ru/QlQGwu/Ge3kKno+zVUlC8Q1O2+e1KSLV/Wv8?= =?us-ascii?Q?V7t8YqLVd6mmEmql8T0UwBK89sKD4cWxGjEzuwm6bZ00bzRpGNHs2L23Qugm?= =?us-ascii?Q?xPzBZEg73o2nQOtgl2f80fBoFGnzbHl7lW2eOAMFzFGwJoMf/nKQ0XzTrNr/?= =?us-ascii?Q?CEeYkGeLlUPBOlpGNEuWcgDTvVKVrIAfJWdDMVEAQhi5uUtMn7XTSxleoY4a?= =?us-ascii?Q?OzcAYqPBU//r19EC0hQnPC55tR3ANXOqbTFL9C7rHWX9Js8xkiuMy/pQoObq?= =?us-ascii?Q?Qdc7qlOR6P1EKoOCkuPfyWai/T2/x1vYWeuIXronVf5xKZBMwHTqfyFUpccA?= =?us-ascii?Q?fA7q7vvHyyFzcA+2F0NAs5G1szODtfVBrOq0vroDiFu6WJ0TUaEInElLwYsL?= =?us-ascii?Q?0pjzVOFjwf03ucgDHtFfqG33FYqeTjXfMuUbHhrvWLF5gYsl+JF3sN9QPK01?= =?us-ascii?Q?zm7wtSiuiVkJ9UjtveTi1ozfmrTylrshMSboQlGIVGUJV8QJUw85psKIVeSJ?= =?us-ascii?Q?qQ=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-M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vi2M0ZwIcgS93PA3OtGvedlVA9UbaNsV9CD6Z87eT/UU5XU/TFOy/kLoufz0?= =?us-ascii?Q?d0yvd/qb3hjZUXzv+BzxCpizysy5iQhxJBlv7vViPi8iRC1H7T4sxMFPrOvl?= =?us-ascii?Q?HQhsVGaoIRu/4CZFdqXCcvRaIAQw9Kgubpei1fACpO2lfhhK9cUDKVuMMPt+?= =?us-ascii?Q?FiRINauEsw9720P43xclbMJ3Wr0/BV3jk133EMAkC2pjm9j4EaNJj0qlqPt0?= =?us-ascii?Q?BKJam7yXrltYbUKn2wVhXRdZdEnH9RNPt3h6F1CVVfTXcFswuqKsHhUxeT4t?= =?us-ascii?Q?rCKfobXa+euhCCZqEiNQghC5Rin9kgfQ+efaNalpngEEH2cTt3qk1ZJkHz5M?= =?us-ascii?Q?0XWl9rNC6eQUHR7tk3tHBWt5iV5lUNAJAxmlU2mNdm5o1XXALxwC4IWyWRIA?= =?us-ascii?Q?gDMPb9sKkzEtjnyf/zssW9JQN/fDQ0tnBI3n3FemW7yaTytOKDTrEyCOyoWY?= =?us-ascii?Q?tFG+Uv7fnPo4YowhLyaSCJEDLvNGp89gC3D3aHwxwSv7/HKuyzUlFDm1+Jkq?= =?us-ascii?Q?4vDaxtX2+3SLBlwfaqgOhcJvExjndshY7M8mUz8i0NlbYo3Ja0hWCdRpOXIX?= =?us-ascii?Q?IFAoUVP6nl32I/tiecsno+qCdakUcD1dySRG6irscjGuiYaZJccxQYPwGQJU?= =?us-ascii?Q?vZSujK0EHa5ILKyiQ2PbNMafmyCuIRpXV0PC?= 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: 09e1b42e-7711-48eb-b972-08daf8e1150f X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2023 23:18:03.0716 (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: MeQ28oqHKVUmbd8KPNxCyo5pHXt08sbOPNwvFUvBmwaVcf8EPVGKw/xQ+UWhH/jqd57YcRRvtDStZK9VqbBbTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR10MB6017 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-17_10,2023-01-17_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=638 adultscore=0 mlxscore=0 phishscore=0 suspectscore=0 malwarescore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301170186 X-Proofpoint-GUID: ZzipPF0vWqs4V-Y_jxXYFWXOuLWrrPbe X-Proofpoint-ORIG-GUID: ZzipPF0vWqs4V-Y_jxXYFWXOuLWrrPbe 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 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: X-Mailing-List: linux-kernel@vger.kernel.org * Jann Horn [230117 16:04]: > On Mon, Jan 9, 2023 at 9:54 PM Suren Baghdasaryan wro= te: > > Introduce lock_vma_under_rcu function to lookup and lock a VMA during > > page fault handling. When VMA is not found, can't be locked or changes > > after being locked, the function returns NULL. The lookup is performed > > under RCU protection to prevent the found VMA from being destroyed befo= re > > the VMA lock is acquired. VMA lock statistics are updated according to > > the results. > > For now only anonymous VMAs can be searched this way. In other cases th= e > > function returns NULL. > [...] > > +struct vm_area_struct *lock_vma_under_rcu(struct mm_struct *mm, > > + unsigned long address) > > +{ > > + MA_STATE(mas, &mm->mm_mt, address, address); > > + struct vm_area_struct *vma, *validate; > > + > > + rcu_read_lock(); > > + vma =3D mas_walk(&mas); > > +retry: > > + if (!vma) > > + goto inval; > > + > > + /* Only anonymous vmas are supported for now */ > > + if (!vma_is_anonymous(vma)) > > + goto inval; > > + > > + if (!vma_read_trylock(vma)) > > + goto inval; > > + > > + /* Check since vm_start/vm_end might change before we lock the = VMA */ > > + if (unlikely(address < vma->vm_start || address >=3D vma->vm_en= d)) { > > + vma_read_unlock(vma); > > + goto inval; > > + } > > + > > + /* Check if the VMA got isolated after we found it */ > > + mas.index =3D address; > > + validate =3D mas_walk(&mas); >=20 > Question for Maple Tree experts: >=20 > Are you allowed to use mas_walk() like this? If the first mas_walk() > call encountered a single-entry tree, it would store mas->node =3D > MAS_ROOT, right? And then the second call would go into > mas_state_walk(), mas_start() would return NULL, mas_is_ptr() would be > true, and then mas_state_walk() would return the result of > mas_start(), which is NULL? And we'd end up with mas_walk() returning > NULL on the second run even though the tree hasn't changed? This is safe for VMAs. There might be a bug in the tree regarding re-walking with a pointer, but it won't matter here. A single entry tree will be a pointer if the entry is of the range 0 - 0 (mas.index =3D=3D 0, mas.last =3D=3D 0). This would be a zero sized VMA - = which is not valid. The second walk will check if the maple node is dead and restart the walk if it is dead. If the node isn't dead (almost always the case), then it will be a very quick walk. After a mas_walk(), the maple state has mas.index =3D vma->vm_start and mas.last =3D (vma->vm_end - 1). The address is set prior to the second walk in case of a vma split where mas.index from the first walk is on the other side of the split than address. >=20 > > + if (validate !=3D vma) { > > + vma_read_unlock(vma); > > + count_vm_vma_lock_event(VMA_LOCK_MISS); > > + /* The area was replaced with another one. */ > > + vma =3D validate; > > + goto retry; > > + } > > + > > + rcu_read_unlock(); > > + return vma; > > +inval: > > + rcu_read_unlock(); > > + count_vm_vma_lock_event(VMA_LOCK_ABORT); > > + return NULL; > > +}=