From: Davidlohr Bueso <dave@stgolabs.net>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Thomas Gleixner <tglx@linutronix.de>,
kbuild test robot <fengguang.wu@intel.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] futex: eliminate cache miss from futex_hash()
Date: Thu, 10 Sep 2015 03:22:21 -0700 [thread overview]
Message-ID: <20150910102220.GB19736@linux-q0g1.site> (raw)
In-Reply-To: <1441834601-13633-1-git-send-email-linux@rasmusvillemoes.dk>
On Wed, 09 Sep 2015, Rasmus Villemoes wrote:
>futex_hash() references two global variables: the base pointer
>futex_queues and the size of the array futex_hashsize. The latter is
>marked __read_mostly, while the former is not, so they are likely to
>end up very far from each other. This means that futex_hash() is
>likely to encounter two cache misses.
>
>We could mark futex_queues as __read_mostly as well, but that doesn't
>guarantee they'll end up next to each other (and even if they do, they
>may still end up in different cache lines). So put the two variables
>in a small singleton struct with sufficient alignment and mark that as
>__read_mostly.
This really doesn't have much practical effect -- not even on larger
boxes, where such things matter. For instance, I ran the patch on a
60-core IvyBridge with 'perf-bench futex', for which futex-hash
particularly benefits in good data layout (ie our current smp alignment).
http://linux-scalability.org/futex-__futex_data/
I think we should leave it as is.
Thanks,
Davidlohr
next prev parent reply other threads:[~2015-09-10 10:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 21:36 Rasmus Villemoes
2015-09-10 10:22 ` Davidlohr Bueso [this message]
2015-09-12 9:59 ` Ingo Molnar
2015-10-26 15:22 ` Sebastian Andrzej Siewior
2015-09-22 14:27 ` [tip:locking/core] futex: Force hot variables into a single cache line tip-bot for Rasmus Villemoes
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=20150910102220.GB19736@linux-q0g1.site \
--to=dave@stgolabs.net \
--cc=bigeasy@linutronix.de \
--cc=fengguang.wu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®