Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp146111rdb; Sun, 28 Jan 2024 18:33:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZEhkfhzLpSyASBjX8C2i1AnxtIEoY8ThaoL42ZXiEMmIEQ6lE65w9hT7iGOSG0QDWdBz6 X-Received: by 2002:a17:906:228d:b0:a35:dd57:e4cc with SMTP id p13-20020a170906228d00b00a35dd57e4ccmr66345eja.22.1706495584089; Sun, 28 Jan 2024 18:33:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706495584; cv=pass; d=google.com; s=arc-20160816; b=kxc38WzrqqhTSuNr6rNXTjg6d1GLLszsXZUdP6kTz7Ml08RkgnwMTzLcwD2LrD7Sjb c42V07WzwBV0+avszW8/YqoBrUn/AQpZMuI/2NWAAqJZHRfK/EJHXhPG/vV53W9zK3SV EN8fhqqHWp1qdGvDo/PawTdVnol0s9Az8+Yv4cPGSo/R3VvXHq51cBB2epqSS5s1ei33 ux4lgNdPsCJAa1b6niv659CIE6WHUJImUn0XkjkFm2EYxyEdISDKenJtu7VDcUH0uyMV mnDj9q8Z6AhP6JzmYnMRUbHKAxxzERHXP8Ddl2ZgmijHyW8Tn4wtD2OW+fpO11sgo2dJ EwSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=M+ZDEclZe7HQOoSy6V5vOAI6Z6ltgVX/clR2/sC5KSY=; fh=+NHEOwOI8sgHa/emZ3nIKC4IhKoRFLn6O7wLrfs7tlM=; b=H6oiVtl4B2Awc/bsHueMHYnDFBr4QfyxBUN3vtDi+Ur5Yb2pURm2cEpmaypoheV3o8 TgH8ohHaWQesi1ORDJjHyBUasSPilta/EMtbdgllut86PAwsv0uJaCem4sqF3YS6n9qb UaQtV/y92AA/cx1nTVQ6fPsrBVWsZM8L0n8sF+fCPvl05/yVmCfdcEmwrmJW09DrwINR KN1xB6rAGJTy0u6JA2Ergwo8uNpt9EexjwT026HUke7hR/sSPHVIVWx5EXWLOauZUe7N KBsIxkD7N0JnE4IZxuTCWxoJhlpOhxKwEcslgvK6vtDSSiRMhxpD60wGv8YTyIZnxbWW vedA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-42095-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42095-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ka19-20020a170907991300b00a3182cc03fcsi3113008ejc.914.2024.01.28.18.33.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 18:33:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42095-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-42095-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42095-linux.lists.archive=gmail.com@vger.kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id D67FE1F225F1 for ; Mon, 29 Jan 2024 02:33:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCCBFF9DA; Mon, 29 Jan 2024 02:32:53 +0000 (UTC) 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 3C28CF9D6; Mon, 29 Jan 2024 02:32:52 +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=1706495573; cv=none; b=XET4rGEhxRoDjkNDV9WIcS7IzXgumrhLNzt8QPKfLAoiic+THDlzpKt4tzMEf2YqytnaoGPafofhF4QqHNw5hmqE6g/D+8nFk6iS0Jp2soiNxlfN6Be3A0/dReGrnB2FhhgZIkgljcV5fezWUJ9p3+Hr/05oCiwWSUvG84pJG6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706495573; c=relaxed/simple; bh=o63n5WMpln1TRFn0Kucd9NqGIM5xQz1xSMHbQaPz57Y=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GBgRREvlveqz6ArDd2d7oegSGdWZLNHL1NhUqAPOI1OQpvTOgfWlbDkktA0VlEP7/+tjzcDplNjFJ6Q0qPe7ydVb+4xOpLfdGrAPGxpQWG4puz/bdrSWZiSkvj/kKNMGXAy9pAebxjkREPShk8xsyhk84qGn1muHiYKl3fIcDAY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18A10C43390; Mon, 29 Jan 2024 02:32:50 +0000 (UTC) Date: Sun, 28 Jan 2024 21:32:49 -0500 From: Steven Rostedt To: Linus Torvalds Cc: Masami Hiramatsu , Mathieu Desnoyers , LKML , Linux Trace Devel , Christian Brauner , Ajay Kaher , Geert Uytterhoeven , linux-fsdevel Subject: Re: [PATCH] eventfs: Have inodes have unique inode numbers Message-ID: <20240128213249.605a7ade@rorschach.local.home> In-Reply-To: References: <20240126150209.367ff402@gandalf.local.home> <20240126162626.31d90da9@gandalf.local.home> <20240128175111.69f8b973@rorschach.local.home> <20240128185943.6920388b@rorschach.local.home> <20240128192108.6875ecf4@rorschach.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Sun, 28 Jan 2024 17:42:30 -0800 Linus Torvalds wrote: > On Sun, 28 Jan 2024 at 17:00, Linus Torvalds > wrote: > > > > mkdir dummy > > cd dummy > > echo "Hello" > hello > > ( sleep 10; cat ) < hello & > > rm hello > > cd .. > > rmdir dummy > > Note that it's worth repeating that simple_recursive_removal() > wouldn't change any of the above. It only unhashes things and makes > them *look* gone, doing things like clearing i_nlink etc. I know, but I already cover the above case. And that case is not what simple_recursive_removal() is covering. I'm worried about what can be opened after a deletion. Not what has already been opened. The simple_recrusive_removal() is the way to clear the dcache on those files and directories that are being removed so that no new references can happen on them. So, I removed the simple_recursive_removal() from the code to see what happened. Interesting, the opposite occurred. # cd /sys/kernel/tracing # echo 'p:sched schedule' > kprobe_events # ls events/kprobes enable filter sched # ls events/kprobes/sched enable filter format hist hist_debug id inject trigger # cat events/kprobes/sched/enable 0 # echo 'p:timer read_current_timer' >> kprobe_events # ls events/kprobes enable filter sched timer Now delete just one kprobe (keeping the kprobes directory around) # echo '-:sched schedule' >> kprobe_events # ls events/kprobes/ enable filter timer Now recreate that kprobe # echo 'p:sched schedule' >> kprobe_events # ls events/kprobes enable filter sched timer # ls events/kprobes/sched/ ls: reading directory 'events/kprobes/sched/': Invalid argument I have no access to the directory that was deleted and recreated. > > But those VFS data structures would still exist, and the files that > had them open would still continue to be open. > > So if you thought that simple_recursive_removal() would make the above > kind of thing not able to happen, and that eventfs wouldn't have to > deal with dentries that point to event_inodes that are dead, you were > always wrong. No but I want to shrink the dentries after the directory is removed. Perhaps something else is the error here. > > simple_recursive_removal() is mostly just lipstick on a pig. It does > cause the cached dentries that have no active use be removed earlier, > so it has that "memory pressure" kind of effect, but it has no real > fundamental semantic effect. I was using it to "flush" the cache on that directory. Nothing more. > > Of course, for a filesystem where the dentry tree *is* the underlying > data (ie the 'tmpfs' kind, but also things like debugfs or ipathfs, > for example), then things are different. Note, tracefs was built on debugfs. Only the "events" directory is "different". The rest of /sys/kernel/tracing behaves exactly like debugfs. > > There the dentries are the primary thing, and not just a cache in > front of the backing store. > > But you didn't want that, and those days are long gone as far as > tracefs is concerned. Well, as long as eventfs is ;-) -- Steve