On Fri, 29 Aug 2025 at 08:47, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote: > > Anyway, the way to fix this is to not care about lifetimes at all: > just treat the hash as the random number it is, and just accept the > fact that the number gets actively reused and has no meaning. Side note: the actual re-use of various pointers and/or inode numbers is going to be very very random. Classic old filesystems that live by inode numbers will use 'iget5_locked()' and will basically have the same 'struct inode *' pointer too when they re-use an inode number. And they likely also have a very simplistic inode allocation model and a unlink followed by a file creation probably *will* re-use that same inode number. So you can probably see 'struct inode *' get reused quite quickly and reliably for entirely unrelated files just based on file deletion/creation patterns. The dentry pointer will typically stick around rather aggressively, and will likely remain the same when you delete a file and create another one with the same name, and the mnt pointer will stick around too, so the contents of 'struct path' will be the exact same for two completely different files across a delete/create event. So hashing the path is very likely to stay the same as long as the actual path stays the same, but would be fairly insensitive to the underlying data changing. People might not care, particularly with executables and libraries that simply don't get switched around much. And, 'struct file *' will get reused randomly just based on memory allocation issues, but I wouldn't be surprised if a close/open sequence would get the same 'struct file *' pointer. So these will all have various different 'value stays the same, but the underlying data changed' patterns. I really think that you should just treat the hash as a very random number, not assign it *any* meaning at trace collection time, and the more random the better. And then do all the "figure it out" work in user space when *looking* at the traces. It might be a bit more work, and involve a bit more data, but I _think_ it should be very straightforward to just do a "what was the last mmap that had this hash" Linus