Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2089616ybf; Mon, 2 Mar 2020 01:39:14 -0800 (PST) X-Google-Smtp-Source: ADFU+vtJEBVZ+2MHZp3LPlGbWh1bY1iR+nFbwr3w6eOr26Hp81tmehq1EO84uC7eZPbJrf87yium X-Received: by 2002:aca:c586:: with SMTP id v128mr1906838oif.166.1583141954554; Mon, 02 Mar 2020 01:39:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583141954; cv=none; d=google.com; s=arc-20160816; b=AhDJiXenGZo0LoEUily/CorX4PE+bSkigLZyy0Csgjp6vHR/WFiLXQmuxRS6z+qdfr /Ni3EBVeMheSFf4Xou6BbTezOzN82IhwYlWJUQHDF08SVrynJaP+aATTnZXrsigxYxnD oqeb6C1lLjNKqxUcjN/RlNKPa1z/BB0owZLs5ESu4WbSNNw2M2KlHom38Zquhy1UEoZ3 uK9+ASsUbka6zRX+c/z5dddtHcHzJ/OD5ONlPrRFJSX+Vyyd2VBlFnR7i7tBvTWrn0EF UmO5ZlDcSsviiK2f+qvP1Xtwx6BkhmI0o50t78lVD3JliKN9Jf4TG1O849r3FqLnBvQk m2NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=I6cHEqxuZEdO2Wa3z/xq7sPwcuFSqMWsnr00/PMKrUs=; b=WLdZuqAnFkJwwwDX4KZRxUo74b4nwdcZE09x+FancIk7qZXLdYy5DqsNWk3XMKUctZ 8zTB8+ucD+haOE/+1ezvRoes60RtIRu7bC473DeLITd1JSCSsiZsYu7Pm8NCT81fgc3v RUZkVa3dfSdQuqAMT0/qQSyiNDyTDBLXDIsIxyin38Q9RA0Yxqfes09yOR7LskzDVZVS mpvScKsoRuxkOYmGluHmEPQ07zyU7A9O+bXVdCqEma13dL6IbDMdJHq9emqqUTN/My3U LvXLsAPwXADE2OwBfazgA2wkmKB1YQOlQTIltk9ePv17JXUWa+jYVklkgO/1tIeGjiGO hTEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d7FvmEYt; 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 p200si6137157oic.213.2020.03.02.01.39.02; Mon, 02 Mar 2020 01:39:14 -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=@kernel.org header.s=default header.b=d7FvmEYt; 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 S1727477AbgCBJiy (ORCPT + 99 others); Mon, 2 Mar 2020 04:38:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:48898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbgCBJix (ORCPT ); Mon, 2 Mar 2020 04:38:53 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DC4492469C; Mon, 2 Mar 2020 09:38:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583141932; bh=afyeUw5VnZbUAYoxsLpHi50eMt+vGabCRyRpK0qjkKQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d7FvmEYtAwbRISDQY7cpWbE7ZT2VmfjytHB0Oe5CwmLnlGScTHDDwtdd8WGhgId0i +CCLK/MeafrNAiTtz+T//uVq1jW+TmYqxUCPeO8KmncEje4PVrxfH6HWXFBHukW1Nh 2cVO5WvoXFuBx218U3sXyT3ocQItiPz4TChWNmJA= Date: Mon, 2 Mar 2020 10:38:50 +0100 From: Greg Kroah-Hartman To: Miklos Szeredi Cc: David Howells , Christian Brauner , James Bottomley , Steven Whitehouse , Miklos Szeredi , viro , Ian Kent , Christian Brauner , Jann Horn , "Darrick J. Wong" , Linux API , linux-fsdevel , lkml Subject: Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17] Message-ID: <20200302093850.GA1998325@kroah.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 02, 2020 at 10:09:51AM +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. That is correct, they should not be pinned, that is what kernfs handles and why we can handle 30k virtual block devices on a 31bit s390 instance :) So you shouldn't have to worry about memory for sysfs. There are loads of other reasons probably not to use sysfs for this instead :) thanks, greg k-h