3 ms·
> A directory is a file like anything else that contains a map of names to inodes. If you're trying to add or remove mappings (create or delete files), then cle
by preseinger 4y ago
> A directory is a file like anything else that contains a map of names to inodes. If you're trying to add or remove mappings (create or delete files), then clearly some synchronization must occur or the contents of the file will contain garbage.
this synchronization is handled for you by the fs, specifically the fs cache
inode alignment and errors are managed by this intermediating layer
your benchmarks are not demonstrating what you think they are demonstrating
- SUPERCILEX 4y agoExcept they are and your claims are trivial to disprove: simply run the benchmarks under perf. You'll find that most of the time is spent on the rwsem which is described here onwards: https://www.kernel.org/doc/html/latest/filesystems/path-lookup.html#inode-i-rwsem https://www.kernel.org/doc/html/latest/filesystems/path-look...
- preseinger 4y agoyour benchmarks use O_DIRECT, which bypasses the fs cache the fs cache does most/all of the optimizations you're doing manually bypassing the fs cache is highly atypical for user-space code