Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35800635rwd; Mon, 10 Jul 2023 12:51:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlHgg1GO7qdZknO+K28NxBirUZ3eyIbyrdx/0ToAgTA8Z0frLjsEiSl4d8lMdCNNYxWGAZ8S X-Received: by 2002:a05:6a20:a11a:b0:11f:c1a1:8c with SMTP id q26-20020a056a20a11a00b0011fc1a1008cmr17589026pzk.54.1689018663236; Mon, 10 Jul 2023 12:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689018663; cv=none; d=google.com; s=arc-20160816; b=0alGf9lI5FTsQNW91ui/xQu6INxLUSB5yq7HCFb9RInRd638BYk9XD5ohe2LzQou3B 91lGMESdOGKeqHBHW5gc7B5pGXB97twTcJYqr0d01BRLJCeA6md8Z3crP2+9njfkdxT0 2D3kyaajLAF7TpMorhhSLmTwbAF9JYLaylx5sOhO7VL7BK7E2luTqWWwYQZNLwaR9kPw kxpCI922HpB7Kzxbp+o/3WDYEiJZfIK9BsGu2G95HgxwnN/1N0R2YM1eH6H7x0mmqr1t 2/vkDuQkae1n+ufSLExZn/qtHhmyphkF3vgBKYWiANJuHG9pPxEi0ymdVQtwZHPR0a9R HjLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nx/B89eRvOrdVhLKL2kBk0nFzu8vcq/3bazGkDJF3l4=; fh=T7pqVOsE7dWyrgnHrguUsJWNhctf0XC4/gRfWUlst0s=; b=nJ1NN0cOoevFMmuJPLMWfJ3q8f3qiVIPVc36LhFm9YHm/+gtztuxqWAa1FnWIZfYZS 0O+XWrp+SC8xHoL0PWhph3sSljlkBs5Wa/lZu/aH7VjSFdGELw0260jrpxlqJIgVhmp+ XrQBAeRLjbVXpF8Gh1WUr3c2mCuS/Fm9ZADc3wAB3m6OjOKp4wt5XjEZn0nTGt39SYU5 XNR6koz5TXezfw056iQJsRvewmZFtt8/B+IDB0BbysGrSLXLHN1jB+tNMTAV62IqympB 724ARQ/jvrZKhRSssmutFrcjnuigBkHKHv/zfPTyDDrKfntmIuDwHeoQ5s3zwmptUiUf WKtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H9ezdzpU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j71-20020a63804a000000b005532e95bf0dsi132214pgd.254.2023.07.10.12.50.50; Mon, 10 Jul 2023 12:51:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H9ezdzpU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230286AbjGJTka (ORCPT + 99 others); Mon, 10 Jul 2023 15:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229575AbjGJTk2 (ORCPT ); Mon, 10 Jul 2023 15:40:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1DC7115; Mon, 10 Jul 2023 12:40:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7DE3D611BD; Mon, 10 Jul 2023 19:40:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F694C433C9; Mon, 10 Jul 2023 19:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689018026; bh=yuEwCfsCHkzRGHioN9r3RJD8uvoHEkZZ+tM35dQuu0U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H9ezdzpUTWP9gByiwB8dcAzwVtqLCIujEEl7pU3BLP9lsZMBRda+6wdyCdvFVU1+a tb6xg1l7zOEtS0dUTiV6qT70egINkR4wmWENP3QeVGCrWtplajD48EtnXIckshPVMd M58PpjbMwJ+E0BNXJtPj85WyAjGLKBtzTxByFuCU= Date: Mon, 10 Jul 2023 21:40:23 +0200 From: Greg Kroah-Hartman To: Ivan Babrou Cc: linux-fsdevel@vger.kernel.org, kernel-team@cloudflare.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Tejun Heo , Hugh Dickins , Andrew Morton , Amir Goldstein , Christoph Hellwig , Jan Kara , Zefan Li , Johannes Weiner Subject: Re: [PATCH] kernfs: attach uuid for every kernfs and report it in fsid Message-ID: <2023071039-negate-stalemate-6987@gregkh> References: <20230710183338.58531-1-ivan@cloudflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230710183338.58531-1-ivan@cloudflare.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 10, 2023 at 11:33:38AM -0700, Ivan Babrou wrote: > The following two commits added the same thing for tmpfs: > > * commit 2b4db79618ad ("tmpfs: generate random sb->s_uuid") > * commit 59cda49ecf6c ("shmem: allow reporting fanotify events with file handles on tmpfs") > > Having fsid allows using fanotify, which is especially handy for cgroups, > where one might be interested in knowing when they are created or removed. > > Signed-off-by: Ivan Babrou > --- > fs/kernfs/mount.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c > index d49606accb07..930026842359 100644 > --- a/fs/kernfs/mount.c > +++ b/fs/kernfs/mount.c > @@ -16,6 +16,8 @@ > #include > #include > #include > +#include > +#include > > #include "kernfs-internal.h" > > @@ -45,8 +47,15 @@ static int kernfs_sop_show_path(struct seq_file *sf, struct dentry *dentry) > return 0; > } > > +int kernfs_statfs(struct dentry *dentry, struct kstatfs *buf) > +{ > + simple_statfs(dentry, buf); > + buf->f_fsid = uuid_to_fsid(dentry->d_sb->s_uuid.b); > + return 0; > +} > + > const struct super_operations kernfs_sops = { > - .statfs = simple_statfs, > + .statfs = kernfs_statfs, > .drop_inode = generic_delete_inode, > .evict_inode = kernfs_evict_inode, > > @@ -351,6 +360,8 @@ int kernfs_get_tree(struct fs_context *fc) > } > sb->s_flags |= SB_ACTIVE; > > + uuid_gen(&sb->s_uuid); Since kernfs has as lot of nodes (like hundreds of thousands if not more at times, being created at boot time), did you just slow down creating them all, and increase the memory usage in a measurable way? We were trying to slim things down, what userspace tools need this change? Who is going to use it, and what for? There were some benchmarks people were doing with booting large memory systems that you might want to reproduce here to verify that nothing is going to be harmed. thanks, greg k-h