Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp434348lqr; Wed, 5 Jun 2024 10:04:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU4mx9+P3wUhOkfwrspwemu1MUd4YA4HA8WC426y5hmhY8KQbfQgUDk5sxejiRCfcCip/BYHmVjb0AFMrRJMZ6IuNzwj1X9Ti0esl84pQ== X-Google-Smtp-Source: AGHT+IE8Wm0mtoC2seb5qBKrVaurZ4qkyMHlAIKbBXZb9ifA3Y7D8ZxA8N/77PFojLd0obh6Sn/5 X-Received: by 2002:a05:6122:c91:b0:4dc:d7ab:7f16 with SMTP id 71dfb90a1353d-4eb3a41ead5mr3983414e0c.8.1717607052332; Wed, 05 Jun 2024 10:04:12 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 71dfb90a1353d-4eafedcde26si2221706e0c.82.2024.06.05.10.04.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 10:04:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202953-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=DgHoz0hF; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="oh6Z/8dB"; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-202953-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202953-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0086B1C22635 for ; Wed, 5 Jun 2024 17:04:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8698D188CD6; Wed, 5 Jun 2024 17:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="DgHoz0hF"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="oh6Z/8dB" Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 158A361694; Wed, 5 Jun 2024 17:03:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717607031; cv=fail; b=p48CN+KlaAc/b/Z8A93wf+wkbqTx7gX9U6gw9v/2Z8oRn2t4NTNIFTpTIjLI8aOHwdmgm8ulzUkbIm0+i0OvcpfG2cjayP89XelLoDVyI0ficMPthC+nTKwHs/0ktFPMgcrVM6+PXVbbxXgrql+S1wZKVrVJNzWB2GhlnswMi58= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717607031; c=relaxed/simple; bh=ouaDZg9soh61ampVOSpKd9hjidAJ5EL+7IoQCoA03t4=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=kCS0Z8CiputBYhRU66rQrPQmW5a7rFXcL3LJzwLN/XTCoQq3MzucRj6WfX2egRG3bSdTZZ7kYx7e7L3fWpfVKxwvsCSZxvZIPhVMftJtshwlA1bGlWkSkR/mDL25Wwl2vWLdWg/CcFFCoIEJ+6SR1tvNkV0NM1SiBipC+Vbk7i0= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=DgHoz0hF; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=oh6Z/8dB; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com 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 455C9ih4005263; Wed, 5 Jun 2024 17:03:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc : content-transfer-encoding : content-type : date : from : in-reply-to : message-id : mime-version : references : subject : to; s=corp-2023-11-20; bh=knogQTChe1ksDec7fCzmv3UpY6znBUZctN+vi4ALhlU=; b=DgHoz0hFa0I4NH31C+p1MIUaegkp57SevBkL5ekEWpzInRhk0XVd7n6okuvsoeStc/b4 4PMcXmMh2Ki0uGugk2pSnLy7b9bibRCGW63SdbsKZZ07aQ6bvpjmchdC9UCg6qVjEx4L lWYVDY/6MQwyYLJREWbY5mV18nW7vKlN8MWyBZaRyHjV0euOiLcYNnWTzM8tGC5sQh+0 KBSmT1rbURoWNm04M0TmqJlgwf8xVteoMLbrxxozZd2AR4bkwy7g7SXRVp5xp/FVLztd FQ4oSXwU1PJOfv7ZvM42dgljCy+YbkyQtGEKAWJbIlPdwHNSoTjhKzMAzJv5NcmMrZhg /Q== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbrs9t88-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Jun 2024 17:03:32 +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 455G3jdt025099; Wed, 5 Jun 2024 17:03:31 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrtaaycq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Jun 2024 17:03:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TyVZwTroLip42VTIUTWVQ/EB3BSuDzyFM3JPmYIX/Wr7eGRBvVeb6z6IhsnK5jZO8Setgj+7IrQxjcSj+qx+XUlOuKh2Cl5iF4BJffMpI1dYJgHGQBbgNab4jFYp11l06X6vkQUcQKuqIniE6H4i0JYF2w/7MHCueDtsr902jTlrocjzI60VW8k28XllJe3fKbDTlT5gdZ0BGmtHhp5Y8zls4YMNfiTTdZ/sVnW38L6XPg4nsGDt/RED3mHLm7TC8XWhnztFZyUr3uAC3bkCcR/n6fQkqrniFLalzlLcUjCJKrw6SKdSThce86khtgLfHjC03YQAOfu/I0nJ4O28Sw== 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=knogQTChe1ksDec7fCzmv3UpY6znBUZctN+vi4ALhlU=; b=YooLHRuktkMmOTdmgrwjxQ4SXlytuAclCC0aIhjJLm4C0Uf5wHHdzQ5+pIfWrChnue7lYooS8DKQvZmCKSXeTQ5J4yftcxs1HEK2uVbr3Sfm5YvrP1VbORqRUFAeHpYOV8Gym4dEGrfeIEvD1R9PxoS8v6lFXeBpsMJ/p7E3ZiBfGNTyumxMxRGixBNWlECtMkfPF2D7yss+BBmDEvJL2NCopaGLJAqjiewpuYLkIs5n+ztRKwx3TRT77//jhJU6DRCSWv7G+sR3fkjgcYZlewqqwT5Z1kqLeTE4y4Z7HBYJKw+tJFDnj4nKsGEd0TFe1aiIe3018xW//ILX9sBsKg== 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=knogQTChe1ksDec7fCzmv3UpY6znBUZctN+vi4ALhlU=; b=oh6Z/8dB4Fnbf1AEwP0MICSd/woeHy9H2yha03waKmy8WFVXnlwfkx9wsj2+TtoHlZhY7nAkbfLKrgLFXLp3TBQHRjjBsGBvBZEOeh7xNTBAI7JwlTWuU/MHIaeAHjrYk9/f5SO1wJfk/zkRJOMJLMqJH7BGuCuJOFtAU28NPjA= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by SJ0PR10MB6328.namprd10.prod.outlook.com (2603:10b6:a03:44e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.27; Wed, 5 Jun 2024 17:03:29 +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; Wed, 5 Jun 2024 17:03:29 +0000 Date: Wed, 5 Jun 2024 13:03:26 -0400 From: "Liam R. Howlett" To: Andrii Nakryiko Cc: Matthew Wilcox , 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 v3 1/9] mm: add find_vma()-like API but RCU protected and taking VMA lock Message-ID: <5fmylram4hhrrdl7vf6odyvuxcrvhipsx2ij5z4dsfciuzf4on@qwk7qzze6gbt> Mail-Followup-To: "Liam R. Howlett" , Andrii Nakryiko , Matthew Wilcox , 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: <20240605002459.4091285-1-andrii@kernel.org> <20240605002459.4091285-2-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: YT4PR01CA0113.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d7::25) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|SJ0PR10MB6328:EE_ X-MS-Office365-Filtering-Correlation-Id: a1eba981-57fa-49f1-33a0-08dc85816c1b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Micros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eEJ6dCtCd1RBVlFORW9ET0hvMU5od280?= =?utf-8?Q?xxHZ/x2fh90T8BR/ljWRdFsW7eBFlR0fG8CITNU?= 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)(7416005)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Z29Db0tKYUZScU0xYXVjK2E2bTlLWXJqNnBxL29CZXNYcDdQOExyeE94ZEJw?= =?utf-8?B?R2hOWW8xVXZZRk5TektaM2xubloxNFRNVDcrKzlJeEc5TnR1Z01ZbDZObUxj?= =?utf-8?B?Z2VhREh1QkhUUytnL1p1TXpveWQ3eXBLdnpmOUpEamtURXNOcEJ4QkNDOVJ1?= =?utf-8?B?VU5xejlCZERxcWRQeUZldmpQQU1LaVlqVXJRTmNJYjVCZVQ3M3JXV2NwNjBn?= =?utf-8?B?WjNEZkJKclE4VmZScWtjWkRLWGtxc2VwdDQxTERuNjduT0haa3p1QzdvbWRX?= =?utf-8?B?dnowWVdyOFBDOWl4cTFGRUwyTWJOQVBmM3FQeTFnV05Pc2tFZXB1b1FOQmtU?= =?utf-8?B?VlI5K2IrSEFxaUM3S1liNEV4RDRERTNCWjl5RVVlaDFkNmZENXp6VjExUjNP?= =?utf-8?B?WlBNSG1LUmdFMEZhTExNbElTVWJWeFR1dkNpc3hTRVFKUmswMW5LeUtTenJt?= =?utf-8?B?RllJTG1pQmQ4MGNEdzdJRjhtQW5sUmdPd0tWR2FxNm1ycXNhNlI2RlFWUUNU?= =?utf-8?B?S3VzRHhDNnQ0bzZFY1Q0VkhhVmRtSW1IQi9RUVc1bysvL2lHeEd2dGlZWXpm?= =?utf-8?B?WW50dnJMUWZNWHpCZkxXaTRoVmt4TTBsODQ5QmVBcU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pHKP5Gz76HtHsc9/AfLCGN42QncNmefrBGG5dFDDrAfAj/GR7EkJ/rtrWV4MQ7j86hsut309UtiAHoPQlGRVt8UwE7KI3S+b6+AiwB1kj52AQqQzkbzxsQ4AF/3QuY49XRJ41q4QRizf55zF3P6LWvg3Wwur8Q7JuD/3NaOhtVJRwdU1xSQ20eWQWPLW3W3dtBWBOvmVGouKqc0yU9BWsUXqLCdwqYbFgyl6S+hHaMSLT1YJD7ZhOI7T8zfUUpvaomPXljMxQvtG7a21fjuXnXZ4Lhi+sJHbOkex3yzRcdDHnl4ccXS6MQic0oPWUCtlCrTZRTeVg9Y/XWRM68fv9hffx8ZbUWLO4plqdQJU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1eba981-57fa-49f1-33a0-08dc85816c1b X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2024 17:03:29.2173 (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: EriCRQBVWZIJoORrbq/jruEBCWNwq/cTLGyCDlwBqowZMXEFRFCMT86pl473Tv5/x1RcpP+0aLxtvrWUo7CnMw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB6328 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-05_02,2024-06-05_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406050129 X-Proofpoint-ORIG-GUID: 4rGeTEixBOLcx4Or4xTU-11u0p00cTRo X-Proofpoint-GUID: 4rGeTEixBOLcx4Or4xTU-11u0p00cTRo * Andrii Nakryiko [240605 12:27]: > On Wed, Jun 5, 2024 at 9:24=E2=80=AFAM Andrii Nakryiko > wrote: > > > > On Wed, Jun 5, 2024 at 9:13=E2=80=AFAM Andrii Nakryiko > > wrote: > > > > > > On Wed, Jun 5, 2024 at 6:33=E2=80=AFAM Liam R. Howlett wrote: > > > > > > > > * Matthew Wilcox [240604 20:57]: > > > > > On Tue, Jun 04, 2024 at 05:24:46PM -0700, Andrii Nakryiko wrote: > > > > > > +/* > > > > > > + * find_and_lock_vma_rcu() - Find and lock the VMA for a given= address, or the > > > > > > + * next VMA. Search is done under RCU protection, without taki= ng or assuming > > > > > > + * mmap_lock. Returned VMA is guaranteed to be stable and not = isolated. > > > > > > > > > > You know this is supposed to be the _short_ description, right? > > > > > Three lines is way too long. The full description goes between t= he > > > > > arguments and the Return: line. > > > > > > Sure, I'll adjust. > > > > > > > > > > > > > > + * @mm: The mm_struct to check > > > > > > + * @addr: The address > > > > > > + * > > > > > > + * Returns: The VMA associated with addr, or the next VMA. > > > > > > + * May return %NULL in the case of no VMA at addr or above. > > > > > > + * If the VMA is being modified and can't be locked, -EBUSY is= returned. > > > > > > + */ > > > > > > +struct vm_area_struct *find_and_lock_vma_rcu(struct mm_struct = *mm, > > > > > > + unsigned long address) > > > > > > +{ > > > > > > + MA_STATE(mas, &mm->mm_mt, address, address); > > > > > > + struct vm_area_struct *vma; > > > > > > + int err; > > > > > > + > > > > > > + rcu_read_lock(); > > > > > > +retry: > > > > > > + vma =3D mas_find(&mas, ULONG_MAX); > > > > > > + if (!vma) { > > > > > > + err =3D 0; /* no VMA, return NULL */ > > > > > > + goto inval; > > > > > > + } > > > > > > + > > > > > > + if (!vma_start_read(vma)) { > > > > > > + err =3D -EBUSY; > > > > > > + goto inval; > > > > > > + } > > > > > > + > > > > > > + /* > > > > > > + * Check since vm_start/vm_end might change before we lock = the VMA. > > > > > > + * Note, unlike lock_vma_under_rcu() we are searching for V= MA covering > > > > > > + * address or the next one, so we only make sure VMA wasn't= updated to > > > > > > + * end before the address. > > > > > > + */ > > > > > > + if (unlikely(vma->vm_end <=3D address)) { > > > > > > + err =3D -EBUSY; > > > > > > + goto inval_end_read; > > > > > > + } > > > > > > + > > > > > > + /* Check if the VMA got isolated after we found it */ > > > > > > + if (vma->detached) { > > > > > > + vma_end_read(vma); > > > > > > + count_vm_vma_lock_event(VMA_LOCK_MISS); > > > > > > + /* The area was replaced with another one */ > > > > > > > > > > Surely you need to mas_reset() before you goto retry? > > > > > > > > Probably more than that. We've found and may have adjusted the > > > > index/last; we should reconfigure the maple state. You should prob= ably > > > > use mas_set(), which will reset the maple state and set the index a= nd > > > > long to address. > > > > > > Yep, makes sense, thanks. As for the `unlikely(vma->vm_end <=3D > > > address)` case, I presume we want to do the same, right? Basically, o= n > > > each retry start from the `address` unconditionally, no matter what's > > > the reason for retry. > > > > ah, never mind, we don't retry in that situation, I'll just put > > `mas_set(&mas, address);` right before `goto retry;`. Unless we should > > actually retry in the case when VMA got moved before the requested > > address, not sure, let me know what you think. Presumably retrying > > will allow us to get the correct VMA without the need to fall back to > > mmap_lock? >=20 > sorry, one more question as I look some more around this (unfamiliar > to me) piece of code. I see that lock_vma_under_rcu counts > VMA_LOCK_MISS on retry, but I see that there is actually a > VMA_LOCK_RETRY stat as well. Any reason it's a MISS instead of RETRY? > Should I use MISS as well, or actually count a RETRY? >=20 VMA_LOCK_MISS is used here because we missed the VMA due to a write happening to move the vma (rather rare). The VMA_LOCK missed the vma. VMA_LOCK_RETRY is used to indicate we need to retry under the mmap lock. A retry is needed after the VMA_LOCK did not work under rcu locking. Thanks, Liam