From patchwork Tue Jun 18 22:45:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Nakryiko X-Patchwork-Id: 13703114 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 C184FC27C4F for ; Tue, 18 Jun 2024 22:45:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B4738D006D; Tue, 18 Jun 2024 18:45:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3620D8D0066; Tue, 18 Jun 2024 18:45:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 205448D006D; Tue, 18 Jun 2024 18:45:51 -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 F33CB8D0066 for ; Tue, 18 Jun 2024 18:45:50 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A40561C18E9 for ; Tue, 18 Jun 2024 22:45:50 +0000 (UTC) X-FDA: 82245493260.28.C5E7114 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf16.hostedemail.com (Postfix) with ESMTP id 99C38180009 for ; Tue, 18 Jun 2024 22:45:48 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=U6biJYZj; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf16.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=1718750741; 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=8VZ9et5/zuCyeg1t48KCtMemovW/aroDgZ/s42RgmHV2NkB+Sm7f+XAsX9In7amcjV6cut DvBTkUzd3QlLWC+uHFHRFOpR64dIAYPxpI25fG5ZHQmbsgZW47UvyTHulKgJUY4FLoOE4q 9QVCJdzSJbXu19RMqGRbdM1IEYoRFCM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718750741; a=rsa-sha256; cv=none; b=sEhLDKrJqFSv8TCOa5bmK8JyCb+Zzm8RDTRsR21QC4eiN/JWoHc5wHB0lfKjXtbm1bO5kK 0ck51G5DwecjDZeO5UuB8yXmyr7g4ytl6j4yUFl3ZyYShU7LTAnTxHEAkfdqprZavbaARU dqMj4T9YU+kcXAO120w37UQDb5cvG4A= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=U6biJYZj; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf16.hostedemail.com: domain of andrii@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=andrii@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 98AB5CE1C43; Tue, 18 Jun 2024 22:45:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2380C3277B; Tue, 18 Jun 2024 22:45:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718750744; bh=OCMwDvtwnM9ll0Ws/wHw8cfOMgOXkr3TtaYN7UcD3wM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U6biJYZjx6n/yCnySOnJ/0QKNa/AdfaW7t0ofQIiqUjfxQORpwwEtMKkdom44OrDp ciJqfeQLQp6xpBxzairrodBgPeEdKbthUWTC8mOpCqWJXZIF1lkgS2Ovcb3HSouGco odzJtA+I/GY+BTi2k8Y975PSowJFGg+RJyoAZx+D+HkVHKxap3ozWJnwi5/UUSeTK8 wgYNclpkinStLKlNAmuF0/30bdegIQUmot8p/2thA1xiyHoEpypV8AzoW/DX/tAH4D Qd/1lXbdNvu30g67If6EG6mqTC++NuB0wG/3mkRolc5ow+dFDtDH3pculy5/ICg6vq a253IBmOo5Dtg== 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 v5 4/6] docs/procfs: call out ioctl()-based PROCMAP_QUERY command existence Date: Tue, 18 Jun 2024 15:45:23 -0700 Message-ID: <20240618224527.3685213-5-andrii@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240618224527.3685213-1-andrii@kernel.org> References: <20240618224527.3685213-1-andrii@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 99C38180009 X-Stat-Signature: 897wzkiz75o4tzchzsdzyjgybcuisca3 X-Rspam-User: X-HE-Tag: 1718750748-707691 X-HE-Meta: U2FsdGVkX1+xVbhL0jGbHdcQTbIzgmXBcpA37NctNX5WlYAvOFNaw8b75HOJ1H/OK+D5LQIiHnvD1WRKnNIv1Oh0tsqXkzq7+17c7Tuly8v6J6y+NTqK2OwT/znE1i3ZxMDx2jVmWa61+6GA+95GXH88LR8dNQt4ebl3Av/i+3Hdrll0hkv/Y6i4F9LaOSwTiFlgSx1g6OusXJ6+CehJc7LFsDx/hVwRRjBJIA/O2Z/BUUXyUUT7l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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 | 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::