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


Groups > linux.kernel > #1462629

Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in times()/clock_gettime()

Path csiph.com!news.freedyn.net!aioe.org!bofh.it!news.nic.it!robomod
From Mel Gorman <mgorman@techsingularity.net>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in times()/clock_gettime()
Date Mon, 15 Aug 2016 10:40:01 +0200
Message-ID <s6lB7-3do-3@gated-at.bofh.it> (permalink)
References <s2IFX-52N-9@gated-at.bofh.it> <s2IFX-52N-11@gated-at.bofh.it> <s4Gqm-b4-55@gated-at.bofh.it> <s5jBo-1uO-5@gated-at.bofh.it> <s6kOJ-2Gt-13@gated-at.bofh.it>
MIME-Version 1.0
Content-Type text/plain; charset=iso-8859-15
Content-Disposition inline
User-Agent Mutt/1.5.23 (2014-03-12)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 43
Organization linux.* mail to news gateway
X-Original-Cc Stanislaw Gruszka <sgruszka@redhat.com>, Ingo Molnar <mingo@kernel.org>, Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org>, Mike Galbraith <mgalbraith@suse.de>, linux-kernel@vger.kernel.org
X-Original-Date Mon, 15 Aug 2016 09:33:49 +0100
X-Original-Message-ID <20160815083349.GE8119@techsingularity.net>
X-Original-References <1470385316-15027-1-git-send-email-ggherdovich@suse.cz> <1470385316-15027-2-git-send-email-ggherdovich@suse.cz> <20160810112641.GA30126@gmail.com> <20160812121010.GA30199@redhat.com> <1471247345.1776.2.camel@suse.cz>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1462629

Show key headers only | View raw


On Mon, Aug 15, 2016 at 09:49:05AM +0200, Giovanni Gherdovich wrote:
> > mmtest benchmark results are below (full compare-kernels.sh output is in attachment):
> > 
> > vanila-4.7            revert                prefetch              patch
> > 4.74 (  0.00%)        3.04 ( 35.93%)        4.09 ( 13.81%)        1.30 ( 72.59%)
> > 5.49 (  0.00%)        5.00 (  8.97%)        5.34 (  2.72%)        1.03 ( 81.16%)
> > 6.12 (  0.00%)        4.91 ( 19.73%)        5.97 (  2.40%)        0.90 ( 85.27%)
> > 6.68 (  0.00%)        4.90 ( 26.66%)        6.02 (  9.75%)        0.88 ( 86.89%)
> > 7.21 (  0.00%)        5.13 ( 28.85%)        6.70 (  7.09%)        0.87 ( 87.91%)
> > 7.66 (  0.00%)        5.22 ( 31.80%)        7.17 (  6.39%)        0.92 ( 88.01%)
> > 7.91 (  0.00%)        5.36 ( 32.22%)        7.30 (  7.72%)        0.95 ( 87.97%)
> > 7.95 (  0.00%)        5.35 ( 32.73%)        7.34 (  7.66%)        1.06 ( 86.66%)
> > 8.00 (  0.00%)        5.33 ( 33.31%)        7.38 (  7.73%)        1.13 ( 85.82%)
> > 5.61 (  0.00%)        3.55 ( 36.76%)        4.53 ( 19.23%)        2.29 ( 59.28%)
> > 5.66 (  0.00%)        4.32 ( 23.79%)        4.75 ( 16.18%)        3.65 ( 35.46%)
> > 5.98 (  0.00%)        4.97 ( 16.87%)        5.96 (  0.35%)        3.62 ( 39.40%)
> > 6.58 (  0.00%)        4.94 ( 24.93%)        6.04 (  8.32%)        3.63 ( 44.89%)
> > 7.19 (  0.00%)        5.18 ( 28.01%)        6.68 (  7.13%)        3.65 ( 49.22%)
> > 7.67 (  0.00%)        5.27 ( 31.29%)        7.16 (  6.63%)        3.62 ( 52.76%)
> > 7.88 (  0.00%)        5.36 ( 31.98%)        7.28 (  7.58%)        3.65 ( 53.71%)
> > 7.99 (  0.00%)        5.39 ( 32.52%)        7.40 (  7.42%)        3.65 ( 54.25%)
> > 
> > Patch works because we we update sum_exec_runtime on current thread
> > what assure we see proper sum_exec_runtime value on different CPUs. I
> > tested it with reproducers from commits 6e998916dfe32 and d670ec13178d0,
> > patch did not break them. I'm going to run some other test.
> > 
> > Patch is draft version for early review, task_sched_runtime() will be
> > simplified (since it's called only current thread) and possibly split
> > into two functions: one that call update_curr() and other that return
> > sum_exec_runtime (assure it's consistent on 32 bit arches).
> > 
> > Stanislaw
> 

Is this really equivalent though? It updates one task instead of all
tasks in the group and there is no guarantee that tsk == current.
Glancing at it, it should monotonically increase but it looks like it
would calculate stale data.

-- 
Mel Gorman
SUSE Labs

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


Thread

Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Stanislaw Gruszka <sgruszka@redhat.com> - 2016-08-12 14:20 +0200
  Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Giovanni Gherdovich <ggherdovich@suse.cz> - 2016-08-15 09:50 +0200
    Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Mel Gorman <mgorman@techsingularity.net> - 2016-08-15 10:40 +0200
      Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Stanislaw Gruszka <sgruszka@redhat.com> - 2016-08-15 11:30 +0200
        Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Mel Gorman <mgorman@techsingularity.net> - 2016-08-15 12:00 +0200
          Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Stanislaw Gruszka <sgruszka@redhat.com> - 2016-08-15 12:40 +0200
  Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in times()/clock_gettime() Wanpeng Li <kernellwp@gmail.com> - 2016-08-15 11:20 +0200
    Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in  times()/clock_gettime() Stanislaw Gruszka <sgruszka@redhat.com> - 2016-08-15 11:30 +0200
      Re: [PATCH 1/1] sched/cputime: Mitigate performance regression in times()/clock_gettime() Wanpeng Li <kernellwp@gmail.com> - 2016-08-15 11:30 +0200

csiph-web