lkml.org 
[lkml]   [2015]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] futex: eliminate cache miss from futex_hash()
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


\
 
 \ /
  Last update: 2015-09-10 12:41    [W:0.069 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site