From patchwork Thu Jun 27 17:08:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Nakryiko X-Patchwork-Id: 13714878 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 5D698C2BD09 for ; Thu, 27 Jun 2024 17:09:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D6B146B00A4; Thu, 27 Jun 2024 13:09:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D1B576B00A5; Thu, 27 Jun 2024 13:09:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B94D66B00A6; Thu, 27 Jun 2024 13:09:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9BEB06B00A4 for ; Thu, 27 Jun 2024 13:09:22 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 57CA4160DC8 for ; Thu, 27 Jun 2024 17:09:22 +0000 (UTC) X-FDA: 82277304564.11.683B4E9 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf29.hostedemail.com (Postfix) with ESMTP id 59FEE120028 for ; Thu, 27 Jun 2024 17:09:19 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iWxwaAm6; spf=pass (imf29.hostedemail.com: domain of andrii@kernel.org designates 145.40.73.55 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=1719508147; 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=Nqqeguxhnv70YJ/Hlnzz44ng4fnExjdR7VvZFZgjwVY=; b=zlLL/qjk9LD8gV2yj0GVb04JGiYHoeG9CGLh5+qdm/LQ2gVw4pXCSQpY2KbGDOtpGeK2oR DUAKfrBERncVBK4WfFx4bbYyrUeuFRUohOJ8LSGyXM2dkCHS+87EqS9SGFVvUZYobddhmK 0N+7MWMXyt2ZnER4++pCXFXdHRLRQUI= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iWxwaAm6; spf=pass (imf29.hostedemail.com: domain of andrii@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=andrii@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719508147; a=rsa-sha256; cv=none; b=JBHjmFlEgnP/FaYvzPZnQvxiqahYzuYiUsPu6SGAYROfD7fF3+KdeURqzpbR5Hh2QDGWM+ 7Cm6PlwUSD7VJXnJ16y8KNW+hCxWVDrAKYu085/XtgjSssHSGH/mOjXctK7hgXhgHMk17r vaqZSGMYcD996I3m+B+g6056fvoTKxc= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 8D1D0CE3377; Thu, 27 Jun 2024 17:09:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A915BC2BBFC; Thu, 27 Jun 2024 17:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719508156; bh=OCMwDvtwnM9ll0Ws/wHw8cfOMgOXkr3TtaYN7UcD3wM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iWxwaAm6HiI2s6p8C7OPJUQawedJzfpX3Qtv6R/A3MQznMfbZJjniPkVsJ6xd0kf+ FanSaA7+wP2JrEJsSSupGUVVfHV8nS8GQOg/o37+oky22AN3kGvCRezK8rbrTKyyxc TDAtr9dlBHBQzf2+BDakPYQ4IZ+SiUzUpDX8adHYcU0SjHUMfkqKcSN/lNd8LAEBxa JOT1dqf1/FQNuopBQcbInp1Ctny9qlB9k5ehdwSstT1gn218L89kg7JeHWfyJbEFkb 6lPe01BN5tapSMV5+FQQvExwXYOvAx+QC1vzjwpVqP4vl1LHhlDvcKcj6LkFO+9gWf CAcElJq4S2Mxw== 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, adobriyan@gmail.com, Andrii Nakryiko Subject: [PATCH v6 4/6] docs/procfs: call out ioctl()-based PROCMAP_QUERY command existence Date: Thu, 27 Jun 2024 10:08:56 -0700 Message-ID: <20240627170900.1672542-5-andrii@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240627170900.1672542-1-andrii@kernel.org> References: <20240627170900.1672542-1-andrii@kernel.org> MIME-Version: 1.0 X-Stat-Signature: 3wpqb5hegrxbjof6pkghpeju3ik7yop5 X-Rspam-User: X-Rspamd-Queue-Id: 59FEE120028 X-Rspamd-Server: rspam02 X-HE-Tag: 1719508159-946776 X-HE-Meta: U2FsdGVkX19SacEJNaSNvtRUtXaqTpXdv3Um3C/ZJwUSmPCb5ZoR2q98Q1bbYCt16e9XW9k4W6Uyh8AiyTKeJkbXivRb1m4c16ehQdDE01XQRraSCATNCpilKkstfGNOJcgVRlDdbFIWbZGvxwpJ/sAYONX44jjt46T24+mqMZOUoDngfQUhlrtC8HAQ196IJCBEWCKP6Iq4+duwON2SxsWktib8Vo0dj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=bogofilter, spamicity=0.000000, version=1.2.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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst index 82d142de3461..e834779d9611 100644 --- a/Documentation/filesystems/proc.rst +++ b/Documentation/filesystems/proc.rst @@ -443,6 +443,15 @@ 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 and easy 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::