Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3037513ybf; Mon, 2 Mar 2020 21:36:16 -0800 (PST) X-Google-Smtp-Source: ADFU+vsqSq2JkFjFak/G7lvmyPCCQ1Y6+ez4oi9wllH2UxJIWeTRVmc8slkhMddi/d9JCXxhQh8T X-Received: by 2002:a9d:4d96:: with SMTP id u22mr2121408otk.271.1583213776101; Mon, 02 Mar 2020 21:36:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583213776; cv=none; d=google.com; s=arc-20160816; b=ynVLw+dVG0taWEuksbENtpnFiq8tNAG2nz5Y1R9idi/L1PqAVDMYm2hpYXwpqzdjQu cn2yzUkyJFOqO7eBFPGMXGG2btEgnFDhS0Z2mk//X9ccLEMymWRZ9k1dcTyhPz21/cra uOWueXlU/ZYHGtJJzGuu5AdSxwoiIldSu9xiKDUhrxujvG1FExzG+fo6sd3BJEWLNTVd nWDUtnRJRrjBB6Zi2jjFbAZVK1tCNWP08pGRLR5ydxYH4b77RQyvimx31uDnZ+34ubEL NDG/tjhldTD6T9/GKIfbzWe/n80QUJ3bpHLGnWKzNqNh3qSFycUrFR63e6jAA5Hf/tFi ZhPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature:dkim-signature; bh=tggywWKtWN6rOIFQkxL1pkuJH5gISL+DxeYq7A1sess=; b=DAR7PMKHxm5VJ9x0fPAjafEx0urOlQIqq9I7Un7CiUmhTBaYMPExF4lDD+O7Fv6Zv4 mLr/C9y99o7br8eo6amLy/N1bJ9mXPJ0th2/7ykUs7gvmz/67LSkFpIjcu/4qiuxtBDP gf+XxPlnd31YvrHadWVCgW/WyL4kP+9Vz5f7miNLVyJ50u8scZZxDndnD7jPaOJTiUlB BQ/uAgnFJ9vFwVZWhdPI89SADET+sbsbwp7OaLjDbQIHIvAJwEJkmEPl8jtTivefls/O 53XDByrMOEjjPdkBKc7K4ylgajCI2gXHbofIb6vGpTi098zWALXEo+KvkjqkEU9J9Yzg Si4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@themaw.net header.s=fm2 header.b=BT76Yia4; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=QYQzeOwe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s129si8159811oig.177.2020.03.02.21.36.03; Mon, 02 Mar 2020 21:36:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@themaw.net header.s=fm2 header.b=BT76Yia4; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=QYQzeOwe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725845AbgCCFf7 (ORCPT + 99 others); Tue, 3 Mar 2020 00:35:59 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:60435 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725440AbgCCFf7 (ORCPT ); Tue, 3 Mar 2020 00:35:59 -0500 X-Greylist: delayed 469 seconds by postgrey-1.27 at vger.kernel.org; Tue, 03 Mar 2020 00:35:58 EST Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id 63E5B787; Tue, 3 Mar 2020 00:28:08 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 03 Mar 2020 00:28:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=themaw.net; h= message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; s=fm2; bh= tggywWKtWN6rOIFQkxL1pkuJH5gISL+DxeYq7A1sess=; b=BT76Yia40KWvlkva zxMUOgQ2cGh1G4CgkSd9LSzdv6pa1NSdycnVvMLIAVXgY/qhSZv23Enfe5LwvSnP EnOyOczk5IZPIJRHEDJkuzShBusCvGpFbRToi16x1NH36tS8pUdzBY1l+MY3l/hn 3FMSPuh2SfVOobkPUkwnGw/UccwiqHsKL4E9hDUsBQ0iLvArw7joxKkF16ZHoYv2 E2El88/+YeVWpdiv+bC97e7YkaCsEUXGNpEZTBNPOzuVRQDwQOeYnz/yCLphwOjh LbUyx0HxZiXgrSsL8xISkG5XZw0P3tPw8lObQw3cHKcF94+LuBDHiJ2hJk5DLQjk get+tg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=tggywWKtWN6rOIFQkxL1pkuJH5gISL+DxeYq7A1se ss=; b=QYQzeOweAI6VXarA2WPokNZgWLn9+9ymb4ttoNqRCfHxTNHhxuA1BuqNe xTzy0j8EY5psHGRl0hN3M9HQ75NBopgkUJe99IZ9mrMkMrDTVIKTN1fbqJnbwIsK ZinT2nK5jeO/rgN9iP9tYYdgXipgMH6bd61QrW8MZs7aWgHrr6O6AhUcaEs6NMxJ xMmh+N17h9gyHfggea6TB/h1iXycAMPYuCaV3AOoLb6/B9LjninTWgnJHHnJW79G J+gJYgCH7vyGZUxIZN2kDUBkelGsy+vdobfXYqltBvRVI2itWDPNbqub+VVshRsp SuGV0KQiaOgwoPizuH00f9zHo8JPg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddthedgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkffuhffvffgjfhgtfggggfesthejredttderjeenucfhrhhomhepkfgrnhcu mfgvnhhtuceorhgrvhgvnhesthhhvghmrgifrdhnvghtqeenucfkphepuddukedrvddtke drudekkedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehrrghvvghnsehthhgvmhgrfidrnhgvth X-ME-Proxy: Received: from mickey.themaw.net (unknown [118.208.188.113]) by mail.messagingengine.com (Postfix) with ESMTPA id 76C9A328005A; Tue, 3 Mar 2020 00:28:02 -0500 (EST) Message-ID: <0403cda7345e34c800eec8e2870a1917a8c07e5c.camel@themaw.net> Subject: Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17] From: Ian Kent To: Miklos Szeredi , David Howells Cc: Christian Brauner , James Bottomley , Steven Whitehouse , Miklos Szeredi , viro , Christian Brauner , Jann Horn , "Darrick J. Wong" , Linux API , linux-fsdevel , lkml , Greg Kroah-Hartman Date: Tue, 03 Mar 2020 13:27:59 +0800 In-Reply-To: References: <158230810644.2185128.16726948836367716086.stgit@warthog.procyon.org.uk> <1582316494.3376.45.camel@HansenPartnership.com> <1582556135.3384.4.camel@HansenPartnership.com> <1582644535.3361.8.camel@HansenPartnership.com> <20200228155244.k4h4hz3dqhl7q7ks@wittgenstein> <107666.1582907766@warthog.procyon.org.uk> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-03-02 at 10:09 +0100, Miklos Szeredi wrote: > On Fri, Feb 28, 2020 at 5:36 PM David Howells > wrote: > > sysfs also has some other disadvantages for this: > > > > (1) There's a potential chicken-and-egg problem in that you have > > to create a > > bunch of files and dirs in sysfs for every created mount and > > superblock > > (possibly excluding special ones like the socket mount) - but > > this > > includes sysfs itself. This might work - provided you create > > sysfs > > first. > > Sysfs architecture looks something like this (I hope Greg will > correct > me if I'm wrong): > > device driver -> kobj tree <- sysfs tree > > The kobj tree is created by the device driver, and the dentry tree is > created on demand from the kobj tree. Lifetime of kobjs is bound to > both the sysfs objects and the device but not the other way round. > I.e. device can go away while the sysfs object is still being > referenced, and sysfs can be freely mounted and unmounted > independently of device initialization. > > So there's no ordering requirement between sysfs mounts and other > mounts. I might be wrong on the details, since mounts are created > very early in the boot process... > > > (2) sysfs is memory intensive. The directory structure has to be > > backed by > > dentries and inodes that linger as long as the referenced > > object does > > (procfs is more efficient in this regard for files that aren't > > being > > accessed) > > See above: I don't think dentries and inodes are pinned, only kobjs > and their associated cruft. Which may be too heavy, depending on the > details of the kobj tree. > > > (3) It gives people extra, indirect ways to pin mount objects and > > superblocks. > > See above. > > > For the moment, fsinfo() gives you three ways of referring to a > > filesystem > > object: > > > > (a) Directly by path. > > A path is always representable by an O_PATH descriptor. > > > (b) By path associated with an fd. > > See my proposal about linking from /proc/$PID/fdmount/$FD -> > /sys/devices/virtual/mounts/$MOUNT_ID. > > > (c) By mount ID (perm checked by working back up the tree). > > Check that perm on lookup of /sys/devices/virtual/mounts/$MOUNT_ID. > The proc symlink would bypass the lookup check by directly jumping to > the mountinfo dir. > > > but will need to add: > > > > (d) By fscontext fd (which is hard to find in sysfs). Indeed, the > > superblock > > may not even exist yet. > > Proc symlink would work for that too. There's mounts enumeration too, ordering is required to identify the top (or bottom depending on terminology) with more than one mount on a mount point. > > If sysfs is too heavy, this could be proc or a completely new > filesystem. The implementation is much less relevant at this stage > of > the discussion than the interface. Ha, proc with the seq file interface, that's already proved to not work properly and looks difficult to fix. Ian