lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e31a11c42c21353963bd75c88493e8158316d469.camel@synopsys.com>
Date:   Mon, 19 Nov 2018 09:55:28 +0000
From:   Alexey Brodkin <alexey.brodkin@...opsys.com>
To:     "daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>
CC:     "tglx@...utronix.de" <tglx@...utronix.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "vineet.gupta1@...opsys.com" <vineet.gupta1@...opsys.com>,
        "linux-snps-arc@...ts.infradead.org" 
        <linux-snps-arc@...ts.infradead.org>
Subject: Re: [PATCH v2] clocksource/drivers/arc_timer: Utilize generic
 sched_clock

Hi Daniel,

On Mon, 2018-11-19 at 10:43 +0100, Daniel Lezcano wrote:
> On 19/11/2018 10:31, Alexey Brodkin wrote:
> > Hi Daniel,
> > 
> > On Sun, 2018-11-18 at 03:17 +0100, Daniel Lezcano wrote:
> > > On 05/11/2018 15:39, Daniel Lezcano wrote:
> > > > On 24/10/2018 00:33, Vineet Gupta wrote:
> > > > > On 10/17/2018 04:30 AM, Alexey Brodkin wrote:
> > > > > > It turned out we used to use default implementation of sched_clock()
> > > > > > from kernel/sched/clock.c which was as precise as 1/HZ, i.e.
> > > > > > by default we had 10 msec granularity of time measurement.
> > > > > > 
> > > > > > Now given ARC built-in timers are clocked with the same frequency as
> > > > > > CPU cores we may get much higher precision of time tracking.
> > > > > > 
> > > > > > Thus we switch to generic sched_clock which really reads ARC hardware
> > > > > > counters.
> > > > > > 
> > > > > > This is especially helpful for measuring short events.
> > > > > > That's what we used to have:
> > > > > > ------------------------------>8------------------------
> > > > > > $ perf stat /bin/sh -c /root/lmbench-master/bin/arc/hello > /dev/null
> > > > > > 
> > > > > >  Performance counter stats for '/bin/sh -c /root/lmbench-master/bin/arc/hello':
> > > > > > 
> > > > > >          10.000000      task-clock (msec)         #    2.832 CPUs utilized
> > > > > >                  1      context-switches          #    0.100 K/sec
> > > > > >                  1      cpu-migrations            #    0.100 K/sec
> > > > > >                 63      page-faults               #    0.006 M/sec
> > > > > >            3049480      cycles                    #    0.305 GHz
> > > > > >            1091259      instructions              #    0.36  insn per cycle
> > > > > >             256828      branches                  #   25.683 M/sec
> > > > > >              27026      branch-misses             #   10.52% of all branches
> > > > > > 
> > > > > >        0.003530687 seconds time elapsed
> > > > > > 
> > > > > >        0.000000000 seconds user
> > > > > >        0.010000000 seconds sys
> > > > > > ------------------------------>8------------------------
> > > > > > 
> > > > > > And now we'll see:
> > > > > > ------------------------------>8------------------------
> > > > > > $ perf stat /bin/sh -c /root/lmbench-master/bin/arc/hello > /dev/null
> > > > > > 
> > > > > >  Performance counter stats for '/bin/sh -c /root/lmbench-master/bin/arc/hello':
> > > > > > 
> > > > > >           3.004322      task-clock (msec)         #    0.865 CPUs utilized
> > > > > >                  1      context-switches          #    0.333 K/sec
> > > > > >                  1      cpu-migrations            #    0.333 K/sec
> > > > > >                 63      page-faults               #    0.021 M/sec
> > > > > >            2986734      cycles                    #    0.994 GHz
> > > > > >            1087466      instructions              #    0.36  insn per cycle
> > > > > >             255209      branches                  #   84.947 M/sec
> > > > > >              26002      branch-misses             #   10.19% of all branches
> > > > > > 
> > > > > >        0.003474829 seconds time elapsed
> > > > > > 
> > > > > >        0.003519000 seconds user
> > > > > >        0.000000000 seconds sys
> > > > > > ------------------------------>8------------------------
> > > > > > 
> > > > > > Note how much more meaningful is the second output - time spent for
> > > > > > execution pretty much matches number of cycles spent (we're running
> > > > > > @ 1GHz here).
> > > > > > 
> > > > > > Signed-off-by: Alexey Brodkin <abrodkin@...opsys.com>
> > > > > > Cc: Daniel Lezcano <daniel.lezcano@...aro.org>
> > > > > > Cc: Vineet Gupta <vgupta@...opsys.com>
> > > > > > Cc: Thomas Gleixner <tglx@...utronix.de>
> > > > > > ---
> > > > > 
> > > > > Acked-by: Vineet Gupta <vgupta@...opsys.com>
> > > > > 
> > > > > @Daniel is this going via timer tree or you want me to pick it up.
> > > > 
> > > > I will take care of it.
> > > 
> > > Please resend without the arch Kconfig change
> > 
> > I'm wondering if there's a problem with arc/arc/Kconfig change going
> > through your tree? This way it will be really atomic change and it will be
> > much easier to back-port (and that's what we'd really like to happen).
> > 
> > If Vineet is OK with that IMHO it's safe to keep it in the one and only commit.
> > 
> > Otherwise should I just split this patch in 2 and still submit them as series or
> > have 2 completely not-related patches one for you and one for Vineet?
> > 
> > In that case do I understand correctly that we may enable GENERIC_SCHED_CLOCK
> > for ARC even before proposed change for arc_timer.c gets merged - i.e. with no
> > special GENERIC_SCHED_CLOCK driver we'll safely fall-back to jiffie-based
> > sched clock which we anyways use now when GENERIC_SCHED_CLOCK is disabled, right?
> 
> The ARC's Kconfig part does not apply on tip/timers/core.

May I have a reference to that tree so I may check what gets in the way there
and then I'll just move "select GENERIC_SCHED_CLOCK" a bit below so there're no
clashes any longer.

-Alexey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ