From patchwork Wed Jun 5 00:24:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Nakryiko X-Patchwork-Id: 13686021 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 E03B0C25B78 for ; Wed, 5 Jun 2024 00:25:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7AE726B00A1; Tue, 4 Jun 2024 20:25:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 75F0B6B00A2; Tue, 4 Jun 2024 20:25:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 626E36B00A3; Tue, 4 Jun 2024 20:25:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 42C0F6B00A1 for ; Tue, 4 Jun 2024 20:25:44 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id EEB17140215 for ; Wed, 5 Jun 2024 00:25:43 +0000 (UTC) X-FDA: 82194941766.11.736D710 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf02.hostedemail.com (Postfix) with ESMTP id EF14880005 for ; Wed, 5 Jun 2024 00:25:41 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=OjIONyKY; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf02.hostedemail.com: domain of andrii@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=andrii@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717547142; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jjT1GSMCV5Nk8FWrC1MabZZkWiIxjy54HlrFMrQ5rxk=; b=Bj+TlTJJNw6+EEYOYb6Fk9bzBGm4RRLl3q1jP5Z13uubk8FYFYgdNbY/M2kxItWHPfv19N GkgsyJZz5yb184bE1Nct59kvbVtYaoqTOi+951T45x9i33/+kl1+LbSouvMyca1HIaAGDm 8R0Pmy3i3trLvyXGFOG7UyoU58e3ILU= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=OjIONyKY; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf02.hostedemail.com: domain of andrii@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=andrii@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717547142; a=rsa-sha256; cv=none; b=fNDYZvikUDiC3a6o10uNlivGQVsRy7Xb+TtUVLnFHFK1ILupXTsP/hxcfO/WJK9ww+2oA5 OSj/TsIpnkGtpRsAzaW+UsyfxXNtESBxQLfd0kxJ9C2u4/eD3NMH611h8H48HLTD3JFezf hn2RQIVHcZA+C8rqDYn/f3A1iznDlpI= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 27151CE1383; Wed, 5 Jun 2024 00:25:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F9BAC2BBFC; Wed, 5 Jun 2024 00:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717547138; bh=ZB4t6JlnJmyNfXJGfSg5ESgmhwAqw9FNf1Hmazm6kO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OjIONyKYr0+xpTgXOjcVF6bOu02uR2+txTrRdm4Ixq+QkB+2eXEz0kuSKxOnhbNv+ n4Mw3XADEz/zMDgWgsnoCtNCX+wDYNP/uoyMk2FDPgaQ1IfIloSv/lZSECMlFyarar DpohbGRGcfJaJ4hdzHB3Tratzz77+u8gEQDjOEuiJw3aBaKwuO1bJZ8X0E/seeHgHX q2cx7mBYyK8gJ5dFXkXh8Y9Bxu99EhogGZY1NuRAP/ayKfGAuOcbZy1dmBkpKT9YW0 wz7tZsETraSeriNv1SZHfrH06MX7u9Gc8yZ7/mlxd/jNwiW4Z3R2XTqq4QIB08cT4I kLfEN+PJfbx9Q== From: Andrii Nakryiko To: linux-fsdevel@vger.kernel.org, brauner@kernel.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org, gregkh@linuxfoundation.org, linux-mm@kvack.org, liam.howlett@oracle.com, surenb@google.com, rppt@kernel.org, Andrii Nakryiko Subject: [PATCH v3 6/9] docs/procfs: call out ioctl()-based PROCMAP_QUERY command existence Date: Tue, 4 Jun 2024 17:24:51 -0700 Message-ID: <20240605002459.4091285-7-andrii@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605002459.4091285-1-andrii@kernel.org> References: <20240605002459.4091285-1-andrii@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: EF14880005 X-Stat-Signature: htgtefuodyojaak5mqj4hfzfk8hud4zx X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1717547141-826115 X-HE-Meta: U2FsdGVkX19CSWecEx7EDIjYowH7am0yuF3WSI1vBh0WXl4Gg8B2kDoFeThZlsJo5IpgP7uXx9Os0NdDCtjbcbzP9v8a/9WzgynQxGT4MHdwSWz6P5RHzN948Oox8WN96+dQH5Sp8MWsNtNhLL6z/L5mdKm2S03dvlz8Xhe5pxgDCeVG6aLV+iJcCkEvZg26ifjeKft3jg+Iq/9YAoquBL35zLOjTffwgFrjGb3J3ox8EZ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.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Call out PROCMAP_QUERY ioctl() existence in the section describing /proc/PID/maps file in documentation. We refer user to UAPI header for low-level details of this programmatic interface. Signed-off-by: Andrii Nakryiko --- Documentation/filesystems/proc.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst index 7c3a565ffbef..f2bbd1e86204 100644 --- a/Documentation/filesystems/proc.rst +++ b/Documentation/filesystems/proc.rst @@ -443,6 +443,14 @@ is not associated with a file: or if empty, the mapping is anonymous. +Starting with 6.11 kernel, /proc/PID/maps provides an alternative +ioctl()-based API that gives ability to flexibly and efficiently query and +filter individual VMAs. This interface is binary and is meant for more +efficient programmatic use. `struct procmap_query`, defined in linux/fs.h UAPI +header, serves as an input/output argument to the `PROCMAP_QUERY` ioctl() +command. See comments in linus/fs.h UAPI header for details on query +semantics, supported flags, data returned, and general API usage information. + The /proc/PID/smaps is an extension based on maps, showing the memory consumption for each of the process's mappings. For each mapping (aka Virtual Memory Area, or VMA) there is a series of lines such as the following::