On Sun, Oct 02, 2022 at 01:06:22AM +0100, Al Viro wrote: > On Fri, Sep 23, 2022 at 10:03:34AM -0400, Brian Foster wrote: > > > incompatible with O_CREAT. Otherwise the tradeoff for this change is > > that this may impact behavior when an absolute path O_CREAT lookup > > lands on a symlink that contains another absolute path. The unlazy > > sequence of the create lookup now clears the nd->root mount pointer, > > which means that once we read said link via step_into(), the > > subsequent nd_jump_root() calls into set_root() to grab the mount > > pointer again (from refwalk mode). This is historical behavior for > > O_CREAT and less common than the current behavior of a typical > > create lookup unnecessarily legitimizing the root dentry. > > I'm not worried about the overhead of retrieving the root again; > using the different values for beginning and the end of pathwalk, > OTOH... > > It's probably OK, but it makes analysis harder. Do we have a real-world > testcases where the contention would be observable? > The reproducer was an old aim7 benchmark doing open(O_CREAT)'s and close()'s. The only way I was able to reproduce it at the time was to scale out open(O_CREAT)'s of prexisting files across many different submounts, which ended up being limited by the root entry of the rootfs. If I try to run a sustained file allocation workload in a similar environment, then the underlying filesystems tend to bottleneck before this particular dentry lock and it's not really noticeable from what I can see (though I don't think I have as fast storage as the original reporter). My thought process for this patch was not so much that the workload was critical, but rather that the regression seemed an unintentional side effect of refactoring and easy enough to avoid. Brian