From mboxrd@z Thu Jan 1 00:00:00 1970 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 869ABC25B75 for ; Fri, 31 May 2024 13:38:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D6E1B6B0089; Fri, 31 May 2024 09:38:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CF6416B008A; Fri, 31 May 2024 09:38:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD36C6B008C; Fri, 31 May 2024 09:38:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 870DB6B0089 for ; Fri, 31 May 2024 09:38:19 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E8EF0A362D for ; Fri, 31 May 2024 13:38:18 +0000 (UTC) X-FDA: 82178795076.24.F78D47A Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf27.hostedemail.com (Postfix) with ESMTP id 788AF40021 for ; Fri, 31 May 2024 13:38:14 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="MrAL8fM/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=BmAzbJTd; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717162694; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=vQrtJnDqjH1f3iDi/TL7H+7wlAwUfGw1ZQW3ZVCVxOc=; b=Ub+JHHsuMV19nEt0DGXg+l6A7KoEpIUtVdjF3fGmIKi8E0dJob+onRAvzXV2iGC7MU6IBT XFLqePI39PqpJg6r9zCbE/q1kfNnoaX52KR8oNjbYVyaoVPykuVInYegsqrNUY1VFM7Zy0 WxK1JZNm0emzz/zqqjnQtnhZn2lFlAs= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="MrAL8fM/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=BmAzbJTd; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717162694; a=rsa-sha256; cv=pass; b=mHh9EOwvw1TniYvZ4dbaalu8NurgXWjbipFp5c8Qso8T/6Tk68ghmJEdFLSLUYxq0t9JMt JUEG+BVUGkbtiNvhXJWKzDhxvZxyYihDkRK/GdDiozll6dhfCp6MhG273L1QoHoNE+DhhN gVj1ppOQPb7ImpcBpkkW9YAaeAhIJHA= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44V9T2Uu019209; Fri, 31 May 2024 13:38:05 GMT DKIM-Signature: =?UTF-8?Q?v=3D1;_a=3Drsa-sha256;_c=3Drelaxed/relaxed;_d=3Doracle.com;_h?= =?UTF-8?Q?=3Dcc:content-transfer-encoding:content-type:date:from:in-reply?= =?UTF-8?Q?-to:message-id:mime-version:references:subject:to;_s=3Dcorp-202?= =?UTF-8?Q?3-11-20;_bh=3DvQrtJnDqjH1f3iDi/TL7H+7wlAwUfGw1ZQW3ZVCVxOc=3D;_b?= =?UTF-8?Q?=3DMrAL8fM/dO55YlQkVFgITMWPKq5BlthsfW73nRT6G2bKSpqf1GjFLjnYTA2O?= =?UTF-8?Q?u9oqWIT4_tWu5vHqU84HLvsqXQGbg8XBTkfRisbA3VqPOJL9DTMnnU1sAEDZ2MC?= =?UTF-8?Q?ap/zfSbknzHzKM_Jf4WuTcRA9gehtBs940CbNeSCveTEffHrVgh14k/OWhoeGyw?= =?UTF-8?Q?g5BowEWrfxPpQipyuA0+_8VC+HAZi3mbKbGWpKLiaMG/H8dqRlPkwk8d4HlilRS?= =?UTF-8?Q?KSJDW59lxYjxQnZWBiRwMFrWt4_MMbjDmXxOJw9yS/2eqktfKG6WM1/niVGvbFa?= =?UTF-8?Q?YVUZIH1AGfH6ukcfnVGGA8uUUn9Dew3E_UQ=3D=3D_?= Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yb8fck71c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 May 2024 13:38:04 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44VCJnaK016239; Fri, 31 May 2024 13:38:03 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3yc50tv767-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 May 2024 13:38:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D8p5b5nS8UGWM8ucdrme3NrB8JuvAeUGkFAdQ3trUPcDfooCWJVNOPpDuZBs/c0B78hkkazS59uAM0qrIYgy8ujRSAHAFrKdbVW1/vjDvsjsiregu+mEBKudLbXWXxowzH0cyIbVey7hDl/TMALgbH5pIYGQ6ww2RUm+QTTV43ZWXPu8tGroOK+nor4NOEOoB1m35KjqQP/550aQxlK5r0vaEqc3Ek+74H2r6MRrLjHFZVOis/YKFeMQXD+Yd7SzwXG9jCkY9NUh+GgfDUuWMsZ32eYcaMay+qRMUMswBNZ4rq2UDrlfDO+mjLrTWUwLx5c2mDmnb4FIm77zQX20Bw== 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=vQrtJnDqjH1f3iDi/TL7H+7wlAwUfGw1ZQW3ZVCVxOc=; b=F3zlrgQpPbwAovnqmTG9/RARKc7kufymWYTY9uE02mtFPFy3WNd79ZEG/0weLHHcCdYFC4df3lE8lpEMK6F8ead6Rjwmpn6Swc7b1soDU6ZnBLGrH4Zo3I9xuLcH9r+JAQRS4hrXypFJfxA9ZMSr2gX5zGKGszgMReaE09/brDkGY4tS2AUtifamc1AtoORGm/hQ8Ua13izhwibtaCwTFbYyWIOsKMS0Vm0545RG9IuS0OltVnGludI9DmSSwOcR/DDqzNG6/E20wkWNmSXxozlKG4+RKWVQLGGABxoLULaXxSVuCMLtVpIWhks17tUxD0qgze/UljRQpNAawcnLrg== 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=vQrtJnDqjH1f3iDi/TL7H+7wlAwUfGw1ZQW3ZVCVxOc=; b=BmAzbJTdN+98vJGlHKA7SwL0rcDg4BhU6RU+0oU0coQhv0BlUUihfLMfqcPJl4tzrV5hVYypjCzTTpxA6B8k0WqxL+cutTMvKdSmGaVXSeid4NS4DCROEqp8aGgphBXUvv4k34qQt8m1O9m1/8+YBN9npuS0wE04Gi48utPnWnQ= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by CY8PR10MB6515.namprd10.prod.outlook.com (2603:10b6:930:5d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.24; Fri, 31 May 2024 13:38:01 +0000 Received: from DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490]) by DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490%7]) with mapi id 15.20.7633.021; Fri, 31 May 2024 13:38:01 +0000 Date: Fri, 31 May 2024 09:37:58 -0400 From: "Liam R. Howlett" To: Andrii Nakryiko Cc: Andrii Nakryiko , linux-fsdevel@vger.kernel.org, brauner@kernel.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, gregkh@linuxfoundation.org, linux-mm@kvack.org, surenb@google.com, rppt@kernel.org Subject: Re: [PATCH v2 4/9] fs/procfs: use per-VMA RCU-protected locking in PROCMAP_QUERY API Message-ID: Mail-Followup-To: "Liam R. Howlett" , Andrii Nakryiko , Andrii Nakryiko , linux-fsdevel@vger.kernel.org, brauner@kernel.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, gregkh@linuxfoundation.org, linux-mm@kvack.org, surenb@google.com, rppt@kernel.org References: <20240524041032.1048094-1-andrii@kernel.org> <20240524041032.1048094-5-andrii@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: NeoMutt/20231103 X-ClientProxiedBy: YT4PR01CA0327.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10a::12) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|CY8PR10MB6515:EE_ X-MS-Office365-Filtering-Correlation-Id: 028757c1-191b-4748-f994-08dc8176e3e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|7416005|376005|366007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?b0NIWnFJQ3g3ZFJZTTZ4TlBXejZ0WDl2SzBaa0tCamhzbDlUYkxTajE4VTFQ?= =?utf-8?B?bENJWFFUUGRER0tvU0IxSU9zSHQ3d3E4YS9TSzF1MUJUTVFZZ3FrOUVucFFu?= =?utf-8?B?WFJudHRYbU5BTjdHb0x5Nmg4eFo2ODV1aDFLdVRyRUVzV3pjWmY5S28yUmFE?= =?utf-8?B?MkNoM2R6czlaV0R0N0N4NGpHVkF2emplaUZET200RW9YTENTV2lUYVVUNFVm?= =?utf-8?B?Z05CTzlkd3p3MXJYMjJtZkVBWi8vTzlJejMxdU54aWtXRE5iQ3Rjc2JteFlX?= =?utf-8?B?Um1SM0NhTDVBT1BIdktXNTg3T0k1aVhaUCtPOXlGeG5ZdFhtcnFZbXozbGQx?= =?utf-8?B?K2VUOXp6WHgybWovVUdPbHdnSDBZLzlPY3QwakVNd09WZ3hCYSt6TzdKcEtw?= =?utf-8?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8?B?QTZyVHlnNEtWdUpIN3lDSkpsVzgxMG5kN1FVSkMvYitMZDE2Wm1VMkEzQWx0?= =?utf-8?B?OTMxWHNHYjhCaHN4RjlLTFhFRWZZWk5xdWgrTDhVRjlocWRnbEJVYThOcHJD?= =?utf-8?B?SjRnMEZFMjBJZTAwWXU0a0tpK0kxV0JHazhHZVBGSXdXZjdEWjF5N28rUkhi?= =?utf-8?B?M2s5d0ozajh0Sk9wbHdwTnczMWxSa0xVS0h0QUo0NVhTd3JLNE5tZHUrU2Qv?= =?utf-8?B?MzQ3L0NPZVcwaFFwYlZDTjRQSnhiRVNSenhsQTRzZ09HT25TaTU4bUF3MEEw?= =?utf-8?Q?IGx+41Nda/9WDmvfEE1fu+zKSuRhvhgJsaY35Gr+OdgA=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR10MB7933.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(7416005)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Y0pkOWpGY2NxSEcyV01kb3FZTEVuVkNrY0FoV0ROTkNGd3dhR1JyOHIyOGIx?= =?utf-8?B?QitEbWY2SEZ4WTVjOVQ5V2QrTmhGdkpnYXVSK2k0S25DS3VoLytRN0ZUVjNw?= =?utf-8?B?M2J3dU1WYnpJdmxhbHlPa3dsbTZrRzhnMDEyUnpCTDVXT3IvclRVUmZNaUpE?= =?utf-8?B?WFFBZUMxWDF2Wk9jZ2lpNUlJeWpSOU5qMklTeE1UeExxam9ZTk41RjZROXVE?= =?utf-8?B?NTRmbzAxeW9Lcm5XaVM2VFN6cXdKZTY2eWllai9BSFZTWWhnQnp4U0VycnFY?= =?utf-8?B?d0tad3R5dytQNlBiRm1RZDV2aTNTa2tVWEhtWkpublloZ1c0eUFQRVA2cW5L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D3qQ?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: jJdwyAYBsErwT2AkRcC0dY/VRRPErY5K4O5TuwP+yX1DkIQetwuxT0mg8lqWAF3kKIa6HyRz9DZ0QqT5/BZk94/F1bflveF2zJ01vli7VoJIBmRIO5YJ6AygissMu0CjjklO1tlhsXwAYGK1wp9SKeqE8gPMIElHufDEP+GjLmPfvR5CT7DRxKEbEfNjqrEyQqDCeywQrs4sB6AKSAJOmfo/hdhOvJsCmwdsbmgawcJuDbD/TVQt/P/O25s5YsdRvq1zHU8WPnu1OugJjcv3yvyKhe2GIOam8oovhQIAdSBhsye+KXdpszGj0VCb9jGuiZYGUAriC/H+SFLusVEzlEa/Z1I/sdzxKbH6BCbor5sXjPN+C2nurpV8SlsuruFY1Iq1AkzSiobdH39IPrELAh99czGKa0g5HDrL1B92os2VNwtfjR5ekEO3kaphT+2SLHXeX1gAaJxHejCKF2RxEslBsPPVV1uE95G/aRH3E4V/Ku6UwyCkV3KWIOGLRUfyk1oB0JuASQ49W4TuMCRwPRmyItQ3Q8CZNl4ReGX6i+GloBc//l3DBiS+XXdIWTqZtN3JTI944xi+nnJDsTUTt16U8nTrYwUld7kyAjS2unY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 028757c1-191b-4748-f994-08dc8176e3e7 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2024 13:38:01.0941 (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: 7u10cWKpHfbq+C8p1sID3NLtG9IQrWroGinoSJk666nLM34qAz95NRXaRSdtG4l96Sh4tSemBtURqrxXUYBMxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6515 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-31_10,2024-05-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405310101 X-Proofpoint-GUID: N8S9viFA8ZIi2dBJH8CndJSGP-Hb_6UV X-Proofpoint-ORIG-GUID: N8S9viFA8ZIi2dBJH8CndJSGP-Hb_6UV X-Rspamd-Queue-Id: 788AF40021 X-Stat-Signature: 7rtzopcb5ioa56qb7qxnm9e85ojjnka5 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1717162694-316524 X-HE-Meta: U2FsdGVkX1/PvWtT6LoZvhsrVOJGG9tieTzY1hwNARjedUgGWjdV5ESTKUNCpqM3Y8LCS9rbfUmM2Ts8MjSUr2sZW3hGc7/OPnHhealIF7/OMFwv44MgoPHgp4dnr/62EEr+2v3D97i8A/n0Jq5ItOdzS93Qyg8F3q04ZK/vseM5i9RRVbxoMC/OB0gjH7vdEPzTnq35Ox1G4406zNO0HJd8Bu2PA/veLElHkdbSF3Ez83imTxNRDPiLw0cRb5+NF7y/6kUrvf/vvvYr0BxI1iE7CV5QH6VMu/v7qpzO/uQWxVV05Zw2Xw12AC5gLnlUMbFl2ToTVPoHlprBDKgir5rxgbwWscO2dgd7rrGpaMSS6//THoMAdjD4c1qX40OTyOIz8lIvaCqmkrizA6rDdy8kYicPe3j2DrQ6CwCTklmed1oW/2/FAjukEyKlXhua4v0jqib4E5DOitnTKBQReOftx7OREYa/LPwzosKjIXPO+Oovtg5D2d2ES5Mg8Zv2XAKADo2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sKyZ4Av278I/68MV6Cn0lcFX5xN191N0jLZWONTIV6ADif9C8uxb5OKofccLDGtfT+kUoya5Zr6CnBYvDlq+kNvbmR7Vw0bDxPRys 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: List-Subscribe: List-Unsubscribe: * Andrii Nakryiko [240528 16:37]: > On Fri, May 24, 2024 at 12:48=E2=80=AFPM Liam R. Howlett > wrote: > > > > * Andrii Nakryiko [240524 00:10]: > > > Attempt to use RCU-protected per-VAM lock when looking up requested V= MA > > > as much as possible, only falling back to mmap_lock if per-VMA lock > > > failed. This is done so that querying of VMAs doesn't interfere with > > > other critical tasks, like page fault handling. > > > > > > This has been suggested by mm folks, and we make use of a newly added > > > internal API that works like find_vma(), but tries to use per-VMA loc= k. > > > > Thanks for doing this. > > > > > > > > Signed-off-by: Andrii Nakryiko > > > --- > > > fs/proc/task_mmu.c | 42 ++++++++++++++++++++++++++++++++++-------- > > > 1 file changed, 34 insertions(+), 8 deletions(-) > > > > > > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c > > > index 8ad547efd38d..2b14d06d1def 100644 > > > --- a/fs/proc/task_mmu.c > > > +++ b/fs/proc/task_mmu.c > > > @@ -389,12 +389,30 @@ static int pid_maps_open(struct inode *inode, s= truct file *file) > > > ) > > > > > > static struct vm_area_struct *query_matching_vma(struct mm_struct *m= m, > > > - unsigned long addr, u3= 2 flags) > > > + unsigned long addr, u3= 2 flags, > > > + bool *mm_locked) > > > { > > > struct vm_area_struct *vma; > > > + bool mmap_locked; > > > + > > > + *mm_locked =3D mmap_locked =3D false; > > > > > > next_vma: > > > - vma =3D find_vma(mm, addr); > > > + if (!mmap_locked) { > > > + /* if we haven't yet acquired mmap_lock, try to use les= s disruptive per-VMA */ > > > + vma =3D find_and_lock_vma_rcu(mm, addr); > > > + if (IS_ERR(vma)) { > > > > There is a chance that find_and_lock_vma_rcu() will return NULL when > > there should never be a NULL. > > > > If you follow the MAP_FIXED call to mmap(), you'll land in map_region() > > which does two operations: munmap(), then the mmap(). Since this was > > behind a lock, it was fine. Now that we're transitioning to rcu > > readers, it's less ideal. We have a race where we will see that gap. > > In this implementation we may return NULL if the MAP_FIXED is at the en= d > > of the address space. > > > > It might also cause issues if we are searching for a specific address > > and we will skip a VMA that is currently being inserted by MAP_FIXED. > > > > The page fault handler doesn't have this issue as it looks for a > > specific address then falls back to the lock if one is not found. > > > > This problem needs to be fixed prior to shifting the existing proc maps > > file to using rcu read locks as well. We have a solution that isn't > > upstream or on the ML, but is being tested and will go upstream. >=20 > Ok, any ETA for that? Can it be retrofitted into > find_and_lock_vma_rcu() once the fix lands? It's not ideal, but I > think it's acceptable (for now) for this new API to have this race, > given it seems quite unlikely to be hit in practice. >=20 > Worst case, we can leave the per-VMA RCU-protected bits out until we > have this solution in place, and then add it back when ready. I've sent the patches to Suren for testing on the /proc//maps he is doing as he could recreate this issue, but I think he is busy with other things. They are isolated to the mm changes so I can send you the same patches to include in this patch set. This does increase the risk of issues with the patch set, so you can have a look and decide how you want to proceed. >=20 > > > > > + /* failed to take per-VMA lock, fallback to mma= p_lock */ > > > + if (mmap_read_lock_killable(mm)) > > > + return ERR_PTR(-EINTR); > > > + > > > + *mm_locked =3D mmap_locked =3D true; > > > + vma =3D find_vma(mm, addr); > > > > If you lock the vma here then drop the mmap lock, then you should be > > able to simplify the code by avoiding the passing of the mmap_locked > > variable around. > > > > It also means we don't need to do an unlokc_vma() call, which indicates > > we are going to end the vma read but actually may be unlocking the mm. > > > > This is exactly why I think we need a common pattern and infrastructure > > to do this sort of walking. > > > > Please have a look at userfaultfd patches here [1]. Note that > > vma_start_read() cannot be used in the mmap_read_lock() critical > > section. >=20 > Ok, so you'd like me to do something like below, right? >=20 > vma =3D find_vma(mm, addr); > if (vma) > down_read(&vma->vm_lock->lock) > mmap_read_unlock(mm); >=20 > ... and for the rest of logic always assume having per-VMA lock. ... >=20 >=20 > The problem here is that I think we can't assume per-VMA lock, because > it's gated by CONFIG_PER_VMA_LOCK, so I think we'll have to deal with > this mmap_locked flag either way. Or am I missing anything? The per-vma lock being used depends on the CONFIG_PER_VMA_LOCK, so that flag tells us which lock has been taken. >=20 > I don't think the flag makes things that much worse, tbh, but I'm > happy to accommodate any better solution that would work regardless of > CONFIG_PER_VMA_LOCK. >=20 > > > > > + } > > > + } else { > > > + /* if we have mmap_lock, get through the search as fast= as possible */ > > > + vma =3D find_vma(mm, addr); > > > > I think the only way we get here is if we are contending on the mmap > > lock. This is actually where we should try to avoid holding the lock? > > > > > + } > > > > > > /* no VMA found */ > > > if (!vma) > > > @@ -428,18 +446,25 @@ static struct vm_area_struct *query_matching_vm= a(struct mm_struct *mm, > > > skip_vma: > > > /* > > > * If the user needs closest matching VMA, keep iterating. > > > + * But before we proceed we might need to unlock current VMA. > > > */ > > > addr =3D vma->vm_end; > > > + if (!mmap_locked) > > > + vma_end_read(vma); > > > if (flags & PROCMAP_QUERY_COVERING_OR_NEXT_VMA) > > > goto next_vma; > > > no_vma: > > > - mmap_read_unlock(mm); > > > + if (mmap_locked) > > > + mmap_read_unlock(mm); > > > return ERR_PTR(-ENOENT); > > > } > > > > > > -static void unlock_vma(struct vm_area_struct *vma) > > > +static void unlock_vma(struct vm_area_struct *vma, bool mm_locked) > > > > Confusing function name, since it may not be doing anything with the > > vma lock. >=20 > Would "unlock_vma_or_mm()" be ok? The way that seemed most clear in the userfaultfd code (/mm/userfaultfd.c), seemed to focus on what we were undoing instead of the lock we were unlocking. Instead of saying "unlock one or the other" we have "uffd_mfill_unlock()", and have two versions of that function that take the same argument. This way we can have the same blocks of code calling the same thing, with a different lock/unlock happening based on the CONFIG_PER_VMA_LOCK compile time option. If that makes sense to you, then I'd prefer it over the other options - none are ideal. Note that people didn't like the "unlock_" name, even on static functions as it implies it can be used everywhere and may conflict with a global function in the future [1]. [1] https://lore.kernel.org/linux-mm/20240426144506.1290619-4-willy@infrade= ad.org/ Thanks, Liam