From: Brian Foster <bfoster@redhat.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, Ian Kent <raven@themaw.net>
Subject: Re: [PATCH v2 RESEND] namei: clear nd->root.mnt before O_CREAT unlazy
Date: Tue, 4 Oct 2022 13:09:25 -0400 [thread overview]
Message-ID: <Yzxoxa9g1AyIlIj0@bfoster> (raw)
In-Reply-To: <YzjV/qCcHDH7gfLZ@ZenIV>
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
prev parent reply other threads:[~2022-10-04 17:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-23 14:03 [PATCH v2 RESEND] namei: clear nd->root.mnt before O_CREAT unlazy Brian Foster
2022-10-02 0:06 ` Al Viro
2022-10-04 17:09 ` Brian Foster [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yzxoxa9g1AyIlIj0@bfoster \
--to=bfoster@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=raven@themaw.net \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).