From: Eric Biggers <ebiggers@google.com>
To: Christoph Lameter <cl@linux.com>
Cc: akpm@linux-foundation.org, viro@zeniv.linux.org.uk,
mm-commits@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: + fs-bufferc-make-bh_lru_install-more-efficient.patch added to -mm tree
Date: Fri, 2 Jun 2017 22:44:08 -0700 [thread overview]
Message-ID: <20170603054408.GA12796@google.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1706011050590.8835@east.gentwo.org>
+Cc linux-fsdevel
On Thu, Jun 01, 2017 at 11:07:19AM -0500, Christoph Lameter wrote:
> On Wed, 31 May 2017, akpm@linux-foundation.org wrote:
>
> > + struct buffer_head *evictee = bh;
> > + struct bh_lru *b;
> > + int i;
> > + b = this_cpu_ptr(&bh_lrus);
> > + for (i = 0; i < BH_LRU_SIZE; i++) {
> > + swap(evictee, b->bhs[i]);
>
> Could you try to use this_cpu_xchg here to see if it reduces latency
> further?
>
> for (i = 0; i < BH_LRU_SIZE; i++) {
> __this_cpu_xchg(bh_lrus->bhs[i], evictee)
>
> ...
>
I tried --- actually, 'evictee = __this_cpu_xchg(bh_lrus.bhs[i], evictee)'. But
it's much slower, nearly as slow as the original --- which perhaps is not
surprising since __this_cpu_xchg() is a cmpxchg rather than a simple load and
store. It may be even worse on non-x86 architectures. Also note that we still
have to disable IRQs because we need to stay on the same CPU throughout so that
only a single queue is operated on.
Eric
next parent reply other threads:[~2017-06-03 5:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <592f4959.hf6G/WhBeHpccHb7%akpm@linux-foundation.org>
[not found] ` <alpine.DEB.2.20.1706011050590.8835@east.gentwo.org>
2017-06-03 5:44 ` Eric Biggers [this message]
2017-06-05 13:51 ` + fs-bufferc-make-bh_lru_install-more-efficient.patch added to -mm tree Christoph Lameter
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=20170603054408.GA12796@google.com \
--to=ebiggers@google.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
--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).