From patchwork Fri May 24 04:10:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Nakryiko X-Patchwork-Id: 13672704 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 39830C25B7A for ; Fri, 24 May 2024 04:11:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C77546B009E; Fri, 24 May 2024 00:11:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C284B6B00A1; Fri, 24 May 2024 00:11:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC90E6B00A0; Fri, 24 May 2024 00:11:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7CF4B6B009D for ; Fri, 24 May 2024 00:11:00 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2872CA1B32 for ; Fri, 24 May 2024 04:11:00 +0000 (UTC) X-FDA: 82151963880.20.C853C21 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf05.hostedemail.com (Postfix) with ESMTP id 95805100013 for ; Fri, 24 May 2024 04:10:58 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=X0X12B5Z; spf=pass (imf05.hostedemail.com: domain of andrii@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=andrii@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716523858; 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=OGUZxijvbGuVt6fDjLN7OWA92f78jgRVHIMS21y+QzBVIR7gXfmyfyzjAIS9xqTKRaNgCI 20BrPNxo+R9YNERvNcZRgHPZmzTF9T2UbFjVfQs2FTFAssaHlhNqMw9W606BanIg5zmpZ/ /+RI57d9s0ZEUnPlS6fq/Zb8FkRmlA4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716523858; a=rsa-sha256; cv=none; b=UKFre8UaX6UiLUKGlQiOcwvL4pFDJz9jDPsljERS2xfr/tzGxa632Vfzma5B49locMiOCd QPdVRmTfk5XKSlxk/OtYy/VciWOjGTT5c+Uou0Ih3VQpRf2g8bqGqHVSr3nVyiXpHH4TsO zLxH2p8vT4MAqrvXpZiaHw3oWYIuat8= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=X0X12B5Z; spf=pass (imf05.hostedemail.com: domain of andrii@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=andrii@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D7A2163036; Fri, 24 May 2024 04:10:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FDF9C32786; Fri, 24 May 2024 04:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716523857; bh=ZB4t6JlnJmyNfXJGfSg5ESgmhwAqw9FNf1Hmazm6kO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X0X12B5ZJO7+/PmdMn4HdgAZbKU1NH+gvRopfoxD3GC/v/a1MKLtcxCgm4Fxl6zGU qiUBA/ew+RLkhKXqCxfCoAtsqhZfug5eG/NEIJzm6Sfw5g/TB2YS7fi8zcPdA+H6yR 8aUMuRwLuaddhdyOI3zU3vqdBvUXESYGPsbc4SLxHsg6g/RIWLXqlkrv6CgVPLuBtP LMaN16sNkRBz0sg5eqjHZk0ktrW+4MXpk3AE9CY7C7W95zL+Jyq4tz7yLQNHRPYNMd qsWmQUdn70zaWixVwAf8AOsxjk9TE8dZemBTjpQx6cRp+oA7vXVeYIIkCz7X74raUB 8GpR/4E/3s9qA== 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 v2 6/9] docs/procfs: call out ioctl()-based PROCMAP_QUERY command existence Date: Thu, 23 May 2024 21:10:28 -0700 Message-ID: <20240524041032.1048094-7-andrii@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240524041032.1048094-1-andrii@kernel.org> References: <20240524041032.1048094-1-andrii@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: c11x9rxnebjgw9w3ppo8kdonf944ca7i X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 95805100013 X-HE-Tag: 1716523858-347853 X-HE-Meta: U2FsdGVkX1+pwzslKJI4lkCB7WsppgCl1Q0LW32oGpeMVxWKL0v1WtD/z69IG6yxUeUjXdr610ZOfj+Ry0D2sGUbhi67bUVw2ynBtMicoNNbOdxPsVwTyN3RNAjMO6NNgO74H8tTMD2qphr+17dNYa1XNoWRLcPZKq3ZKj67gA0MNuTdhPcs69Gre/64B9UgY1q+uEQwVrFr3TVJA2ID8TDTcziIiEC/njiYHDhqCPCAJHcsC5JpsSfIAHtxAWtJS7Xp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m@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::