From mboxrd@z Thu Jan 1 00:00:00 1970 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 20EE0C47422 for ; Fri, 26 Jan 2024 14:17:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ABAEF6B0081; Fri, 26 Jan 2024 09:17:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A6B586B0082; Fri, 26 Jan 2024 09:17:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 933236B0083; Fri, 26 Jan 2024 09:17:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 80C9E6B0081 for ; Fri, 26 Jan 2024 09:17:00 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 26BE7407D5 for ; Fri, 26 Jan 2024 14:17:00 +0000 (UTC) X-FDA: 81721663800.11.8331A80 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf12.hostedemail.com (Postfix) with ESMTP id E7E7640012 for ; Fri, 26 Jan 2024 14:16:57 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=tJGxvR8o; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf12.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706278618; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=J8LKPA8OAmUN6eTRPXOosqIlD+eo9lwadHGluzwMHiA=; b=tj2PiCh+LHSXjfFsW+yNoGxE/hxKOax87ImvR+a+ciWdIwSBr8XTw8PE6/j5+cxGlvPrCe YmpXQGWimvDgRBMhhxze/zwy4e/C9acKctCxK9nUbZQuc5Iugd0q1DTQ6erfL+ve2JNcls bp+pHhUstI+ZOtRjfF4YO3dhcMC+wnM= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=tJGxvR8o; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf12.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706278618; a=rsa-sha256; cv=none; b=orvUa7ZayTnpLh46NHoNkaKhN2qKSCoFLLYHoRG1/qK+pR9kpd22ndiUxWJiCV1qrBtm00 qj1465DdglPGjyD3e1ntidmoHmzJNI8SpJ4vEAmxiN1C6FW1pZfRi1axtXSnQjCIE9Y+aF +t3n/dd4joBrqGFmwD1sWjr5AZxYn0Q= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C33D3CE36EE; Fri, 26 Jan 2024 14:16:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 218ACC433C7; Fri, 26 Jan 2024 14:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706278599; bh=UTvndD8gsD+zqm4ZX9/GghH1PWJ0G0e8T5kRquh5wW4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tJGxvR8oma7uNXWe0Z9VxtxQNjLU+fGvWcDxDVo13j/zUwOaR10OgqCT+uHEc0qpC uJMdLXgawSyIXk040fVGxbLlC3v2G20/O8HGt2doYeg9+WZVaedotoDr3rJmpoQYmA O4D2vvx9wjtHLBr6NKi2QI6MvJHuNlY8JNJCgVmM= Date: Fri, 26 Jan 2024 06:16:38 -0800 From: Greg Kroah-Hartman To: Steven Rostedt Cc: lsf-pc@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Christian Brauner , Al Viro , Linus Torvalds Subject: Re: [LSF/MM TOPIC] Making pseudo file systems inodes/dentries more like normal file systems Message-ID: <2024012634-rotten-conjoined-0a98@gregkh> References: <20240125104822.04a5ad44@gandalf.local.home> <2024012522-shorten-deviator-9f45@gregkh> <20240125205055.2752ac1c@rorschach.local.home> <2024012528-caviar-gumming-a14b@gregkh> <20240125214007.67d45fcf@rorschach.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240125214007.67d45fcf@rorschach.local.home> X-Rspamd-Queue-Id: E7E7640012 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: dkfamuzjamkmufibfe1f4hrze4phug5r X-HE-Tag: 1706278617-708856 X-HE-Meta: U2FsdGVkX1/VScSdJY/fP+2QtF4CTh8aDEv/gy0EjxaJ8Mdu4cVX5OPrzaw9Bbj07cxNCXnCN9IntT/qDNy8PSbQkNa4OT8LoCukbosN5s3q35OrnnYvz37L7cuHz4sDnneNhDF1ldXbH1zg+yIfnlSg4Qc+i+1uVXClBUOZ95yTNdsQB55FCfWC6fOqd/mYVDyObjRysJOQbXy12CSikENMMUm1wIsM2YvWuHIvYDZyTu9yZQ/LXUMxK+Zqd/Bpenbmvl7b97I8WD+fM+sC7AjrzAW9AsKlQCWwKy1llM5p4qYfYMI37HIXEQmF0C9ZzoF+MOQjdPwcnzUguDcDZiR9o0n3Vi8UcjVEOif20Df9HSt6enPBV0x8oL7uf3eZDqpdjwe6MNHyIRVI+0erZV/HqAtGUTPC1uGuhNynYzgPgzSKhH+PgP+sOrsAud7qL7Ho97MfMgb+Y0RXvNLiaGfizppC3+LTKnK6bTere5RH7LI96kMoUKUFLx4qs3fN8sGVHLJJjZ55EPBZrkmWLZphjxHNa9mGLiSdrkcH0idI9fIOqSwmGk2Upp5F1J4pB5usobDTVIgwQxuOviD5bxvEWjR6u0rrlm+ybeYNivQaDdQtYYu7W16yRTQhHG1ysSPCkqheFaAywXJvhpIyRAsGHjtmGIKez+vy4RHyLdPByFibF/BTW1XSsQzo/EINkptjJMvSwczS0E03J5nQ5AEv12ou4CTyDP8OSdW/nf1WtkXHrhCXdKWnvVXf6rwX3mbZhhbsN8x3d4nbYrW4iB6JESCVbtKLTJs4xvm8E2YUntD9n+E3uLXKDNf7xB/S4INaAK9F9Ol1nqwAXrCIOJCqjypMz5YtwNEhlRBy8LvJ+8wL6ok1eekPhBo9Gx7oJXbb7bilfracQi4RT8BHa9AKI9JWW9DsT/aIboUfilsjXQNho4/sGz4Ypt7y8SOgglcM5PtBB1Bwy3XZQDA 4ffrXiFb JA2v7foQCj+D07M5iBf5qTKs7Xb7FsOzoDypm1A5Xzh47dWga8Cjkq7krCXhB4RDB7KbfulSyoXIHkbH6JEyA6aTRlpC/sUQJ0Efib/77bljbe3b1e61C60ybivXueUcZSBq8Jn24Dvk/jkOlXAgqPv0//kubHcGm6mILlC87J0CRNItC+BtHFEy1VNV9yQZugDuGzvFIgh1J5IcgMEqzuNAA1fm3AV8q+cpsYrtyASLfNWpBa5+DMPO6mKpJphCE6YsRF2kRY8mvLX01omHNDIbIAA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Jan 25, 2024 at 09:40:07PM -0500, Steven Rostedt wrote: > On Thu, 25 Jan 2024 17:59:40 -0800 > Greg Kroah-Hartman wrote: > > > > I tried to use kernfs when doing a lot of this and I had issues. I > > > don't remember what those were, but I can revisit it. > > > > You might, as kernfs makes it so that the filesystem structures are > > created on demand, when accessed, and then removed when memory pressure > > happens. That's what sysfs and configfs and cgroups use quite > > successfully. > > kernfs doesn't look trivial and I can't find any documentation on how > to use it. You have the code :) > Should there be work to move debugfs over to kernfs? Why? Are you seeing real actual memory use with debugfs that is causing problems? That is why we made kernfs, because people were seeing this in sysfs. Don't change stuff unless you need to, right? > I could look at it too, but as tracefs, and more specifically eventfs, > has 10s of thousands of files, I'm very concerned about meta data size. Do you have real numbers? If not, then don't worry about it :) > Currently eventfs keeps a data structure for every directory, but for > the files, it only keeps an array of names and callbacks. When a > directory is registered, it lists the files it needs. eventfs is > specific that the number of files a directory has is always constant, > and files will not be removed or added once a directory is created. > > This way, the information on how a file is created is done via a > callback that was registered when the directory was created. That's fine, and shouldn't matter. > For this use case, I don't think kernfs could be used. But I would > still like to talk about what I'm trying to accomplish, and perhaps see > if there's work that can be done to consolidate what is out there. Again, look at kernfs if you care about the memory usage of your virtual filesystem, that's what it is there for, you shouldn't have to reinvent the wheel. And the best part is, when people find issues with scaling or other stuff with kernfs, your filesystem will then benifit (lots of tweaks have gone into kernfs for this over the past few kernel releases.) thanks, greg k-h