Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp608501lqh; Sat, 4 May 2024 14:51:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVpzD+jutdWlNrIen7SxoYkhUeYclHiqaGt2aiNr5IaqEwPZRZ6qtnU9LdbT35OZILcGho6nPKwbN+rfp7Ox4kbwjsYXBpbYo7s556uiw== X-Google-Smtp-Source: AGHT+IEa/kgGJ7t2CooM/PT1U7fXhwEjvcib8Orv4T/FqLdkfExVZVuBROrsZ9b2s2MmtHoaUHMx X-Received: by 2002:a17:902:e84d:b0:1eb:a636:ecab with SMTP id t13-20020a170902e84d00b001eba636ecabmr7030546plg.34.1714859474073; Sat, 04 May 2024 14:51:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714859474; cv=pass; d=google.com; s=arc-20160816; b=o67dpIcROXtHQDen21sk4IOPH+Q+gdDrnTvT8fMq0uwmoudr91lEexv3lNtjd74hFT Hsf0ehoMI4iRcb9UAPTpILUORv/DnTABp8CjNqcrmNA1R9jCKsCFCCSyaBio1WGoLJzL /2OkOCDMp3g/U42QJbBFZPSDE35tcHRxH5TijJazDFtngv9aBY+unmG3O5tAUsuAI5zS TBkpXAsgNDDTmwVj5hnozrFyKwYrI2NmxfyMRAYi8fcf+MVv/X0fY4G0ChnJV+PoxNRI ofCnkTRcq0BRWYRFBw5txQTd1A5DoxNJTV32JD+do80S0atW52P1CGu9IXlkl26gXdpI rCfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=VpJQPM7rd1rBkvd50aikN/qFqNg/enyy5dkWT9AuB3o=; fh=8lLqNF8+XVb5KPc2PlvYHetOD9W8gZ9RmjfFRsT2eV0=; b=WAgMSQH3En3i2erINlMZV87qmYixZhI4nFBynz646Hii+TnNmuNsvc6wCgXZLVXQev gK75iQTbGSc/+vsagHgSFNONLmMYPZHHyRuA7Fu+bG7aIdGN5PBfRes2+TPTxquwD8Zd ESQoR4DDsCUZMRjNj5/P99ILmsFp3t+kEPPG4ki9rbLrDAtrHt1i0givouPo1/XibCJ/ 0fYosZm1goncNuxPBi1Z/a1vO4izrKmbPDNRN4haJxYtRQpbFu1HUDJJAnZ0l0QfpPSL vTDzjIC4mwglh17R6TDeUeFcnGw2neA7nbwSJTyyVC3ymaw2T6wafoQgZ1wKAaNxtYJO MG5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=E8pdwU+P; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-168833-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168833-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u5-20020a170902e80500b001ec2c2393e1si5513619plg.261.2024.05.04.14.51.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 14:51:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168833-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=E8pdwU+P; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-168833-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168833-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AE5432821E2 for ; Sat, 4 May 2024 21:51:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ACB5784E1C; Sat, 4 May 2024 21:50:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E8pdwU+P" Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8283A84DEC; Sat, 4 May 2024 21:50:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714859451; cv=none; b=epYmCIOnK1n8TThdQTTxk32DTVSC/nGtKjDx2j4Oof+tYaY/bQ7IHDF5T3RS6y+agSKqybyR8uy/JkoIghGToduvpxQCIkdURlUeGZpwFGReXhmfdlbZvIFrlany0R0mnUGdlGSCeYbqEVhvje1IJ7PH42ZDB3J2BaPT7qdJw0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714859451; c=relaxed/simple; bh=VpJQPM7rd1rBkvd50aikN/qFqNg/enyy5dkWT9AuB3o=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=s+Hy0Ae04AusGp+W0Oas5P/9a0ix1FQNdZS8Mx2tc70/DcnUYu9zcnRExYt1JVYOjfhzeirKYR4yTiZVnBXidGNINcN6nmHQprRxAY3OFn0X0K/0jcnKe8VpWPflLkrG5SkGaQbcBTsbX3U/5ICFQPk4HA+XeEpSGiJIV7thxD0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=E8pdwU+P; arc=none smtp.client-ip=209.85.160.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-23ee34c33ceso526151fac.3; Sat, 04 May 2024 14:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714859449; x=1715464249; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VpJQPM7rd1rBkvd50aikN/qFqNg/enyy5dkWT9AuB3o=; b=E8pdwU+PaBXY/dYVpENy57cuC8T5NBEpPI2kuJ2JtgdtNhitSkqGfsioYXSFdzkHUc YLQgEFHadmmQEfZITv55MxMfQaBJzLx716Naa9+efxI0x1iwu3fDn+nIQiyl2pdAz/xI 25iAUcKclZKROhtyiYW8Qfrz8dN1aLq2eTdhUuUXQWECknDHltOMKutKUJyaolVAP3+/ oPSyErXSdGo0m9eNYcGqDMl5BDCKfcNE1dffXtsbIRTymskC0Ayf+7JoJhoyFoztzmAV 8zsQddV3C22CA/v+EEet5zOx1YhbOG6CMzIFMXCQZFO6v6BBAOPe/ybLBLZz06XX1Fnk GV5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714859449; x=1715464249; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VpJQPM7rd1rBkvd50aikN/qFqNg/enyy5dkWT9AuB3o=; b=r46SwKiWJMIqgOoVlSMm+Iz00aZsBIcLMRmG7fDyeD/KLUKDZbAV377b5MdkwLroxF BGYfyy24vUhQuM0b9C3l0eX6Nhk0bT84NACSDH6vtdySuG8hzvlXJ89irpgp20TMV5D9 7eVB7jS3oSkCLrnFGVhGhgbu3zYUpS9IAs67UkuOzim4+94QnL/1GkbaRUv56cSYVkRv zxIHb6+SfQw70lkJqbZiS8czcsc/LPPfnsWNoxjh4Ddoek+sDtdi4z750H9A/TO7gtdv LsGPiuKQMKo/+U+30VElkjB5+5mwa/t8abJ23cinCeAW1derXZcbi1prk6aajL8F7NDE buLA== X-Forwarded-Encrypted: i=1; AJvYcCUZm6q3Q7mY7BYappeU2VeHFfiyNOc1USZLIHxQNIsmG/NkYuBlNLPyxPIjbPzbFcNU6Ea0B8RFJRSmvezj+qmogcq9fy6X0wEc1yG3chyACqYb1UsHIKZNiANunXjS2tHZXsuVb6wXyhqnD9zbc277mUfsa+mtZenkRvZqL6qtDg== X-Gm-Message-State: AOJu0YypNgu/boMdl3RxF0tzjfjCMHFPW8t/KFMblMkHvYBrQojlQ461 J9ai6bdCNdQKEa5LS3+idk6L3gX/n5HnoYePZEMoo5ApHrtzpvdCDstaN84ojaxExkuiQHam3p3 xLGsf8TS6kyJW7kNQArebCX7LW5DvDQ== X-Received: by 2002:a05:6871:826:b0:23e:4c7e:d018 with SMTP id q38-20020a056871082600b0023e4c7ed018mr7074428oap.41.1714859449483; Sat, 04 May 2024 14:50:49 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240504003006.3303334-1-andrii@kernel.org> <20240504-rasch-gekrochen-3d577084beda@brauner> <2024050424-drift-evil-27de@gregkh> In-Reply-To: <2024050424-drift-evil-27de@gregkh> From: Andrii Nakryiko Date: Sat, 4 May 2024 14:50:36 -0700 Message-ID: Subject: Re: [PATCH 0/5] ioctl()-based API to query VMAs from /proc//maps To: Greg KH Cc: Christian Brauner , Andrii Nakryiko , linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, May 4, 2024 at 8:34=E2=80=AFAM Greg KH = wrote: > > On Sat, May 04, 2024 at 01:24:23PM +0200, Christian Brauner wrote: > > 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 t= extual > > > 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. Pat= ch itself > > > also has performance numbers of a test based on one of the medium-siz= ed > > > 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? > > See my objection to the ioctl api in the patch review itself. Will address them there. > > Also, as this is a new user/kernel api, it needs loads of documentation > (there was none), and probably also cc: linux-api, right? Will cc linux-api. And yes, I didn't want to invest too much time in documentation upfront, as I knew that API itself will be tweaked and tuned, moved to some other place (see Christian's pidfd suggestion). But I'm happy to write it, I'd appreciate the pointers where exactly this should live. Thanks! > > thanks, > > greg k-h