On Thu, 28 Aug 2025 at 14:17, Steven Rostedt <rostedt@xxxxxxxxxx> wrote: > > But that's unique per task, right? What I liked about the f_inode > pointer, is that it appears to be shared between tasks. I actually think the local meaning of the file pointer is an advantage. It not only means that you see the difference in mappings of the same file created with different open calls, it also means that when different processes mmap the same executable, they don't see the same hash. And because the file pointer doesn't have any long-term meaning, it also means that you also can't make the mistake of thinking the hash has a long lifetime. With an inode pointer hash, you could easily have software bugs that end up not realizing that it's a temporary hash, and that the same inode *will* get two different hashes if the inode has been flushed from memory and then loaded anew due to memory pressure. > I only want to add a new hash and print the path for a new file. If > several tasks are using the same file (which they are with the > libraries), then having the hash be the same between tasks would be > more efficient. Why? See above why I think it's a mistake to think those hashes have lifetimes. They don't. Two different inodes can have the same hash due to lifetime issues, and the same inode can get two different hashes at different times for the same reason. So you *need* to tie these things to the only lifetime that matters: the open/close pair (and the mmap - and the stack traces - will be part of that lifetime). I literally think that you are not thinking about this right if you think you can re-use the hash. Linus