Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp357403lqh; Sat, 4 May 2024 04:24:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVSSOZXhPcIGz6vfzjDB3YxioPn73qrFV0apAJNK9mZckrl0EG49TAroYtNmDa3CdfcQ6ouNxqbWp+KYh8yY2wKhsZ/NIATI8i6qqdyww== X-Google-Smtp-Source: AGHT+IFRZ4DTv78y90KW9MqHz3kWnUi6I9VebMBjRw2M5WHbq28nYO6/IVRX3qhEIypgKzSNNkOn X-Received: by 2002:a50:cd17:0:b0:572:9962:7f0 with SMTP id z23-20020a50cd17000000b00572996207f0mr3055121edi.34.1714821880312; Sat, 04 May 2024 04:24:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714821880; cv=pass; d=google.com; s=arc-20160816; b=y7RJxIYHOZpnBygByYJ0VjwPuI5a/2neImDe8TUhlms83Kzpt/TjepVpE3UES6SPOS XTpE1pANnrCX3pu+xSSZpelUpVDI1oHLLntr75qlHmKMYvRWG58qHJDmTklBVi7UZ+LD oP4Vq+Byask/7SFZBFjgk1kEz2WD6HmGVPLgba/irUD0C0Ng45o163DbL9F97ZAq/ZVa /zicv8dTcqmyQM7briiD3OOVwhWitZ0j+4JYLvKT1O2zUQdHkn+DyVDWSSngSmNgvUkh ftZV8IAwqJIahWvHOha5FjL7yArYVke15B6878Q8J9Dpnq390x0A0TW5VIH2A1NWMoR/ VlxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HzN8gf+lipjbXvGtQZyzxky4+4CCrSCLFZOKM5erC1A=; fh=1eM1pVhfUajiYTQUYWZw2cm9lu/MFN7e77iNB2SDldQ=; b=K5U2Hh2/SuBXWHsDkUMhHtucSqGTJtjHOV6fH3iD5j3oHqQzQ9rJY4JKrC3Ke0AagY 239I+6Lx6daamorsbgqYhGXvGRbMp9PSr9MtLw+KTXiyMkARCcsA6Xteg09csM9jgl5+ i6E4EcWQZ22si+KZyG7E9aYoH1lcDyiyjvmxkS8H0rypRcbIMCRPeHYDMwmjFfWXIUP+ TtschbgayBW/3FW/u3Y7LDRaT8KVRkaYwxqnprsN6QGUeqc+luXlYm+gfDsHpHjie5C3 br7YnVW1BFVgR52QCMLIeCqWwugXBFkI3EMYxn1uXGycY3XkLTsfblhB3llMW7vv5vP9 YDaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T3RJ+eD3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c10-20020a50d64a000000b00572d80fe354si1283905edj.22.2024.05.04.04.24.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 04:24:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T3RJ+eD3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id ECDF81F21D87 for ; Sat, 4 May 2024 11:24:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C64F1CD06; Sat, 4 May 2024 11:24:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="T3RJ+eD3" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 448554689; Sat, 4 May 2024 11:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714821869; cv=none; b=DlM4AAeUxlJi5Tuu2OAnNYNmLs/VWCuft4ssb3FntCeZmrn+l84ivgzoUaYEjEKsGt0gx9NyzADWt3dgQ7BgFv5p1tQbRXq9dwCcHIvGBfaYxdV74o0YWBjGTydL+j5bNDvJ7tiwdl2nRe2qaZ3CUn4Bw5rusIADLbxRTTV4mQo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714821869; c=relaxed/simple; bh=ZFUN6ZfJJFj019cT3H3F5ftQBbB/jbGfSG3vzZ2bHDY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Uy+NQcM7o0CNKsHgvXIsjZlUBHZc7wddur1iYYk3dBj2+05oGoXCY2r/TPC7WCuDYYcVSwmbTieBEByDHklGNaj3CrLmc5jBTNCU1QwegR6qILdwQK1JRRNgsoL2jK63JNIz/DjcuOhQa4VPCrBzV5GEjVo7oyNvO4SejWrt26M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T3RJ+eD3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A00A9C072AA; Sat, 4 May 2024 11:24:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714821868; bh=ZFUN6ZfJJFj019cT3H3F5ftQBbB/jbGfSG3vzZ2bHDY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T3RJ+eD3P4krbidA4Ux+D5n2CGZ52JX4U90QOuKkNuirMUx4ftzcL9Zq24mhdBYEk ic3BoOiWj/dNwNV89puB3YidkIcSOC7UcAU9JGdkmdzgU7pUYfZEzh8PX0cgRUw4lj 0o0Zw1EDkU0R4rYRwSe9Cad/EHVH6N0WhkKnN1HUVRyaCcZinvkHrvemcLzdsn4nvm 2fQythfK+JGXpeCwVuW6wNxQ04MsxSNmJQgPRhIkokdjTqhUBHHVqtoclNUI5Ax9Y5 B2T9wcrvandZRpNJnooCKA0KPITePq8Ae89YJI67TVPOWU1j5QOKn5GCL6cabvx0CL m0FQi7LDFyd1A== Date: Sat, 4 May 2024 13:24:23 +0200 From: Christian Brauner To: Andrii Nakryiko Cc: linux-fsdevel@vger.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 Subject: Re: [PATCH 0/5] ioctl()-based API to query VMAs from /proc//maps Message-ID: <20240504-rasch-gekrochen-3d577084beda@brauner> References: <20240504003006.3303334-1-andrii@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240504003006.3303334-1-andrii@kernel.org> On Fri, May 03, 2024 at 05:30:01PM -0700, Andrii Nakryiko wrote: > Implement binary ioctl()-based interface to /proc//maps file to allow > applications to query VMA information more efficiently than through textual > processing of /proc//maps contents. See patch #2 for the context, > justification, and nuances of the API design. > > Patch #1 is a refactoring to keep VMA name logic determination in one place. > Patch #2 is the meat of kernel-side API. > Patch #3 just syncs UAPI header (linux/fs.h) into tools/include. > Patch #4 adjusts BPF selftests logic that currently parses /proc//maps to > optionally use this new ioctl()-based API, if supported. > Patch #5 implements a simple C tool to demonstrate intended efficient use (for > both textual and binary interfaces) and allows benchmarking them. Patch itself > also has performance numbers of a test based on one of the medium-sized > internal applications taken from production. I don't have anything against adding a binary interface for this. But it's somewhat odd to do ioctls based on /proc files. I wonder if there isn't a more suitable place for this. prctl()? New vmstat() system call using a pidfd/pid as reference? ioctl() on fs/pidfs.c?