Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp478048lqh; Sat, 4 May 2024 08:34:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUm/LqPPdqeneJPrgFlAtllM744SuplvEFiGeupCf2IZns/Du2D/hXYZmo6DcwUUGqUcbg2TVdEO5OAYl/zu+Ah+Wp+8EyVtSO4ewHiFA== X-Google-Smtp-Source: AGHT+IHgZqIOxsYlkHTL6Qjto85KyLSA3BNh00WdW23KsE78tnqQ/jZ/amQViEWS4G9CTxnlQf4S X-Received: by 2002:a05:6a20:3941:b0:1af:839c:d335 with SMTP id r1-20020a056a20394100b001af839cd335mr7713039pzg.55.1714836869622; Sat, 04 May 2024 08:34:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714836869; cv=pass; d=google.com; s=arc-20160816; b=H3o6c9Ocrm0UQCybwSsztzHie1MG/asVKlb7xVLx4S3zqYjdJbqG9p7koK5hTiy2Du gHEgNhpc7FIHd8Lapa6IGmXZEPnvq8COk+b+3BjDGVEX93L4ORLx4I8In6YVu1J2pWq9 3Qr9qOG+Z17tB3BgvwsY5VzPURcg0jmQb+Djl/X+OD9/7yaTQscRTX6kBd5sY+ZwVAxb 9H6oHpQxBNldEm8/PDTZQ5lBhog+e4oeIOxnLChaNiQ6w9ubs3swYWI2E3GqoVKkLeeD rSQz0zA7cnu1C3QRPwRVUf+Ipv5KKEIHHtUWYjPJ0+ODtiQBwdZzoc+Ed8iC8a7Q8teF 4zTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8WyYfWz7aopogA14zCncnAMYAuYaj141TR6tar3Z5wU=; fh=KOUMy+ZMk6VU5C4CGn+HcN7Sw0YtHhQ7WA/AKg4SP1s=; b=kzoVgiXtVpHkkoH/S2VN8wCrogRwL2lVR+upj71gLTu9y5wRnrxrw/bdsQ5D7FSN0Y 5m8BunxqGVYHfli7rfYxkRV6jOWMlXfg43s7XEEck7k2kinZ35uTZTxCvYiztCZK/k0m NuyuV3SqIyaq1jkvQq8aRpN2ajtssO5xAnE88CqmX6Lv57gS+WmkJRQa8fP61usZySDe OfOuC9hd8Yq892b30WLcF0+Kp87x1ca2spF4uxfeI4+MNaMXEGCyLIkDTdKhAX0gm4JT pEl0dK87VUHzHyhYzMFZ9dvmlXiQOENlwGX2bgaRoUPrEnU2Tac/N+y230oubcDEXm57 QN/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q8oKj1vu; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-168728-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168728-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c8-20020a637248000000b00604b94711besi5252677pgn.43.2024.05.04.08.34.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:34:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168728-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q8oKj1vu; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-168728-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168728-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C6EBCB2169D for ; Sat, 4 May 2024 15:34:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C160950297; Sat, 4 May 2024 15:34:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Q8oKj1vu" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E31123EA76; Sat, 4 May 2024 15:34:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714836843; cv=none; b=TTZ+IJncnL0/7nUEDL+kWmtR2hTO1LxBE7N7/jv+T03DF6NBRvuR8h45QaRRMTd8aVvxXUs00zzJFzsmx6DZPBQacmvGhRDR96O3Rh0tRGMGIJx252wWOC3+XqoWd3DElnQFfi+YDUDTC3lnMOrLUG09oKf/XnqxVaxE4BhN+EU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714836843; c=relaxed/simple; bh=Tw298gqXSpUNqvTJkAVfkw6zpwke5iNqzYaHmcCtz/s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FK9Xc8t9TmdOeemweaxdiH+wOmgVU+jn4+AP1IyglZbjezGU5e1Dhn92KInAcZ4KVMDanxDhHYCOwjq1euBj9xhbgd0nd5Fy1xtYnBPh0/YX1I54QuMpo6h4xKvxr/gGEWjtwbGzboHc/NzSGCL0zTcugiOQzlpdxouD/vuNraA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Q8oKj1vu; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2CF9C072AA; Sat, 4 May 2024 15:34:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714836842; bh=Tw298gqXSpUNqvTJkAVfkw6zpwke5iNqzYaHmcCtz/s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q8oKj1vuOdQlfRTomxMl8NGsRXqYO/Yop4wH6qOJ+VYQXhJj8oDV2Yd/oada14QOe Z0Bj4Rw/XlpEWO5oUJ4quoahtgdmSP3HgFBsAmdcfpqkzXvVUkp9wBmt/vJvzfFmeB MkbKMSmopKmujPR8NjtEqq5cFrhvzJClELB3a0PM= Date: Sat, 4 May 2024 17:33:59 +0200 From: Greg KH To: Christian Brauner Cc: 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 Subject: Re: [PATCH 0/5] ioctl()-based API to query VMAs from /proc//maps Message-ID: <2024050424-drift-evil-27de@gregkh> References: <20240504003006.3303334-1-andrii@kernel.org> <20240504-rasch-gekrochen-3d577084beda@brauner> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240504-rasch-gekrochen-3d577084beda@brauner> 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 textual > > 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. Patch itself > > also has performance numbers of a test based on one of the medium-sized > > 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. Also, as this is a new user/kernel api, it needs loads of documentation (there was none), and probably also cc: linux-api, right? thanks, greg k-h