Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp560588lqt; Thu, 6 Jun 2024 11:10:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWgLtJ+yeib5808SQNUxdeJo3z0ynBjvcEJBZqT6JjKx6fozcv6srebKoQMzTf/jjPwcvaetJn7e09KOdJslJaHo1uvQor5BlMxQnRacw== X-Google-Smtp-Source: AGHT+IHreVtrr03FlSuEAsbUmGodGdOFIFYx4N0UzKs5rwf/PAw4XzqlGKiWasZHp8nD+RpxZ2eI X-Received: by 2002:a05:6102:1263:b0:47e:ee4d:8431 with SMTP id ada2fe7eead31-48c2736f1aamr95870137.3.1717697403964; Thu, 06 Jun 2024 11:10:03 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ada2fe7eead31-48c1a211894si441450137.411.2024.06.06.11.10.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 11:10:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=bPASKQJu; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Pqza4Qjl; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-204856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204856-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 6AB171C2670C for ; Thu, 6 Jun 2024 18:08:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 624F219939C; Thu, 6 Jun 2024 18:07:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="bPASKQJu"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Pqza4Qjl" 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 EDF3F16FF26; Thu, 6 Jun 2024 18:07:39 +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=1717697261; cv=fail; b=A/O4fGx5YngS/OCn92mQTAY6VQdMO1Zjxfjbh1XezhyNmgqAthYQ+syc5VVlND9+0kml2ihMgOSSIPGlOZ8/Z+15ECS/2pHkh56N6N97/Uyk+69u81oMnsHRo06wSCnHzdSH0a6dHxwdegPU+PFBdshGrlECVWJZ9Y5OEqR9ErE= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717697261; c=relaxed/simple; bh=8h+dYpCC0ryakU/S2IR45s6lv+VKsPNuQPK0d6rdqKU=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=n5sfwXHOhJvfDb2BGccrCY25AzxQWH6wvlsiwTST+NbbpyAzvd3fqgKx3u+zEZt9GGhlqc5pvGFAiivuuRbSg8TVxo+vMd1n0yntjh/vjoqeqPSi0xVBXpqIuUhV5fqmbPFi9JWy5qEfiSCeE9d99ASWDjleD18zw6z0z6/EwHM= 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=bPASKQJu; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Pqza4Qjl; 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 (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 456Hwoto026885; Thu, 6 Jun 2024 18:07:26 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=K9cq+K48rT/yzy8DjI5bedmr3KH/a9KOYrxgzORzb3I=; b=bPASKQJuVHhoqeBaQKkl1ICJU1LAxOSESTA2urlgTXr0EMOsNQxhqIxqt3x555FnbcWd tY7cJU8e9Nkn0jfYLyEmONkdQP+z1kgmuMkIxkwzTeHMY1fVkSnuUk/OXPWDML6/AETs XV07fK47wiauIMWcUvJ9sNKLNljdgmUHh2dBKXK2mXljUXtfgGziPKXL62zZDrqLVIiD HpKP4Z7bFEzYnaPmprv+xlLHBLMzsuczX0gLCIzMH9pet+MH9tK2nAN49oA5aF2h/jlq +3ounv6MYhXuRBhYjnU0dIk69LGwaqrHk0TkmykGTvpG+1/4JYsD5ZtBn1KjEYCG3+XT 6A== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ykct30r71-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Jun 2024 18:07:25 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 456GaHUc020553; Thu, 6 Jun 2024 18:07:25 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrj5gqqf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Jun 2024 18:07:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZvxfSZNNys1Kv7jhhYvyevKcp+caR/bgR0MKsEClbPA/S7yvfWfN/e4lfUFw2r/6Sy3Cp3OTHS1RZ2u8WdotN38ICbC55JYzW9DevzLsp1v1WSjHK7gyKtYKgdOKb00i73Ipk2eIRkII9KtlovPW4MgfLFRnKZAnjo4BpHi9Ya6PWdKmZYAqe2Zx+Gs5+dhEZep+aohO7oVfCMA7xsEr1rAcl54x8H2cUAgqSqSaM5ugv65Eg41MA59VllCNd/dIfi/UuCwkCEUBkLxlbeZtwZzdRG3iaz/Pr5vBEbyOVBKLyeTHwbs9V4PNcGYNEqmKmv6va2EJwcr1QOXcjCcjQA== 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=K9cq+K48rT/yzy8DjI5bedmr3KH/a9KOYrxgzORzb3I=; b=gPOH8BkeXa0IIn3z4bQ8wszIDGUXrG8Jvd1Czo93UNUYrrnC3b6NG17OcxwRdQDHwixhoEUxIir0Vj5tfnbEPRZsVF+noiax/bp/uV8PGG/OOugoW1r80VVgNH3dbJ6BT8UnpxozVta7181Lw9zc2NpmyKbRl9EjtpcYaGvS3TKGh6eGeXmwlpx3BTkTPd5Rhc/P8LiPlMNgV/EKR486n4q+HnPX2wyYgEE8j01JWoYQXU/3NsLgxKifYcWEKAC+APtD4aW+pv7RiMpE6PBVpgFvQ11Li0mvVO/0Cl2MoDQb4oMlu2ZSKnvlIwfIVSxH9qaBfbl/7PFOxevFdZ3I/w== 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=K9cq+K48rT/yzy8DjI5bedmr3KH/a9KOYrxgzORzb3I=; b=Pqza4QjlrZ2rHSaktZXqEWT/zE8HcojHh3Qj11CLro/zqXWJ4bmZyzjGVfdCcZ0u3x1MfvVMt7KoBv9EsGGei//dmYRHtYLHDhBFp+PsWocQO/XaHQcHxch0xEOlwuV4Rrf58g8tIeK1+N0WZ5zMv7Z87jRDYcaYwv2ieN1blNg= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by SJ0PR10MB5669.namprd10.prod.outlook.com (2603:10b6:a03:3ec::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.25; Thu, 6 Jun 2024 18:07:22 +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.033; Thu, 6 Jun 2024 18:07:22 +0000 Date: Thu, 6 Jun 2024 14:07:19 -0400 From: "Liam R. Howlett" To: Suren Baghdasaryan Cc: 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, rppt@kernel.org Subject: Re: [PATCH v3 4/9] fs/procfs: use per-VMA RCU-protected locking in PROCMAP_QUERY API Message-ID: Mail-Followup-To: "Liam R. Howlett" , Suren Baghdasaryan , 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, rppt@kernel.org References: <20240605002459.4091285-1-andrii@kernel.org> <20240605002459.4091285-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: YT4PR01CA0445.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10d::27) 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_|SJ0PR10MB5669:EE_ X-MS-Office365-Filtering-Correlation-Id: 55d9ea30-7096-4b57-03cd-08dc86538317 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015|7416005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?aU1VRTUzTTFxZHJoN3k2cXJETVpmM0RSeVd0UH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PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015)(7416005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SkxZYVZpby9QS2NJaGFRQ09DL3hxRzY5MmVoNkFVQ3lWT2Q5bTN2MXV3a0g3?= =?utf-8?B?bW84bHEwc2k3SmJTcWpET0x1M00zT0J2bVlVVEE3TkhOWFQxT1NxQ0VlR0F5?= =?utf-8?B?aXhkUjdNZXY1QitCNUhUQmlpMVRkU3BSTW9VYzBpRnBEc3V0SGxmZjBqSE5S?= =?utf-8?B?cmErOThOOEVYdWFKc3VvV1h3bVhBamlIbmIvby8zN2N4clJRb01LM2JRbFhI?= =?utf-8?B?OHRqUlN5azJyZWVGK1Vpa2MyamFxbFhWaHlCdmp3MHpZbDZqT09hbzdjUUdF?= =?utf-8?B?djhGM1MwMTRmNDdHa0tEVW5CL2JmYTVxOHJCcmlETWI3RHAyNkk5RUJ0RlVu?= =?utf-8?B?K2ZSa3dueERRcVBQQUwwcDhUd2FzRURtUHMxRloxVGpNWDJZK2U1d1RIVDVI?= =?utf-8?B?RWk2UGxweStOa0tJSkVvd09FaGIxRDJDZUw5NUZBb0Ivc1IyMlZkNmpWNFZR?= =?utf-8?B?Z3N5QjMzRDUrcjBGNlZaSjVJVENGblNtZEJIVkl4NHZoMm5SUk9RaGFJMkpC?= =?utf-8?B?K0xJYWVOcHlXR1BKZmhrRk1lSWhVUXNUcjhzR2ZwdzRxRjRYN0N2UUdvMkds?= =?utf-8?B?NklTMXQ2U0lWYWlyZ05NYmVhSXM3c3dKK054dXhVRUl6T0Q2Y2ZUcmU5cnNY?= =?utf-8?B?N0tidmttUWxidUdRM2lwSWx6ejZ5M2Q1WDhQbG9PaktNS1ZWN2VKR2NuNlhY?= =?utf-8?B?cGUyYWtNa2lYOGVaVitIZnZOUnErVlViRlB2VVZMdTZxOGg5NEMzUm5YbFo5?= =?utf-8?B?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F+kff6z0fdRl00wl5YCxDcHHsfMr47z+XiwtSzQu8cRjoB14Kb4f3QonMgtG7j4G7Bqvn5L4YHA0FI3E+dsME8UKMYw+0vWsJFISDUldZdCanboPXCz29dmvMqH3OPwpu1+g91NZcMAGuwFgGnur8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55d9ea30-7096-4b57-03cd-08dc86538317 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 18:07:22.1000 (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: le+21pOVzFgyuAgetGezAyIkRiNITgJuZubIlS3mnW7RPa4++pA07661mDUNjH5QA/DXWZnbvEb3ySfHMq91fw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5669 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-06_14,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 bulkscore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406060125 X-Proofpoint-GUID: oOkWR0A1ns1aBmR6v84apFdtMu6fXAPL X-Proofpoint-ORIG-GUID: oOkWR0A1ns1aBmR6v84apFdtMu6fXAPL * Suren Baghdasaryan [240606 13:33]: > On Thu, Jun 6, 2024 at 10:15=E2=80=AFAM Liam R. Howlett wrote: > > > > * Andrii Nakryiko [240606 12:52]: > > > On Wed, Jun 5, 2024 at 4:16=E2=80=AFPM Suren Baghdasaryan wrote: > > > > > > > > On Tue, Jun 4, 2024 at 5:25=E2=80=AFPM Andrii Nakryiko wrote: > > > > > > > > > > Attempt to use RCU-protected per-VMA lock when looking up request= ed VMA > > > > > as much as possible, only falling back to mmap_lock if per-VMA lo= ck > > > > > failed. This is done so that querying of VMAs doesn't interfere w= ith > > > > > other critical tasks, like page fault handling. > > > > > > > > > > This has been suggested by mm folks, and we make use of a newly a= dded > > > > > internal API that works like find_vma(), but tries to use per-VMA= lock. > > > > > > > > > > We have two sets of setup/query/teardown helper functions with di= fferent > > > > > implementations depending on availability of per-VMA lock (condit= ioned > > > > > on CONFIG_PER_VMA_LOCK) to abstract per-VMA lock subtleties. > > > > > > > > > > When per-VMA lock is available, lookup is done under RCU, attempt= ing to > > > > > take a per-VMA lock. If that fails, we fallback to mmap_lock, but= then > > > > > proceed to unconditionally grab per-VMA lock again, dropping mmap= _lock > > > > > immediately. In this configuration mmap_lock is never helf for lo= ng, > > > > > minimizing disruptions while querying. > > > > > > > > > > When per-VMA lock is compiled out, we take mmap_lock once, query = VMAs > > > > > using find_vma() API, and then unlock mmap_lock at the very end o= nce as > > > > > well. In this setup we avoid locking/unlocking mmap_lock on every= looked > > > > > up VMA (depending on query parameters we might need to iterate a = few of > > > > > them). > > > > > > > > > > Signed-off-by: Andrii Nakryiko > > > > > --- > > > > > fs/proc/task_mmu.c | 46 ++++++++++++++++++++++++++++++++++++++++= ++++++ > > > > > 1 file changed, 46 insertions(+) > > > > > > > > > > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c > > > > > index 614fbe5d0667..140032ffc551 100644 > > > > > --- a/fs/proc/task_mmu.c > > > > > +++ b/fs/proc/task_mmu.c > > > > > @@ -388,6 +388,49 @@ static int pid_maps_open(struct inode *inode= , struct file *file) > > > > > PROCMAP_QUERY_VMA_FLAGS \ > > > > > ) > > > > > > > > > > +#ifdef CONFIG_PER_VMA_LOCK > > > > > +static int query_vma_setup(struct mm_struct *mm) > > > > > +{ > > > > > + /* in the presence of per-VMA lock we don't need any setu= p/teardown */ > > > > > + return 0; > > > > > +} > > > > > + > > > > > +static void query_vma_teardown(struct mm_struct *mm, struct vm_a= rea_struct *vma) > > > > > +{ > > > > > + /* in the presence of per-VMA lock we need to unlock vma,= if present */ > > > > > + if (vma) > > > > > + vma_end_read(vma); > > > > > +} > > > > > + > > > > > +static struct vm_area_struct *query_vma_find_by_addr(struct mm_s= truct *mm, unsigned long addr) > > > > > +{ > > > > > + struct vm_area_struct *vma; > > > > > + > > > > > + /* try to use less disruptive per-VMA lock */ > > > > > + vma =3D find_and_lock_vma_rcu(mm, addr); > > > > > + if (IS_ERR(vma)) { > > > > > + /* failed to take per-VMA lock, fallback to mmap_= lock */ > > > > > + if (mmap_read_lock_killable(mm)) > > > > > + return ERR_PTR(-EINTR); > > > > > + > > > > > + vma =3D find_vma(mm, addr); > > > > > + if (vma) { > > > > > + /* > > > > > + * We cannot use vma_start_read() as it m= ay fail due to > > > > > + * false locked (see comment in vma_start= _read()). We > > > > > + * can avoid that by directly locking vm_= lock under > > > > > + * mmap_lock, which guarantees that nobod= y can lock the > > > > > + * vma for write (vma_start_write()) unde= r us. > > > > > + */ > > > > > + down_read(&vma->vm_lock->lock); > > > > > > > > Hi Andrii, > > > > The above pattern of locking VMA under mmap_lock and then dropping > > > > mmap_lock is becoming more common. Matthew had an RFC proposal for = an > > > > API to do this here: > > > > https://lore.kernel.org/all/ZivhG0yrbpFqORDw@casper.infradead.org/.= It > > > > might be worth reviving that discussion. > > > > > > Sure, it would be nice to have generic and blessed primitives to use > > > here. But the good news is that once this is all figured out by you m= m > > > folks, it should be easy to make use of those primitives here, right? > > > > > > > > > > > > + } > > > > > + > > > > > + mmap_read_unlock(mm); > > > > > > > > Later on in your code you are calling get_vma_name() which might ca= ll > > > > anon_vma_name() to retrieve user-defined VMA name. After this patch > > > > this operation will be done without holding mmap_lock, however per > > > > https://elixir.bootlin.com/linux/latest/source/include/linux/mm_typ= es.h#L582 > > > > this function has to be called with mmap_lock held for read. Indeed > > > > with debug flags enabled you should hit this assertion: > > > > https://elixir.bootlin.com/linux/latest/source/mm/madvise.c#L96. > > > > The documentation on the first link says to hold the lock or take a > > reference, but then we assert the lock. If you take a reference to the > > anon vma name, then we will trigger the assert. Either the > > documentation needs changing or the assert is incorrect - or I'm missin= g > > something? >=20 > I think the documentation is correct. It says that at the time of > calling anon_vma_name() the mmap_lock should be locked (hence the > assertion). Then the user can raise anon_vma_name refcount, drop > mmap_lock and safely continue using anon_vma_name object. IOW this is > fine: >=20 > mmap_read_lock(vma->mm); > anon_name =3D anon_vma_name(vma); > anon_vma_name_get(anon_name); > mmap_read_unlock(vma->mm); > // keep using anon_name > anon_vma_name_put(anon_name); >=20 I consider that an optimistic view of what will happen, but okay.