linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: Unnecessarily bad cache behavior for ext4_getattr()
Date: Fri, 29 Nov 2019 19:49:50 -0500	[thread overview]
Message-ID: <20191130004950.GB16443@mit.edu> (raw)
In-Reply-To: <CAHk-=wivmk_j6KbTX+Er64mLrG8abXZo0M10PNdAnHc8fWXfsQ@mail.gmail.com>

On Sun, Nov 24, 2019 at 04:19:16PM -0800, Linus Torvalds wrote:
> It looks from profiles like ext4_getattr() is fairly expensive,
> because it unnecessarily accesses the extended inode information and
> causes extra cache misses.
> 
> On an empty kernel allmodconfig build (which is a lot of "stat()"
> calls by Make, and a lot of silly string stuff in user space due to
> all the make variable games we play), ext4_getattr() was something
> like 1% of the time according to the profile I gathered. It might be
> bogus - maybe the cacheline ends up being accessed later anyway, but
> it _looked_ like it was the whole "i_extra_isize" access that missed
> in the cache.
> 
> That's all for gathering the STATX_BTIME information, that the caller
> doesn't even *want*.
> 
> How about a patch like the attached?

Looks good, thanks, I've applied it to the ext4 tree.

I'm a bit surprised a cache line miss rated that high on a kernel
build, but that probably says a lot about how efficient the rest of
the kernel was (and I assume Make didn't need to rebuild most of the
object files).

					- Ted

P.S.  Did you see the ext4 pull request?  I wasn't sure if you haven't
gotten to it yet due to being distracted by Turkey day or not...


      parent reply	other threads:[~2019-11-30  0:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25  0:19 Unnecessarily bad cache behavior for ext4_getattr() Linus Torvalds
2019-11-25 20:35 ` Andreas Dilger
2019-11-30  0:49 ` Theodore Y. Ts'o [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=20191130004950.GB16443@mit.edu \
    --to=tytso@mit.edu \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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).