Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1503714

Re: [PATCH 1/2] perf bench futex: cache align the worer struct

From Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] perf bench futex: cache align the worer struct
Date 2016-10-19 16:40 +0200
Message-ID <su0ca-2v4-49@gated-at.bofh.it> (permalink)
References <ssYYN-1qy-13@gated-at.bofh.it> <strep-3hr-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016-10-17 18:09:49 [-0700], Davidlohr Bueso wrote:
> On Sun, 16 Oct 2016, Sebastian Andrzej Siewior wrote:
> 
> > It popped up in perf testing that the worker consumes some amount of
> > CPU. It boils down to the increment of `ops` which causes cache line
> > bouncing between the individual threads.
> 
> Are you referring to this?
> 
>       │         for (i = 0; i < nfutexes; i++, w->ops++) {
>       │ be:   add    $0x1,%ebx
> 65.87 │       addq   $0x1,0x18(%r12)
> 
> (which is like 65% of 13% on my box with a default futex-hash run).
correct.

> Even better, could we get rid entirely of the ops increments and just
> use a local variable, then update the worker at the end of the function.
> The following makes 'perf' pretty much disappear in the profile.

this should do it, too. So what remains is the read access for w->futex
but since it does not pop up in perf, it is probably not that important.

> Thanks,
> Davidlohr

Sebastian

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] perf bench futex: cache align the worer struct Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-16 21:10 +0200
  [PATCH 2/2] perf bench futex: add NUMA support Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-16 21:10 +0200
    Re: [PATCH 2/2] perf bench futex: add NUMA support Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-17 16:40 +0200
      Re: [PATCH 2/2] perf bench futex: add NUMA support Jiri Olsa <jolsa@redhat.com> - 2016-10-17 17:10 +0200
        Re: [PATCH 2/2] perf bench futex: add NUMA support Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-17 17:10 +0200
          [PATCH 2/2 v2] perf bench futex: add NUMA support Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-17 17:40 +0200
            Re: [PATCH 2/2 v2] perf bench futex: add NUMA support Davidlohr Bueso <dave@stgolabs.net> - 2016-10-19 20:20 +0200
              Re: [PATCH 2/2 v2] perf bench futex: add NUMA support Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-19 20:40 +0200
                Re: [PATCH 2/2 v2] perf bench futex: add NUMA support Davidlohr Bueso <dave@stgolabs.net> - 2016-10-21 04:40 +0200
            Re: [PATCH 2/2 v2] perf bench futex: add NUMA support Davidlohr Bueso <dave@stgolabs.net> - 2016-10-21 05:10 +0200
  Re: [PATCH 1/2] perf bench futex: cache align the worer struct Davidlohr Bueso <dave@stgolabs.net> - 2016-10-18 03:20 +0200
    Re: [PATCH 1/2] perf bench futex: cache align the worer struct Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-19 16:40 +0200
      [PATCH] perf/bench-futex: Avoid worker cacheline bouncing Davidlohr Bueso <dave@stgolabs.net> - 2016-10-19 20:10 +0200
        Re: [PATCH] perf/bench-futex: Avoid worker cacheline bouncing Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-19 20:20 +0200
          Re: [PATCH] perf/bench-futex: Avoid worker cacheline bouncing Davidlohr Bueso <dave@stgolabs.net> - 2016-10-19 20:50 +0200
  [tip:perf/core] perf bench futex: Cache align the worker struct tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-10-24 21:10 +0200

csiph-web