All of lore.kernel.org
 help / color / mirror / Atom feed
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

  parent reply	other threads:[~2017-06-03  5:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31 22:53 + fs-bufferc-make-bh_lru_install-more-efficient.patch added to -mm tree akpm
     [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     ` 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.